conflict_resolution
stringlengths 27
16k
|
---|
<<<<<<<
=======
import {
SafeBlueArea,
BlueNavigationStyle,
BlueSpacing20,
BlueCopyTextToClipboard,
BlueButton,
BlueTextCentered,
BlueText,
} from '../../BlueComponents';
>>>>>>> |
<<<<<<<
import { AppStorage, PlaceholderWallet } from '../../class';
import WalletImport from '../../class/walletImport';
import ActionSheet from '../ActionSheet';
import ImagePicker from 'react-native-image-picker';
const EV = require('../../events');
const A = require('../../analytics');
let BlueApp: AppStorage = require('../../BlueApp');
const loc = require('../../loc');
const BlueElectrum = require('../../BlueElectrum');
const LocalQRCode = require('@remobile/react-native-qrcode-local-image');
=======
import { PlaceholderWallet, AppStorage } from '../../class';
import WalletImport from '../../class/wallet-import';
import ActionSheet from '../ActionSheet';
import ImagePicker from 'react-native-image-picker';
const EV = require('../../events');
const A = require('../../analytics');
let BlueApp: AppStorage = require('../../BlueApp');
const loc = require('../../loc');
const BlueElectrum = require('../../BlueElectrum');
const LocalQRCode = require('@remobile/react-native-qrcode-local-image');
>>>>>>>
import { AppStorage, PlaceholderWallet } from '../../class';
import WalletImport from '../../class/wallet-import';
import ActionSheet from '../ActionSheet';
import ImagePicker from 'react-native-image-picker';
const EV = require('../../events');
const A = require('../../analytics');
let BlueApp: AppStorage = require('../../BlueApp');
const loc = require('../../loc');
const BlueElectrum = require('../../BlueElectrum');
const LocalQRCode = require('@remobile/react-native-qrcode-local-image');
<<<<<<<
this.interval = setInterval(() => {
this.setState(prev => ({ timeElapsed: prev.timeElapsed + 1 }));
}, 60000);
this.redrawScreen();
this._unsubscribe = this.props.navigation.addListener('focus', this.onNavigationEventFocus);
}
componentWillUnmount() {
clearInterval(this.interval);
this._unsubscribe();
=======
>>>>>>>
this.interval = setInterval(() => {
this.setState(prev => ({ timeElapsed: prev.timeElapsed + 1 }));
}, 60000);
this.redrawScreen();
this._unsubscribe = this.props.navigation.addListener('focus', this.onNavigationEventFocus);
}
componentWillUnmount() {
clearInterval(this.interval);
this._unsubscribe();
<<<<<<<
onNavigationEventFocus = () => {
StatusBar.setBarStyle('dark-content');
this.redrawScreen();
};
choosePhoto = () => {
ImagePicker.launchImageLibrary(
{
title: null,
mediaType: 'photo',
takePhotoButtonTitle: null,
},
response => {
if (response.uri) {
const uri = Platform.OS === 'ios' ? response.uri.toString().replace('file://', '') : response.path.toString();
LocalQRCode.decode(uri, (error, result) => {
if (!error) {
this.onBarScanned(result);
} else {
alert('The selected image does not contain a QR Code.');
}
});
}
},
);
};
copyFromClipbard = async () => {
this.onBarScanned(await Clipboard.getString());
};
sendButtonLongPress = async () => {
const isClipboardEmpty = (await Clipboard.getString()).replace(' ', '').length === 0;
if (Platform.OS === 'ios') {
let options = [loc.send.details.cancel, 'Choose Photo', 'Scan QR Code'];
if (!isClipboardEmpty) {
options.push('Copy from Clipboard');
}
ActionSheet.showActionSheetWithOptions({ options, cancelButtonIndex: 0 }, buttonIndex => {
if (buttonIndex === 1) {
this.choosePhoto();
} else if (buttonIndex === 2) {
this.props.navigation.navigate('ScanQRCode', {
launchedBy: this.props.route.name,
onBarScanned: this.onBarCodeRead,
showFileImportButton: false,
});
} else if (buttonIndex === 3) {
this.copyFromClipbard();
}
});
} else if (Platform.OS === 'android') {
let buttons = [
{
text: loc.send.details.cancel,
onPress: () => {},
style: 'cancel',
},
{
text: 'Choose Photo',
onPress: this.choosePhoto,
},
{
text: 'Scan QR Code',
onPress: () =>
this.props.navigation.navigate('ScanQRCode', {
launchedBy: this.props.route.name,
onBarScanned: this.onBarCodeRead,
showFileImportButton: false,
}),
},
];
if (!isClipboardEmpty) {
buttons.push({
text: 'Copy From Clipboard',
onPress: this.copyFromClipbard,
});
}
ActionSheet.showActionSheetWithOptions({
title: '',
message: '',
buttons,
});
}
};
=======
onNavigationEventDidFocus = () => {
StatusBar.setBarStyle('dark-content');
this.redrawScreen();
};
choosePhoto = () => {
ImagePicker.launchImageLibrary(
{
title: null,
mediaType: 'photo',
takePhotoButtonTitle: null,
},
response => {
if (response.uri) {
const uri = Platform.OS === 'ios' ? response.uri.toString().replace('file://', '') : response.path.toString();
LocalQRCode.decode(uri, (error, result) => {
if (!error) {
this.onBarScanned(result);
} else {
alert('The selected image does not contain a QR Code.');
}
});
}
},
);
};
copyFromClipbard = async () => {
this.onBarScanned(await Clipboard.getString());
};
sendButtonLongPress = async () => {
const isClipboardEmpty = (await Clipboard.getString()).replace(' ', '').length === 0;
if (Platform.OS === 'ios') {
let options = [loc.send.details.cancel, 'Choose Photo', 'Scan QR Code'];
if (!isClipboardEmpty) {
options.push('Copy from Clipboard');
}
ActionSheet.showActionSheetWithOptions({ options, cancelButtonIndex: 0 }, buttonIndex => {
if (buttonIndex === 1) {
this.choosePhoto();
} else if (buttonIndex === 2) {
this.props.navigation.navigate('ScanQRCode', {
launchedBy: this.props.navigation.state.routeName,
onBarScanned: this.onBarCodeRead,
showFileImportButton: false,
});
} else if (buttonIndex === 3) {
this.copyFromClipbard();
}
});
} else if (Platform.OS === 'android') {
let buttons = [
{
text: loc.send.details.cancel,
onPress: () => {},
style: 'cancel',
},
{
text: 'Choose Photo',
onPress: this.choosePhoto,
},
{
text: 'Scan QR Code',
onPress: () =>
this.props.navigation.navigate('ScanQRCode', {
launchedBy: this.props.navigation.state.routeName,
onBarScanned: this.onBarCodeRead,
showFileImportButton: false,
}),
},
];
if (!isClipboardEmpty) {
buttons.push({
text: 'Copy From Clipboard',
onPress: this.copyFromClipbard,
});
}
ActionSheet.showActionSheetWithOptions({
title: '',
message: '',
buttons,
});
}
};
>>>>>>>
onNavigationEventFocus = () => {
StatusBar.setBarStyle('dark-content');
this.redrawScreen();
};
choosePhoto = () => {
ImagePicker.launchImageLibrary(
{
title: null,
mediaType: 'photo',
takePhotoButtonTitle: null,
},
response => {
if (response.uri) {
const uri = Platform.OS === 'ios' ? response.uri.toString().replace('file://', '') : response.path.toString();
LocalQRCode.decode(uri, (error, result) => {
if (!error) {
this.onBarScanned(result);
} else {
alert('The selected image does not contain a QR Code.');
}
});
}
},
);
};
copyFromClipbard = async () => {
this.onBarScanned(await Clipboard.getString());
};
sendButtonLongPress = async () => {
const isClipboardEmpty = (await Clipboard.getString()).replace(' ', '').length === 0;
if (Platform.OS === 'ios') {
let options = [loc.send.details.cancel, 'Choose Photo', 'Scan QR Code'];
if (!isClipboardEmpty) {
options.push('Copy from Clipboard');
}
ActionSheet.showActionSheetWithOptions({ options, cancelButtonIndex: 0 }, buttonIndex => {
if (buttonIndex === 1) {
this.choosePhoto();
} else if (buttonIndex === 2) {
this.props.navigation.navigate('ScanQRCode', {
launchedBy: this.props.route.name,
onBarScanned: this.onBarCodeRead,
showFileImportButton: false,
});
} else if (buttonIndex === 3) {
this.copyFromClipbard();
}
});
} else if (Platform.OS === 'android') {
let buttons = [
{
text: loc.send.details.cancel,
onPress: () => {},
style: 'cancel',
},
{
text: 'Choose Photo',
onPress: this.choosePhoto,
},
{
text: 'Scan QR Code',
onPress: () =>
this.props.navigation.navigate('ScanQRCode', {
launchedBy: this.props.route.name,
onBarScanned: this.onBarCodeRead,
showFileImportButton: false,
}),
},
];
if (!isClipboardEmpty) {
buttons.push({
text: 'Copy From Clipboard',
onPress: this.copyFromClipbard,
});
}
ActionSheet.showActionSheetWithOptions({
title: '',
message: '',
buttons,
});
}
};
<<<<<<<
=======
<NavigationEvents onDidFocus={this.onNavigationEventDidFocus} />
>>>>>>> |
<<<<<<<
=======
import Clipboard from '@react-native-clipboard/clipboard';
>>>>>>>
<<<<<<<
import { isCatalyst, isMacCatalina } from '../../blue_modules/environment';
import BlueClipboard from '../../blue_modules/clipboard';
=======
import { isCatalyst, isMacCatalina, isTablet } from '../../blue_modules/environment';
>>>>>>>
import { isCatalyst, isMacCatalina, isTablet } from '../../blue_modules/environment';
import BlueClipboard from '../../blue_modules/clipboard'; |
<<<<<<<
=======
if (typeof Buffer === 'undefined') global.Buffer = require('buffer').Buffer;
global.net = require('react-native-tcp');
>>>>>>>
if (typeof Buffer === 'undefined') global.Buffer = require('buffer').Buffer; |
<<<<<<<
static navigationOptions = ({ navigation }) => ({
...BlueNavigationStyle,
title: loc.send.create.details,
headerRight: navigation.state.params.exportTXN ? (
<TouchableOpacity style={styles.export} onPress={navigation.state.params.exportTXN}>
<Icon size={22} name="share-alternative" type="entypo" color={BlueApp.settings.foregroundColor} />
</TouchableOpacity>
) : null,
});
=======
static navigationOptions = ({ navigation, route }) => {
let headerRight;
if (route.params.exportTXN) {
headerRight = () => (
<TouchableOpacity style={{ marginRight: 16 }} onPress={route.params.exportTXN}>
<Icon size={22} name="share-alternative" type="entypo" color={BlueApp.settings.foregroundColor} />
</TouchableOpacity>
);
} else {
headerRight = null;
}
return {
...BlueNavigationStyle,
title: loc.send.create.details,
headerRight,
};
};
>>>>>>>
static navigationOptions = ({ navigation, route }) => {
let headerRight;
if (route.params.exportTXN) {
headerRight = () => (
<TouchableOpacity style={styles.export} onPress={route.params.exportTXN}>
<Icon size={22} name="share-alternative" type="entypo" color={BlueApp.settings.foregroundColor} />
</TouchableOpacity>
);
} else {
headerRight = null;
}
return {
...BlueNavigationStyle,
title: loc.send.create.details,
headerRight,
};
}; |
<<<<<<<
import { ScrollView, Linking, Dimensions, Image, View, Text, StyleSheet } from 'react-native';
import { useNavigation } from 'react-navigation-hooks';
=======
import { ScrollView, Linking, Dimensions, Image, View, Text } from 'react-native';
import { useNavigation } from '@react-navigation/native';
>>>>>>>
import { ScrollView, Linking, Dimensions, Image, View, Text, StyleSheet } from 'react-native';
import { useNavigation } from '@react-navigation/native';
<<<<<<<
<View style={styles.center}>
<Image style={styles.logo} source={require('../../img/bluebeast.png')} />
<Text style={styles.textFree}>BlueWallet is a free and open source project. Crafted by Bitcoin users.</Text>
<Text style={styles.textBackup}>Always backup your keys!</Text>
<BlueButton onPress={handleOnRatePress} title="help with a review βπ" />
=======
<View style={{ justifyContent: 'center', alignItems: 'center', marginTop: 54 }}>
<Image
source={require('../../img/bluebeast.png')}
style={{
width: 102,
height: 124,
}}
/>
<Text style={{ maxWidth: 260, marginVertical: 24, color: '#9AA0AA', fontSize: 15, textAlign: 'center', fontWeight: '500' }}>
BlueWallet is a free and open source project. Crafted by Bitcoin users.
</Text>
<Text style={{ maxWidth: 260, marginBottom: 40, color: '#0C2550', fontSize: 15, textAlign: 'center', fontWeight: '500' }}>
Always backup your keys!
</Text>
<BlueButton onPress={handleOnRatePress} title="Leave us a review βπ" />
>>>>>>>
<View style={styles.center}>
<Image style={styles.logo} source={require('../../img/bluebeast.png')} />
<Text style={styles.textFree}>BlueWallet is a free and open source project. Crafted by Bitcoin users.</Text>
<Text style={styles.textBackup}>Always backup your keys!</Text>
<BlueButton onPress={handleOnRatePress} title="Leave us a review βπ" /> |
<<<<<<<
=======
hideFeeSelectionModal = () => this.setState({ isFeeSelectionModalVisible: false });
renderFeeSelectionModal = () => {
const { feePrecalc, fee, networkTransactionFees: nf } = this.state;
const options = [
{
label: loc.send.fee_fast,
time: loc.send.fee_10m,
fee: feePrecalc.fastestFee,
rate: nf.fastestFee,
active: Number(fee) === nf.fastestFee,
},
{
label: loc.send.fee_medium,
time: loc.send.fee_3h,
fee: feePrecalc.mediumFee,
rate: nf.mediumFee,
active: Number(fee) === nf.mediumFee,
},
{
label: loc.send.fee_slow,
time: loc.send.fee_1d,
fee: feePrecalc.slowFee,
rate: nf.slowFee,
active: Number(fee) === nf.slowFee,
},
];
return (
<BottomModal
deviceWidth={this.state.width + this.state.width / 2}
isVisible={this.state.isFeeSelectionModalVisible}
onClose={this.hideFeeSelectionModal}
>
<KeyboardAvoidingView enabled={!Platform.isPad} behavior={Platform.OS === 'ios' ? 'position' : null}>
<View style={styles.modalContent}>
{options.map(({ label, time, fee, rate, active }, index) => (
<TouchableOpacity
key={label}
onPress={() =>
this.setState(({ feePrecalc }) => {
feePrecalc.current = fee;
return { isFeeSelectionModalVisible: false, fee: rate.toString(), feePrecalc };
})
}
style={[styles.feeModalItem, active && styles.feeModalItemActive]}
>
<View style={styles.feeModalRow}>
<Text style={styles.feeModalLabel}>{label}</Text>
<View style={styles.feeModalTime}>
<Text style={styles.feeModalTimeText}>~{time}</Text>
</View>
</View>
<View style={styles.feeModalRow}>
<Text style={styles.feeModalValue}>{fee && this.formatFee(fee)}</Text>
<Text style={styles.feeModalValue}>
{rate} {loc.units.sat_byte}
</Text>
</View>
</TouchableOpacity>
))}
<TouchableOpacity
testID="feeCustom"
style={styles.feeModalCustom}
onPress={async () => {
let error = loc.send.fee_satbyte;
while (true) {
let fee;
try {
fee = await prompt(loc.send.create_fee, error, true, 'numeric');
} catch (_) {
return;
}
if (!/^\d+$/.test(fee)) {
error = loc.send.details_fee_field_is_not_valid;
continue;
}
if (fee < 1) fee = '1';
fee = Number(fee).toString(); // this will remove leading zeros if any
this.setState({ fee, isFeeSelectionModalVisible: false }, this.reCalcTx);
return;
}
}}
>
<Text style={styles.feeModalCustomText}>{loc.send.fee_custom}</Text>
</TouchableOpacity>
</View>
</KeyboardAvoidingView>
</BottomModal>
);
};
>>>>>>>
<<<<<<<
<BottomModal deviceWidth={width + width / 2} isVisible={optionsVisible} onClose={hideOptions}>
<KeyboardAvoidingView behavior={Platform.OS === 'ios' ? 'position' : null}>
<View style={[styles.optionsContent, stylesHook.optionsContent]}>
{wallet.allowSendMax() && (
=======
<BottomModal
deviceWidth={this.state.width + this.state.width / 2}
isVisible={this.state.isAdvancedTransactionOptionsVisible}
onClose={this.hideAdvancedTransactionOptionsModal}
>
<KeyboardAvoidingView enabled={!Platform.isPad} behavior={Platform.OS === 'ios' ? 'position' : null}>
<View style={styles.advancedTransactionOptionsModalContent}>
{this.state.fromWallet.allowSendMax() && (
>>>>>>>
<BottomModal deviceWidth={width + width / 2} isVisible={optionsVisible} onClose={hideOptions}>
<KeyboardAvoidingView enabled={!Platform.isPad} behavior={Platform.OS === 'ios' ? 'position' : null}>
<View style={[styles.optionsContent, stylesHook.optionsContent]}>
{wallet.allowSendMax() && (
<<<<<<<
<View style={{ width }} testID={'Transaction' + index}>
<AmountInput
isLoading={isLoading}
=======
<View style={{ width: this.state.width }} testID={'Transaction' + index}>
<BlueBitcoinAmount
isLoading={this.state.isLoading}
>>>>>>>
<View style={{ width }} testID={'Transaction' + index}>
<AmountInput
isLoading={isLoading}
<<<<<<<
// if utxo is limited we use it to calculate available balance
const balance = utxo ? utxo.reduce((prev, curr) => prev + curr.value, 0) : wallet.getBalance();
const allBalance = formatBalanceWithoutSuffix(balance, BitcoinUnit.BTC, true);
return (
<TouchableWithoutFeedback onPress={Keyboard.dismiss} accessible={false}>
<View style={[styles.root, stylesHook.root]} onLayout={e => setWidth(e.nativeEvent.layout.width)}>
<StatusBar barStyle="light-content" />
<View>
<KeyboardAvoidingView behavior="position">
<FlatList
keyboardShouldPersistTaps="always"
scrollEnabled={addresses.length > 1}
data={addresses}
renderItem={renderBitcoinTransactionInfoFields}
keyExtractor={(_item, index) => `${index}`}
ref={scrollView}
horizontal
pagingEnabled
removeClippedSubviews={false}
onMomentumScrollBegin={Keyboard.dismiss}
scrollIndicatorInsets={{ top: 0, left: 8, bottom: 0, right: 8 }}
contentContainerStyle={styles.scrollViewContent}
/>
<View style={[styles.memo, stylesHook.memo]}>
<TextInput
onChangeText={text => setMemo(text)}
placeholder={loc.send.details_note_placeholder}
placeholderTextColor="#81868e"
value={memo}
numberOfLines={1}
style={styles.memoText}
editable={!isLoading}
onSubmitEditing={Keyboard.dismiss}
inputAccessoryViewID={BlueDismissKeyboardInputAccessory.InputAccessoryViewID}
=======
return (
<TouchableWithoutFeedback onPress={Keyboard.dismiss} accessible={false}>
<View style={styles.root} onLayout={this.onLayout}>
<StatusBar barStyle="light-content" />
<View>
<KeyboardAvoidingView enabled={!Platform.isPad} behavior="position">
<FlatList
keyboardShouldPersistTaps="always"
scrollEnabled={this.state.addresses.length > 1}
extraData={this.state.addresses}
data={this.state.addresses}
renderItem={this.renderBitcoinTransactionInfoFields}
keyExtractor={this.keyExtractor}
ref={this.scrollView}
horizontal
pagingEnabled
removeClippedSubviews={false}
onMomentumScrollBegin={Keyboard.dismiss}
scrollIndicatorInsets={{ top: 0, left: 8, bottom: 0, right: 8 }}
contentContainerStyle={styles.scrollViewContent}
>>>>>>>
// if utxo is limited we use it to calculate available balance
const balance = utxo ? utxo.reduce((prev, curr) => prev + curr.value, 0) : wallet.getBalance();
const allBalance = formatBalanceWithoutSuffix(balance, BitcoinUnit.BTC, true);
return (
<TouchableWithoutFeedback onPress={Keyboard.dismiss} accessible={false}>
<View style={[styles.root, stylesHook.root]} onLayout={e => setWidth(e.nativeEvent.layout.width)}>
<StatusBar barStyle="light-content" />
<View>
<KeyboardAvoidingView enabled={!Platform.isPad} behavior="position">
<FlatList
keyboardShouldPersistTaps="always"
scrollEnabled={addresses.length > 1}
data={addresses}
renderItem={renderBitcoinTransactionInfoFields}
keyExtractor={(_item, index) => `${index}`}
ref={scrollView}
horizontal
pagingEnabled
removeClippedSubviews={false}
onMomentumScrollBegin={Keyboard.dismiss}
scrollIndicatorInsets={{ top: 0, left: 8, bottom: 0, right: 8 }}
contentContainerStyle={styles.scrollViewContent}
/>
<View style={[styles.memo, stylesHook.memo]}>
<TextInput
onChangeText={text => setMemo(text)}
placeholder={loc.send.details_note_placeholder}
placeholderTextColor="#81868e"
value={memo}
numberOfLines={1}
style={styles.memoText}
editable={!isLoading}
onSubmitEditing={Keyboard.dismiss}
inputAccessoryViewID={BlueDismissKeyboardInputAccessory.InputAccessoryViewID} |
<<<<<<<
const styles = StyleSheet.create({
root: {
flex: 1,
backgroundColor: BlueCurrentTheme.colors.elevated,
},
scrollViewContent: {
flexGrow: 1,
justifyContent: 'space-between',
},
container: {
flexDirection: 'row',
justifyContent: 'center',
paddingTop: 16,
paddingBottom: 16,
},
rootCamera: {
flex: 1,
justifyContent: 'space-between',
},
rootPadding: {
flex: 1,
paddingTop: 20,
backgroundColor: BlueCurrentTheme.colors.elevated,
},
closeCamera: {
width: 40,
height: 40,
backgroundColor: 'rgba(0,0,0,0.4)',
justifyContent: 'center',
borderRadius: 20,
position: 'absolute',
right: 16,
top: 64,
},
closeCameraImage: {
alignSelf: 'center',
},
blueBigCheckmark: {
marginTop: 143,
marginBottom: 53,
},
hexWrap: {
alignItems: 'center',
flex: 1,
backgroundColor: BlueCurrentTheme.colors.elevated,
},
hexLabel: {
color: BlueCurrentTheme.colors.foregroundColor,
fontWeight: '500',
},
hexInput: {
borderColor: BlueCurrentTheme.colors.formBorder,
backgroundColor: BlueCurrentTheme.colors.inputBackgroundColor,
borderRadius: 4,
marginTop: 20,
color: BlueCurrentTheme.colors.foregroundColor,
fontWeight: '500',
fontSize: 14,
paddingHorizontal: 16,
paddingBottom: 16,
paddingTop: 16,
},
hexTouch: {
marginVertical: 24,
},
hexText: {
color: BlueCurrentTheme.colors.foregroundColor,
fontSize: 15,
fontWeight: '500',
alignSelf: 'center',
},
copyToClipboard: {
justifyContent: 'center',
alignItems: 'center',
},
hidden: {
width: 0,
height: 0,
},
});
=======
>>>>>>>
<<<<<<<
return (
<SafeBlueArea style={styles.root}>
<ScrollView centerContent contentContainerStyle={styles.scrollViewContent} testID="PsbtWithHardwareScrollView">
<View style={styles.container}>
<BlueCard>
<BlueText testID="TextHelperForPSBT">{loc.send.psbt_this_is_psbt}</BlueText>
<BlueSpacing20 />
<Text testID="PSBTHex" style={styles.hidden}>
{this.state.psbt.toHex()}
</Text>
<DynamicQRCode value={this.state.psbt.toHex()} capacity={200} />
<BlueSpacing20 />
<SecondButton
testID="PsbtTxScanButton"
icon={{
name: 'qrcode',
type: 'font-awesome',
color: BlueCurrentTheme.colors.buttonTextColor,
}}
onPress={this.openScanner}
title={loc.send.psbt_tx_scan}
/>
<BlueSpacing20 />
<SecondButton
icon={{
name: 'file-import',
type: 'material-community',
color: BlueCurrentTheme.colors.buttonTextColor,
}}
onPress={this.openSignedTransaction}
title={loc.send.psbt_tx_open}
/>
<BlueSpacing20 />
<SecondButton
icon={{
name: 'share-alternative',
type: 'entypo',
color: BlueCurrentTheme.colors.buttonTextColor,
}}
onPress={this.exportPSBT}
title={loc.send.psbt_tx_export}
=======
return isLoading ? (
<View style={[styles.rootPadding, stylesHook.rootPadding]}>
<ActivityIndicator />
</View>
) : (
<SafeBlueArea style={[styles.root, stylesHook.root]}>
<ScrollView centerContent contentContainerStyle={styles.scrollViewContent} testID="PsbtWithHardwareScrollView">
<View style={styles.container}>
<BlueCard>
<BlueText testID="TextHelperForPSBT">{loc.send.psbt_this_is_psbt}</BlueText>
<BlueSpacing20 />
<DynamicQRCode value={psbt.toHex()} capacity={200} />
<BlueSpacing20 />
<SecondButton
testID="PsbtTxScanButton"
icon={{
name: 'qrcode',
type: 'font-awesome',
color: colors.buttonTextColor,
}}
onPress={openScanner}
title={loc.send.psbt_tx_scan}
/>
<BlueSpacing20 />
<SecondButton
icon={{
name: 'file-import',
type: 'material-community',
color: colors.buttonTextColor,
}}
onPress={openSignedTransaction}
title={loc.send.psbt_tx_open}
/>
<BlueSpacing20 />
<SecondButton
icon={{
name: 'share-alternative',
type: 'entypo',
color: colors.buttonTextColor,
}}
onPress={exportPSBT}
title={loc.send.psbt_tx_export}
/>
<BlueSpacing20 />
<View style={styles.copyToClipboard}>
<BlueCopyToClipboardButton
stringToCopy={typeof psbt === 'string' ? psbt : psbt.toBase64()}
displayText={loc.send.psbt_clipboard}
>>>>>>>
return isLoading ? (
<View style={[styles.rootPadding, stylesHook.rootPadding]}>
<ActivityIndicator />
</View>
) : (
<SafeBlueArea style={[styles.root, stylesHook.root]}>
<ScrollView centerContent contentContainerStyle={styles.scrollViewContent} testID="PsbtWithHardwareScrollView">
<View style={styles.container}>
<BlueCard>
<BlueText testID="TextHelperForPSBT">{loc.send.psbt_this_is_psbt}</BlueText>
<BlueSpacing20 />
<Text testID="PSBTHex" style={styles.hidden}>
{psbt.toHex()}
</Text>
<DynamicQRCode value={psbt.toHex()} capacity={200} />
<BlueSpacing20 />
<SecondButton
testID="PsbtTxScanButton"
icon={{
name: 'qrcode',
type: 'font-awesome',
color: colors.buttonTextColor,
}}
onPress={openScanner}
title={loc.send.psbt_tx_scan}
/>
<BlueSpacing20 />
<SecondButton
icon={{
name: 'file-import',
type: 'material-community',
color: colors.buttonTextColor,
}}
onPress={openSignedTransaction}
title={loc.send.psbt_tx_open}
/>
<BlueSpacing20 />
<SecondButton
icon={{
name: 'share-alternative',
type: 'entypo',
color: colors.buttonTextColor,
}}
onPress={exportPSBT}
title={loc.send.psbt_tx_export}
/>
<BlueSpacing20 />
<View style={styles.copyToClipboard}>
<BlueCopyToClipboardButton
stringToCopy={typeof psbt === 'string' ? psbt : psbt.toBase64()}
displayText={loc.send.psbt_clipboard} |
<<<<<<<
// mouseover handler in the breadcrumb
this.breadcrumbSpotlight = function(event)
{
var obj_id = event.target.getAttribute('obj-id');
if( obj_id )
{
hostspotlighter.spotlight(obj_id);
}
}
// mouseover handler in the breadcrumb
this.breadcrumbClearSpotlight = function(event)
{
var obj_id = event.target.getAttribute('obj-id');
if( obj_id )
{
hostspotlighter.clearSpotlight();
}
}
=======
this.setCookie = function(key, value, time)
{
document.cookie = \
key + "=" + encodeURIComponent(value) +
"; expires=" +
( new Date( new Date().getTime() + ( time || 360*24*60*60*1000 ) ) ).toGMTString() +
"; path=/";
}
this.getCookie = function(key)
{
var value = new RegExp(key + "=([^;]*)").exec(document.cookie);
return value && decodeURIComponent(value[1]);
}
>>>>>>>
this.setCookie = function(key, value, time)
{
document.cookie = \
key + "=" + encodeURIComponent(value) +
"; expires=" +
( new Date( new Date().getTime() + ( time || 360*24*60*60*1000 ) ) ).toGMTString() +
"; path=/";
}
this.getCookie = function(key)
{
var value = new RegExp(key + "=([^;]*)").exec(document.cookie);
return value && decodeURIComponent(value[1]);
}
// mouseover handler in the breadcrumb
this.breadcrumbSpotlight = function(event)
{
var obj_id = event.target.getAttribute('obj-id');
if( obj_id )
{
hostspotlighter.spotlight(obj_id);
}
}
// mouseover handler in the breadcrumb
this.breadcrumbClearSpotlight = function(event)
{
var obj_id = event.target.getAttribute('obj-id');
if( obj_id )
{
hostspotlighter.clearSpotlight();
}
} |
<<<<<<<
import { ActivityIndicator, View, BackHandler, Text, ScrollView, StyleSheet } from 'react-native';
=======
import { ActivityIndicator, View, BackHandler, Text, ScrollView } from 'react-native';
import { useNavigation, useRoute } from '@react-navigation/native';
>>>>>>>
import { ActivityIndicator, View, BackHandler, Text, ScrollView, StyleSheet } from 'react-native';
import { useNavigation, useRoute } from '@react-navigation/native';
<<<<<<<
<View style={styles.word} key={`${secret}${index}`}>
<Text style={styles.wortText}>
{`${index}`}. {secret}
=======
<View
style={{
width: 'auto',
marginRight: 8,
marginBottom: 8,
backgroundColor: '#f5f5f5',
paddingTop: 6,
paddingBottom: 6,
paddingLeft: 8,
paddingRight: 8,
borderRadius: 4,
}}
key={`${secret}${index}`}
>
<Text style={{ color: '#81868E', fontWeight: 'bold' }}>
{`${index + 1}`}. {secret}
>>>>>>>
<View style={styles.word} key={`${secret}${index}`}>
<Text style={styles.wortText}>
{`${index + 1}`}. {secret} |
<<<<<<<
Dimensions,
PixelRatio,
=======
>>>>>>>
<<<<<<<
import { BlueListItem, BlueTransactionListItem, BlueWalletNavigationHeader, BlueAlertWalletExportReminder } from '../../BlueComponents';
=======
import {
BlueSendButtonIcon,
BlueReceiveButtonIcon,
BlueTransactionListItem,
BlueWalletNavigationHeader,
BlueAlertWalletExportReminder,
BlueListItemHooks,
} from '../../BlueComponents';
>>>>>>>
import {
BlueTransactionListItem,
BlueWalletNavigationHeader,
BlueAlertWalletExportReminder,
BlueListItemHooks,
} from '../../BlueComponents';
<<<<<<<
import { BlueCurrentTheme } from '../../components/themes';
import { FContainer, FButton } from '../../components/FloatButtons';
=======
>>>>>>>
<<<<<<<
const buttonFontSize =
PixelRatio.roundToNearestPixel(Dimensions.get('window').width / 26) > 22
? 22
: PixelRatio.roundToNearestPixel(Dimensions.get('window').width / 26);
export default class WalletTransactions extends Component {
walletBalanceText = null;
constructor(props) {
super(props);
// here, when we receive REMOTE_TRANSACTIONS_COUNT_CHANGED we fetch TXs and balance for current wallet
EV(EV.enum.REMOTE_TRANSACTIONS_COUNT_CHANGED, this.refreshTransactionsFunction.bind(this), true);
const wallet = props.route.params.wallet;
this.props.navigation.setParams({ wallet: wallet, isLoading: true });
this.state = {
isHandOffUseEnabled: false,
isLoading: true,
isManageFundsModalVisible: false,
showShowFlatListRefreshControl: false,
wallet: wallet,
itemPriceUnit: wallet.getPreferredBalanceUnit(),
dataSource: this.getTransactions(15),
timeElapsed: 0, // this is to force a re-render for FlatList items.
limit: 15,
pageSize: 20,
};
}
componentDidMount() {
this._unsubscribeFocus = this.props.navigation.addListener('focus', this.onFocus);
this.props.navigation.setParams({ isLoading: false });
this.interval = setInterval(() => {
this.setState(prev => ({ timeElapsed: prev.timeElapsed + 1 }));
}, 60000);
HandoffSettings.isHandoffUseEnabled().then(enabled => this.setState({ isHandOffUseEnabled: enabled }));
this.setState({ isLoading: false });
}
/**
* Forcefully fetches TXs and balance for wallet
*/
refreshTransactionsFunction(delay) {
delay = delay || 4000;
const that = this;
setTimeout(function () {
that.refreshTransactions();
}, delay); // giving a chance to remote server to propagate
}
=======
const WalletTransactions = () => {
const [isHandOffUseEnabled, setIsHandOffUseEnabled] = useState(false);
const [isLoading, setIsLoading] = useState(false);
const [isManageFundsModalVisible, setIsManageFundsModalVisible] = useState(false);
const { wallet } = useRoute().params;
const name = useRoute().name;
const [itemPriceUnit, setItemPriceUnit] = useState(wallet.getPreferredBalanceUnit());
const [dataSource, setDataSource] = useState([]);
const [timeElapsed, setTimeElapsed] = useState(0);
const [limit, setLimit] = useState(15);
const [pageSize, setPageSize] = useState(20);
const { setParams, navigate } = useNavigation();
const { colors } = useTheme();
const windowHeight = useWindowDimensions().height;
const windowWidth = useWindowDimensions().width;
const stylesHook = StyleSheet.create({
advancedTransactionOptionsModalContent: {
backgroundColor: colors.elevated,
},
listHeaderText: {
color: colors.foregroundColor,
},
marketplaceButton1: {
backgroundColor: colors.lightButton,
},
marketplaceButton2: {
backgroundColor: colors.lightButton,
},
marketpalceText1: {
color: colors.cta2,
},
marketpalceText2: {
color: colors.cta2,
},
list: {
backgroundColor: colors.background,
},
});
const interval = setInterval(() => setTimeElapsed(prev => ({ timeElapsed: prev.timeElapsed + 1 })), 60000);
>>>>>>>
const buttonFontSize =
PixelRatio.roundToNearestPixel(Dimensions.get('window').width / 26) > 22
? 22
: PixelRatio.roundToNearestPixel(Dimensions.get('window').width / 26);
const WalletTransactions = () => {
const [isHandOffUseEnabled, setIsHandOffUseEnabled] = useState(false);
const [isLoading, setIsLoading] = useState(false);
const [isManageFundsModalVisible, setIsManageFundsModalVisible] = useState(false);
const { wallet } = useRoute().params;
const name = useRoute().name;
const [itemPriceUnit, setItemPriceUnit] = useState(wallet.getPreferredBalanceUnit());
const [dataSource, setDataSource] = useState([]);
const [timeElapsed, setTimeElapsed] = useState(0);
const [limit, setLimit] = useState(15);
const [pageSize, setPageSize] = useState(20);
const { setParams, navigate } = useNavigation();
const { colors } = useTheme();
const windowHeight = useWindowDimensions().height;
const windowWidth = useWindowDimensions().width;
const stylesHook = StyleSheet.create({
advancedTransactionOptionsModalContent: {
backgroundColor: colors.elevated,
},
listHeaderText: {
color: colors.foregroundColor,
},
marketplaceButton1: {
backgroundColor: colors.lightButton,
},
marketplaceButton2: {
backgroundColor: colors.lightButton,
},
marketpalceText1: {
color: colors.cta2,
},
marketpalceText2: {
color: colors.cta2,
},
list: {
backgroundColor: colors.background,
},
});
const interval = setInterval(() => setTimeElapsed(prev => ({ timeElapsed: prev.timeElapsed + 1 })), 60000);
<<<<<<<
sendButtonPress = () => {
const { navigate } = this.props.navigation;
const { wallet } = this.state;
if (wallet.chain === Chain.OFFCHAIN) {
navigate('ScanLndInvoiceRoot', { screen: 'ScanLndInvoice', params: { fromSecret: wallet.getSecret() } });
} else {
if (wallet.type === WatchOnlyWallet.type && wallet.isHd() && wallet.getSecret().startsWith('zpub')) {
if (wallet.useWithHardwareWalletEnabled()) {
this.navigateToSendScreen();
} else {
Alert.alert(
loc.wallets.details_title,
loc.transactions.enable_hw,
[
{
text: loc._.ok,
onPress: () => {
wallet.setUseWithHardwareWalletEnabled(true);
this.setState({ wallet }, async () => {
await BlueApp.saveToDisk();
this.navigateToSendScreen();
});
},
style: 'default',
},
{ text: loc._.cancel, onPress: () => {}, style: 'cancel' },
],
{ cancelable: false },
);
}
} else {
this.navigateToSendScreen();
}
}
};
sendButtonLongPress = async () => {
=======
const sendButtonLongPress = async () => {
>>>>>>>
const sendButtonPress = () => {
if (wallet.chain === Chain.OFFCHAIN) {
navigate('ScanLndInvoiceRoot', { screen: 'ScanLndInvoice', params: { fromSecret: wallet.getSecret() } });
} else {
if (wallet.type === WatchOnlyWallet.type && wallet.isHd() && wallet.getSecret().startsWith('zpub')) {
if (wallet.useWithHardwareWalletEnabled()) {
navigateToSendScreen();
} else {
Alert.alert(
loc.wallets.details_title,
loc.transactions.enable_hw,
[
{
text: loc._.ok,
onPress: async () => {
wallet.setUseWithHardwareWalletEnabled(true);
await BlueApp.saveToDisk();
navigateToSendScreen();
},
style: 'default',
},
{ text: loc._.cancel, onPress: () => {}, style: 'cancel' },
],
{ cancelable: false },
);
}
} else {
navigateToSendScreen();
}
}
};
const sendButtonLongPress = async () => { |
<<<<<<<
=======
var originalName = name;
>>>>>>>
var originalName = name;
<<<<<<<
if(!message) {
// or name = name + "Request directly"
var portTypes = self.definitions.portTypes;
for(var n in portTypes) {
var portType = portTypes[n];
break;
}
message = self.definitions.messages[portType.methods[name].input.$name];
}
=======
// Support RPC/literal messages where response body contains one element named
// after the operation + 'Response'. See http://www.w3.org/TR/wsdl#_names
if (!message) {
// Determine if this is request or response
var isInput = false;
var isOutput = false;
if ((/Response$/).test(name)) {
isOutput = true;
name = name.replace(/Response$/, '');
} else if ((/Request$/).test(name)) {
isInput = true;
name = name.replace(/Request$/, '');
} else if ((/Solicit$/).test(name)) {
isInput = true;
name = name.replace(/Solicit$/, '');
}
// Look up the appropriate message as given in the portType's operations
var portTypes = self.definitions.portTypes;
var portTypeNames = Object.keys(portTypes);
// Currently this supports only one portType definition.
var portType = portTypes[portTypeNames[0]];
if (isInput) name = portType.methods[name].input.$name;
else name = portType.methods[name].output.$name;
message = self.definitions.messages[name];
// 'cache' this alias to speed future lookups
self.definitions.messages[originalName] = self.definitions.messages[name];
}
>>>>>>>
// Support RPC/literal messages where response body contains one element named
// after the operation + 'Response'. See http://www.w3.org/TR/wsdl#_names
if (!message) {
// Determine if this is request or response
var isInput = false;
var isOutput = false;
if ((/Response$/).test(name)) {
isOutput = true;
name = name.replace(/Response$/, '');
} else if ((/Request$/).test(name)) {
isInput = true;
name = name.replace(/Request$/, '');
} else if ((/Solicit$/).test(name)) {
isInput = true;
name = name.replace(/Solicit$/, '');
}
// Look up the appropriate message as given in the portType's operations
var portTypes = self.definitions.portTypes;
var portTypeNames = Object.keys(portTypes);
// Currently this supports only one portType definition.
var portType = portTypes[portTypeNames[0]];
if (isInput) name = portType.methods[name].input.$name;
else name = portType.methods[name].output.$name;
message = self.definitions.messages[name];
// 'cache' this alias to speed future lookups
self.definitions.messages[originalName] = self.definitions.messages[name];
}
<<<<<<<
stack.push({name: name, object: obj, schema: topSchema && topSchema[name], id:attrs.id});
=======
stack.push({name: originalName, object: obj, schema: topSchema && topSchema[name]});
>>>>>>>
stack.push({name: originalName, object: obj, schema: topSchema && topSchema[name], id:attrs.id}); |
<<<<<<<
<td className="col-md-3 break-all"><a className="toponame" href={'./topologies/' + topology.cluster + '/' + topology.environ + '/' + topology.name}>{topology.name}</a></td>
=======
<td className="col-md-3 break-all"><a className="toponame" href={'/topologies/' + topology.cluster + '/' + topology.environ + '/' + topology.name}>{topology.name}</a></td>
<td className="col-md-1 topostatus">{topology.status}</td>
>>>>>>>
<td className="col-md-3 break-all"><a className="toponame" href={'./topologies/' + topology.cluster + '/' + topology.environ + '/' + topology.name}>{topology.name}</a></td>
<td className="col-md-1 topostatus">{topology.status}</td> |
<<<<<<<
=======
// note: this is some horrible code, I know
var settingsForm;
Template.settings.generate_settings_form = function (setting) {
Meteor.defer(function() {
form().generateFor(setting);
})
}
function form() {
settingsForm = new ModelForm(Settings, settingsFormOptions());
return settingsForm;
}
>>>>>>>
var settingsForm;
Template.settings.generate_settings_form = function (setting) {
Meteor.defer(function() {
form().generateFor(setting);
})
}
function form() {
settingsForm = new ModelForm(Settings, settingsFormOptions());
return settingsForm;
} |
<<<<<<<
// Localisation
i18n.init({
lng: getSetting("language"),
resStore: eval(getSetting("language")),
saveMissing: true,
debug: true
});
Handlebars.registerHelper('i18n',
function(str){
return (i18n != undefined ? i18n.t(str) : str);
}
);
=======
analyticsInit();
>>>>>>>
analyticsInit();
// Localisation
i18n.init({
lng: getSetting("language"),
resStore: eval(getSetting("language")),
saveMissing: true,
debug: true
}); |
<<<<<<<
logger.info("Delaying execution of synclet "+synclet.name+" for "+info.id);
scheduleRun(info, synclet);
return callback();
}
if(!synclet.tolMax){
synclet.tolAt = 0;
synclet.tolMax = 0;
}
// if we can have tolerance, try again later
if(synclet.tolAt > 0)
{
synclet.tolAt--;
logger.verbose("tolerance now at "+synclet.tolAt+" synclet "+synclet.name+" for "+info.id);
scheduleRun(info, synclet);
return callback();
=======
setTimeout(function() {
executeSynclet(info, synclet, callback);
}, 1000);
return;
>>>>>>>
setTimeout(function() {
executeSynclet(info, synclet, callback);
}, 1000);
return;
}
if(!synclet.tolMax){
synclet.tolAt = 0;
synclet.tolMax = 0;
}
// if we can have tolerance, try again later
if(synclet.tolAt > 0)
{
synclet.tolAt--;
logger.verbose("tolerance now at "+synclet.tolAt+" synclet "+synclet.name+" for "+info.id);
scheduleRun(info, synclet);
return callback(); |
<<<<<<<
sync.init(auth, mongoCollections);
app.get('/friends', friends);
app.get('/checkins', checkins);
=======
sync.init(auth, function() {
console.error('auth completed');
app.get('/friends', friends);
app.get('/checkins', checkins);
sync.eventEmitter.on('checkin/foursquare', function(eventObj) {
locker.event('checkin/foursquare', eventObj);
});
sync.eventEmitter.on('contact/foursquare', function(eventObj) {
locker.event('contact/foursquare', eventObj);
});
callback();
});
>>>>>>>
sync.init(auth, mongoCollections);
app.get('/friends', friends);
app.get('/checkins', checkins);
sync.eventEmitter.on('checkin/foursquare', function(eventObj) {
locker.event('checkin/foursquare', eventObj);
});
sync.eventEmitter.on('contact/foursquare', function(eventObj) {
locker.event('contact/foursquare', eventObj);
}); |
<<<<<<<
"connect" : "connect"
=======
"allApps" : "allApps",
"viewAll" : "viewAll",
"connect" : "connect",
"settings" : "settings"
>>>>>>>
"connect" : "connect"
"allApps" : "allApps",
"connect" : "connect",
"settings" : "settings"
<<<<<<<
$.history.init(function(hash){
// if(hash === "") {
// initialize your app
loadDiv(window.location.hash.substring(1) || $('.installed-apps a').data('id') || defaultApp);
// } else {
// loadDiv(window.location.hash.substring(1) || $('.installed-apps a').data('id') || defaultApp);
// }
}, { unescape: ",/" });
=======
$.history.init(function(hash){
if(hash === "") {
// initialize your app
loadDiv(window.location.hash.substring(1) || $('.installed-apps a').data('id') || '#Explore-' + defaultApp);
} else {
loadDiv(window.location.hash.substring(1) || $('.installed-apps a').data('id') || '#Explore-' + defaultApp);
}
}, { unescape: ",/" });
>>>>>>>
$.history.init(function(hash){
loadDiv(window.location.hash.substring(1) || $('.installed-apps a').data('id') || '#Explore-' + defaultApp);
}, { unescape: ",/" });
<<<<<<<
=======
handlers.Settings = loadApp;
handlers.viewAll = loadApp;
>>>>>>>
handlers.Settings = loadApp;
handlers.viewAll = loadApp;
<<<<<<<
registry.getInstalledApps(function(apps) {
var app = apps[appName];
if(!app) return;
registry.getConnectedServices(app.uses, function(connected) {
registry.getUnConnectedServices(app.uses, function(unconnected) {
=======
registry.getMap(function(err, map) {
if(err || !map[appName]) return callback(err, map);
var app = map[appName];
// this {repository: app} stuff is because the map flattens the things in the repository field
// up to the top level, but these registry functions expect them to be inside of repository
registry.getConnectedServices({repository: app}, function(connected) {
registry.getUnConnectedServices({repository: app}, function(unconnected) {
>>>>>>>
registry.getMap(function(err, map) {
if(err || !map[appName]) return callback(err, map);
var app = map[appName];
// this {repository: app} stuff is because the map flattens the things in the repository field
// up to the top level, but these registry functions expect them to be inside of repository
registry.getConnectedServices({repository: app}, function(connected) {
registry.getUnConnectedServices({repository: app}, function(unconnected) { |
<<<<<<<
"allApps" : "allApps",
"publish" : "publish",
"viewAll" : "viewAll",
// "exploreApps" : "exploreApps",
// "registryApp" : "registryApp",
"connect" : "connect",
"settings" : "settings"
=======
"allApps" : "allApps",
"publish" : "publish",
"viewAll" : "viewAll",
"connect" : "connect"
>>>>>>>
"allApps" : "allApps",
"publish" : "publish",
"viewAll" : "viewAll",
"connect" : "connect",
"settings" : "settings"
<<<<<<<
$.history.init(function(hash){
if(hash === "") {
// initialize your app
loadDiv(window.location.hash.substring(1) || $('.installed-apps a').data('id') || defaultApp);
} else {
loadDiv(window.location.hash.substring(1) || $('.installed-apps a').data('id') || defaultApp);
}
}, { unescape: ",/" });
=======
$.history.init(function(hash){
// if(hash === "") {
// initialize your app
loadDiv(window.location.hash.substring(1) || $('.installed-apps a').data('id') || defaultApp);
// } else {
// loadDiv(window.location.hash.substring(1) || $('.installed-apps a').data('id') || defaultApp);
// }
}, { unescape: ",/" });
>>>>>>>
$.history.init(function(hash){
if(hash === "") {
// initialize your app
loadDiv(window.location.hash.substring(1) || $('.installed-apps a').data('id') || defaultApp);
} else {
loadDiv(window.location.hash.substring(1) || $('.installed-apps a').data('id') || defaultApp);
}
}, { unescape: ",/" });
<<<<<<<
if (window.location.hash === '#Create-devdocs' || window.location.hash === '#Explore-Featured') {
$.cookie("firstvisit", null, {path: '/' });
} else {
doModal();
}
=======
if (window.location.hash === '#Develop-devdocs' || window.location.hash === '#AppGallery-Featured') {
$.cookie("firstvisit", null, {path: '/' });
} else {
doModal();
}
>>>>>>>
if (window.location.hash === '#Develop-devdocs' || window.location.hash === '#AppGallery-Featured') {
$.cookie("firstvisit", null, {path: '/' });
} else {
doModal();
}
<<<<<<<
handlers.Create = loadApp;
=======
handlers.Develop = loadApp;
>>>>>>>
handlers.Develop = loadApp; |
<<<<<<<
, glatitude = {"provider" : "glatitude",
"endPoint" : "https://accounts.google.com/o/oauth2/token",
"redirectURI" : "auth/glatitude/auth",
"grantType" : "authorization_code"}
=======
, gplus = {"provider" : "gplus",
"endPoint" : "https://accounts.google.com/o/oauth2/token",
"redirectURI" : "auth/gplus/auth",
"grantType" : "authorization_code"}
>>>>>>>
, gplus = {"provider" : "gplus",
"endPoint" : "https://accounts.google.com/o/oauth2/token",
"redirectURI" : "auth/gplus/auth",
"grantType" : "authorization_code"}
, glatitude = {"provider" : "glatitude",
"endPoint" : "https://accounts.google.com/o/oauth2/token",
"redirectURI" : "auth/glatitude/auth",
"grantType" : "authorization_code"}
<<<<<<<
locker.get('/auth/glatitude/auth', function(req, res) {
handleOAuth2Post(req.param('code'), glatitude, res);
});
=======
locker.get('/auth/gplus/auth', function(req, res) {
handleOAuth2Post(req.param('code'), gplus, res);
});
>>>>>>>
locker.get('/auth/gplus/auth', function(req, res) {
handleOAuth2Post(req.param('code'), gplus, res);
});
locker.get('/auth/glatitude/auth', function(req, res) {
handleOAuth2Post(req.param('code'), glatitude, res);
});
<<<<<<<
auth = {};
auth.appKey = apiKeys[options.provider].appKey;
auth.appSecret = apiKeys[options.provider].appSecret;
=======
auth = {};
if (options.provider === 'gcontacts') {
auth.clientID = apiKeys[options.provider].appKey;
auth.clientSecret = apiKeys[options.provider].appSecret;
}
>>>>>>>
auth = {};
auth.clientID = apiKeys[options.provider].appKey;
auth.clientSecret = apiKeys[options.provider].appSecret; |
<<<<<<<
if(thiz.repository && thiz.repository.type === 'app' && thiz.name && thiz.name.indexOf(gh.login + '-') >= 0) {
=======
if(thiz.repository && thiz.repository.type === 'app' && thiz.name && thiz.name.indexOf(gh.login + '-') === 0) {
>>>>>>>
if(thiz.repository && thiz.repository.type === 'app' && thiz.name && thiz.name.indexOf(gh.login + '-') === 0) {
<<<<<<<
regIndex[updated.name] = updated; // shim it in, sync will replace it eventually too just to be sure
var issues = require(path.join(lconfig.lockerDir, serviceManager.map('github').srcdir, "issue.js")); // this feels dirty, but is also reusing the synclet pattern
// TODO fill out issue
issues.sync(serviceManager.map('github'), function(err, js){
if(err) return callback(err);
if(!js || !js.data || !js.data.issue || !js.data.issue[0]) return callback("missing issue");
// save pending=issue# to package.json
callback(null, updated, js.data.issue[0]);
});
})
=======
regIndex[arg.id] = updated; // shim it in, sync will replace it eventually too just to be sure
serviceManager.mapUpsert(pjs);
callback(null, updated);
});
>>>>>>>
serviceManager.mapUpsert(pjs);
var issues = require(path.join(lconfig.lockerDir, serviceManager.map('github').srcdir, "issue.js")); // this feels dirty, but is also reusing the synclet pattern
// TODO fill out issue
issues.sync(serviceManager.map('github'), function(err, js){
if(err) return callback(err);
if(!js || !js.data || !js.data.issue || !js.data.issue[0]) return callback("missing issue");
// save pending=issue# to package.json
callback(null, updated, js.data.issue[0]);
});
}) |
<<<<<<<
export const ChatInput = ({ ListingContext, scrollToBottom }) => {
=======
const MAX_TEXTAREA_HEIGHT = 120
export const ChatInput = ({ ListingContext }) => {
>>>>>>>
const MAX_TEXTAREA_HEIGHT = 120
export const ChatInput = ({ ListingContext, scrollToBottom }) => {
<<<<<<<
setTimeout(() => scrollToBottom("force"), 300)
=======
resizeInput(evt.target, true);
>>>>>>>
setTimeout(() => scrollToBottom("force"), 300)
resizeInput(evt.target, true); |
<<<<<<<
this.state = { item: null, scores: {} };
this.onUpdate = this.onUpdate.bind(this);
this.onSubscribe = this.onSubscribe.bind(this);
this.onRefresh = throttle(this.onUpdate, 100, { trailing: true });
=======
const {expanded=false} = props;
this.state = { item: null, scores: {}, expanded };
this.onToggleExpando = this.onToggleExpando.bind(this);
this.onRefresh = this.onRefresh.bind(this);
>>>>>>>
const { expanded = false } = props;
this.state = { item: null, scores: {}, expanded };
this.onToggleExpando = this.onToggleExpando.bind(this);
this.onUpdate = this.onUpdate.bind(this);
this.onSubscribe = this.onSubscribe.bind(this);
this.onRefresh = throttle(this.onUpdate, 100, { trailing: true });
<<<<<<<
const {
id, expanded, isMine, rank, collapseThreshold=null,
Loading: LoadingComponent = Loading, ...props
} = this.props;
const score = ((scores.ups || 0) - (scores.downs || 0) || 0);
=======
const { id, isMine, expanded, rank, collapseThreshold=null } = this.props;
const score = scores.ups - scores.downs;
>>>>>>>
const {
id, isMine, rank, collapseThreshold=null,
Loading: LoadingComponent = Loading, ...props
} = this.props;
const score = ((scores.ups || 0) - (scores.downs || 0) || 0);
<<<<<<<
onSubscribe={this.onSubscribe}
=======
onToggleExpando={this.onToggleExpando}
>>>>>>>
onSubscribe={this.onSubscribe}
onToggleExpando={this.onToggleExpando}
<<<<<<<
}
export const Thing = injectState(ThingBase);
=======
onToggleExpando() {
this.setState({ expanded: !this.state.expanded });
}
}
>>>>>>>
onToggleExpando() {
this.setState({ expanded: !this.state.expanded });
}
}
export const Thing = injectState(ThingBase); |
<<<<<<<
const DEFAULT_STATS_INTERVAL = 1000;
=======
const DEFAULT_STATS_INTERVAL = 1000;
>>>>>>>
<<<<<<<
// Periodic stats gathering interval (milliseconds).
// @type {Number}
this._statsInterval = DEFAULT_STATS_INTERVAL;
=======
>>>>>>>
// Periodic stats gathering interval (milliseconds).
// @type {Number}
this._statsInterval = DEFAULT_STATS_INTERVAL; |
<<<<<<<
'__context["' + operand1 + '"] = __forloopIter[forloop.key];\n' +
parser.compile.apply(this, [indent + ' ', parentBlock]);
=======
'_context["' + operand1 + '"] = __forloopIter[forloop.key];\n' +
parser.compile.call(this, indent + ' ');
>>>>>>>
'_context["' + operand1 + '"] = __forloopIter[forloop.key];\n' +
parser.compile.apply(this, [indent + ' ', parentBlock]);
<<<<<<<
' var __output = "";\n' +
parser.compile.apply({ tokens: [value] }, [indent, parentBlock]) + '\n' +
' return __output; })();\n';
=======
' var _output = "";\n' +
parser.compile.call({ tokens: [value] }, indent) + '\n' +
' return _output; })();\n';
>>>>>>>
' var _output = "";\n' +
parser.compile.apply({ tokens: [value] }, [indent, parentBlock]) + '\n' +
' return _output; })();\n';
<<<<<<<
out += '__context.' + macro + ' = function (' + args + ') {\n';
out += ' var __output = "";\n';
out += parser.compile.apply(this, [indent + ' ', parentBlock]);
out += ' return __output;\n';
=======
out += '_context.' + macro + ' = function (' + args + ') {\n';
out += ' var _output = "";\n';
out += parser.compile.call(this, indent + ' ');
out += ' return _output;\n';
>>>>>>>
out += '_context.' + macro + ' = function (' + args + ') {\n';
out += ' var _output = "";\n';
out += parser.compile.apply(this, [indent + ' ', parentBlock]);
out += ' return _output;\n';
<<<<<<<
value += ' var __output = "";\n';
value += parser.compile.apply(this, [indent + ' ', parentBlock]) + '\n';
value += ' return __output;\n';
=======
value += ' var _output = "";\n';
value += parser.compile.call(this, indent + ' ') + '\n';
value += ' return _output;\n';
>>>>>>>
value += ' var _output = "";\n';
value += parser.compile.apply(this, [indent + ' ', parentBlock]) + '\n';
value += ' return _output;\n'; |
<<<<<<<
doc: "Prompts for the name of a file to edit, opening and creating it if necessary.",
hook: function() {
eventbus.on("newfilecreated", function(path) {
if (fileCache.indexOf(path) === -1) {
fileCache.push(path);
updateFilteredFileCache();
}
});
eventbus.on("filedeleted", function(path) {
var index = fileCache.indexOf(path);
if (index !== -1) {
fileCache.splice(index, 1);
updateFilteredFileCache();
}
});
eventbus.on("configchanged", function() {
updateFilteredFileCache();
});
},
=======
>>>>>>>
doc: "Prompts for the name of a file to edit, opening and creating it if necessary.", |
<<<<<<<
/* global define, sandboxRequest*/
define(function(require, exports, module) {
return {
readFile: function(path, callback) {
sandboxRequest("zed/configfs", "readFile", [path], callback);
},
writeFile: function(path, content, callback) {
sandboxRequest("zed/configfs", "writeFile", [path, content], callback);
},
deleteFile: function(path, callback) {
sandboxRequest("zed/configfs", "deleteFile", [path], callback);
}
};
});
=======
/* global sandboxRequest*/
module.exports = {
readFile: function(path, callback) {
sandboxRequest("zed/configfs", "readFile", [path], callback);
}
};
>>>>>>>
/* global sandboxRequest*/
module.exports = {
readFile: function(path, callback) {
sandboxRequest("zed/configfs", "readFile", [path], callback);
},
writeFile: function(path, content, callback) {
sandboxRequest("zed/configfs", "writeFile", [path, content], callback);
},
deleteFile: function(path, callback) {
sandboxRequest("zed/configfs", "deleteFile", [path], callback);
}
}; |
<<<<<<<
/* global define, sandboxRequest*/
define(function(require, exports, module) {
return {
readFile: function(path, callback) {
sandboxRequest("zed/project", "readFile", [path], callback);
},
writeFile: function(path, text, callback) {
sandboxRequest("zed/project", "writeFile", [path, text], callback);
},
listFiles: function(callback) {
sandboxRequest("zed/project", "listFiles", [], callback);
},
reloadFileList: function(callback) {
sandboxRequest("zed/project", "reloadFileList", [], callback);
},
isConfig: function(callback) {
sandboxRequest("zed/project", "isConfig", [], callback);
}
};
});
=======
/* global sandboxRequest*/
module.exports = {
readFile: function(path, callback) {
sandboxRequest("zed/project", "readFile", [path], callback);
},
writeFile: function(path, text, callback) {
sandboxRequest("zed/project", "writeFile", [path, text], callback);
},
listFiles: function(callback) {
sandboxRequest("zed/project", "listFiles", [], callback);
},
};
>>>>>>>
/* global sandboxRequest*/
module.exports = {
readFile: function(path, callback) {
sandboxRequest("zed/project", "readFile", [path], callback);
},
writeFile: function(path, text, callback) {
sandboxRequest("zed/project", "writeFile", [path, text], callback);
},
listFiles: function(callback) {
sandboxRequest("zed/project", "listFiles", [], callback);
},
reloadFileList: function(callback) {
sandboxRequest("zed/project", "reloadFileList", [], callback);
},
isConfig: function(callback) {
sandboxRequest("zed/project", "isConfig", [], callback);
}
}; |
<<<<<<<
let allowTransition = true
if (this.props.onClick)
this.props.onClick(event)
=======
>>>>>>> |
<<<<<<<
to: oneOfType([ string, object, func ]).isRequired,
=======
to: oneOfType([ string, object ]),
>>>>>>>
to: oneOfType([ string, object, func ]),
<<<<<<<
const toLocation = resolveToLocation(to, router)
props.href = router.createHref(toLocation)
=======
// If user does not specify a `to` prop, return an empty anchor tag.
if (to == null) { return <a {...props} /> }
const location = createLocationDescriptor(to, { query, hash, state })
props.href = router.createHref(location)
>>>>>>>
// If user does not specify a `to` prop, return an empty anchor tag.
if (to == null) { return <a {...props} /> }
const toLocation = resolveToLocation(to, router)
props.href = router.createHref(toLocation) |
<<<<<<<
=======
propTypes: { router: routerShape },
getWrappedInstance() {
invariant(
withRef,
'To access the wrapped instance, you need to specify ' +
'`{ withRef: true }` as the second argument of the withRouter() call.'
)
return this.wrappedInstance
},
>>>>>>>
propTypes: { router: routerShape },
getWrappedInstance() {
invariant(
withRef,
'To access the wrapped instance, you need to specify ' +
'`{ withRef: true }` as the second argument of the withRouter() call.'
)
return this.wrappedInstance
},
<<<<<<<
const { router } = this.context
const { params, location, routes } = router
return (
<WrappedComponent
{...this.props}
router={router}
params={params}
location={location}
routes={routes}
/>
)
=======
const router = this.props.router || this.context.router
const props = { ...this.props, router }
if (withRef) {
props.ref = (c) => { this.wrappedInstance = c }
}
return <WrappedComponent {...props} />
>>>>>>>
const router = this.props.router || this.context.router
const { params, location, routes } = router
const props = { ...this.props, router, params, location, routes }
if (withRef) {
props.ref = (c) => { this.wrappedInstance = c }
}
return <WrappedComponent {...props} /> |
<<<<<<<
var useragent = require("ace/lib/useragent");
=======
var barEl;
>>>>>>>
var useragent = require("ace/lib/useragent");
var barEl; |
<<<<<<<
function partitionBy(byHandler) {
eventProcessor.partitionBy(byHandler);
return {
when: function (handlers) {
translateOn(handlers);
},
whenAny: function (handler) {
eventProcessor.on_any(handler);
}
};
}
=======
function emitStateUpdated() {
eventProcessor.emit_state_updated();
}
function when(handlers) {
translateOn(handlers);
return {
emitStateUpdated: emitStateUpdated,
};
}
function whenAny(handler) {
eventProcessor.on_any(handler);
return {
emitStateUpdated: emitStateUpdated,
};
}
function foreachStream() {
eventProcessor.byStream();
// NOTE: this may be removed in the future
// currently we do not support foreach projections without emitStateUpdated
eventProcessor.emit_state_updated();
return {
when: when,
whenAny: whenAny,
};
}
>>>>>>>
function emitStateUpdated() {
eventProcessor.emit_state_updated();
}
function when(handlers) {
translateOn(handlers);
return {
emitStateUpdated: emitStateUpdated,
};
}
function whenAny(handler) {
eventProcessor.on_any(handler);
return {
emitStateUpdated: emitStateUpdated,
};
}
function foreachStream() {
eventProcessor.byStream();
// NOTE: this may be removed in the future
// currently we do not support foreach projections without emitStateUpdated
eventProcessor.emit_state_updated();
return {
when: when,
whenAny: whenAny,
};
}
function partitionBy(byHandler) {
eventProcessor.partitionBy(byHandler);
// NOTE: this may be removed in the future
// currently we do not support foreach projections without emitStateUpdated
eventProcessor.emit_state_updated();
return {
when: when,
whenAny: whenAny,
};
}
<<<<<<<
partitionBy: partitionBy,
foreachStream: function () {
eventProcessor.byStream();
return {
when: function (handlers) {
translateOn(handlers);
},
whenAny: function (handler) {
eventProcessor.on_any(handler);
}
};
},
when: function (handlers) {
translateOn(handlers);
},
whenAny: function (handler) {
eventProcessor.on_any(handler);
}
=======
foreachStream: foreachStream,
when: when,
whenAny: whenAny,
>>>>>>>
partitionBy: partitionBy,
foreachStream: foreachStream,
when: when,
whenAny: whenAny,
<<<<<<<
partitionBy: partitionBy,
foreachStream: function () {
eventProcessor.byStream();
return {
when: function (handlers) {
translateOn(handlers);
},
whenAny: function (handler) {
eventProcessor.on_any(handler);
}
};
},
when: function (handlers) {
translateOn(handlers);
},
whenAny: function (handler) {
eventProcessor.on_any(handler);
}
=======
foreachStream: foreachStream,
when: when,
whenAny: whenAny,
>>>>>>>
partitionBy: partitionBy,
when: when,
whenAny: whenAny,
foreachStream: foreachStream, |
<<<<<<<
read: function (key, cb) {
if (typeof key === 'function') {
cb = key
key = null
}
function select (obj) {
return key ? obj[key] : obj
}
fs.readFile(filename, function (err, buf) {
=======
read: function (cb) {
db.fs.readFile(db.name, function (err, buf) {
>>>>>>>
read: function (key, cb) {
if (typeof key === 'function') {
cb = key
key = null
}
db.fs.readFile(db.name, function (err, buf) {
<<<<<<<
debug('reading', filename, jsonString)
return cb(null, select(parsed))
=======
debug('reading', db.name, jsonString)
return cb(null, parsed)
>>>>>>>
debug('reading', db.name, jsonString)
return cb(null, select(parsed)) |
<<<<<<<
/* global define, sandboxRequest*/
define(function(require, exports, module) {
return {
readFile: function(path, callback) {
sandboxRequest("zed/project", "readFile", [path], callback);
},
writeFile: function(path, text, callback) {
sandboxRequest("zed/project", "writeFile", [path, text], callback);
},
listFiles: function(callback) {
sandboxRequest("zed/project", "listFiles", [], callback);
},
reloadFileList: function(callback) {
sandboxRequest("zed/project", "reloadFileList", [], callback);
},
isConfig: function(callback) {
sandboxRequest("zed/project", "isConfig", [], callback);
}
};
});
=======
/* global sandboxRequest*/
module.exports = {
readFile: function(path, callback) {
sandboxRequest("zed/project", "readFile", [path], callback);
},
writeFile: function(path, text, callback) {
sandboxRequest("zed/project", "writeFile", [path, text], callback);
},
listFiles: function(callback) {
sandboxRequest("zed/project", "listFiles", [], callback);
},
};
>>>>>>>
/* global sandboxRequest*/
module.exports = {
readFile: function(path, callback) {
sandboxRequest("zed/project", "readFile", [path], callback);
},
writeFile: function(path, text, callback) {
sandboxRequest("zed/project", "writeFile", [path, text], callback);
},
listFiles: function(callback) {
sandboxRequest("zed/project", "listFiles", [], callback);
},
reloadFileList: function(callback) {
sandboxRequest("zed/project", "reloadFileList", [], callback);
},
isConfig: function(callback) {
sandboxRequest("zed/project", "isConfig", [], callback);
}
}; |
<<<<<<<
return new IndexFileStream(require('./lib/index-static.jsx'))
=======
var meta = {};
var execSync = require('child_process').execSync;
try {
meta['git-rev'] = execSync('git rev-parse HEAD', {
cwd: __dirname,
encoding: 'utf8'
}).slice(0, 40);
} catch (e) {}
return new IndexFileStream(require('./lib/index-static.jsx'), {
meta: meta
})
.pipe(prettify({
indent_char: ' ',
indent_size: 2
}))
>>>>>>>
var meta = {};
var execSync = require('child_process').execSync;
try {
meta['git-rev'] = execSync('git rev-parse HEAD', {
cwd: __dirname,
encoding: 'utf8'
}).slice(0, 40);
} catch (e) {}
return new IndexFileStream(require('./lib/index-static.jsx'), {
meta: meta
}) |
<<<<<<<
Meteor.call('updateRegionCounters', {}, logAsyncErrors);
=======
// Update list of organizers per course
Meteor.call('course.updateGroups', {}, logAsyncErrors);
// Update List of badges per user
Meteor.call('user.updateBadges', {}, logAsyncErrors);
>>>>>>>
// Update list of organizers per course
Meteor.call('course.updateGroups', {}, logAsyncErrors);
// Update List of badges per user
Meteor.call('user.updateBadges', {}, logAsyncErrors);
Meteor.call('updateRegionCounters', {}, logAsyncErrors); |
<<<<<<<
var get_courselist=function(listparameters){
=======
get_courselist=function(listparameters){
Session.set("isEditing", false); //unschΓΆner temporaerer bugfix
>>>>>>>
var get_courselist=function(listparameters){
Session.set("isEditing", false); //unschΓΆner temporaerer bugfix
<<<<<<<
if(Session.get('region')) find.region=Session.get('region')
// modify query --------------------
=======
>>>>>>> |
<<<<<<<
import { PleaseLogin } from '/imports/ui/lib/please-login.js';
=======
import '/imports/Filtering.js';
import '/imports/Predicates.js';
import '/imports/AsyncTools.js';
import '/imports/StringTools.js';
import '/imports/HtmlTools.js';
import { PleaseLogin } from '/imports/ui/account/AccountTools.js';
>>>>>>>
import '/imports/Filtering.js';
import '/imports/Predicates.js';
import '/imports/AsyncTools.js';
import '/imports/StringTools.js';
import '/imports/HtmlTools.js';
import { PleaseLogin } from '/imports/ui/lib/please-login.js'; |
<<<<<<<
=======
//this will not be necessary once the above is active
>>>>>>> |
<<<<<<<
this.busy(false);
=======
this.showFirstSteps = new ReactiveVar(false);
this.firstSteps = () => {
// make sure that first steps are only shown once per course
const parentInstance = this.parentInstance();
if (parentInstance.firstStepsShown) return;
this.showFirstSteps.set(true);
parentInstance.firstStepsShown = true;
};
>>>>>>>
this.busy(false);
this.showFirstSteps = new ReactiveVar(false);
this.firstSteps = () => {
// make sure that first steps are only shown once per course
const parentInstance = this.parentInstance();
if (parentInstance.firstStepsShown) return;
this.showFirstSteps.set(true);
parentInstance.firstStepsShown = true;
}; this.showFirstSteps = new ReactiveVar(false);
<<<<<<<
'click .js-role-subscribe-btn'(event, instance) {
event.preventDefault();
const comment = instance.$('.js-comment').val();
instance.busy('enrolling');
SaveAfterLogin(instance, mf('loginAction.enroll', 'Login and enroll'), () => {
Meteor.call('add_role', this.course._id, Meteor.userId(), this.roletype.type, (err) => {
if (err) {
console.error(err);
} else {
instance.busy(false);
instance.enrolling.set(false);
Meteor.call('change_comment', this.course._id, comment, err => {
instance.busy(false);
if (err) {
console.error(err);
} else {
instance.enrolling.set(false);
}
});
}
});
});
=======
'click .js-role-subscribe-btn': function (e, template) {
Meteor.call("add_role", this.course._id, Meteor.userId(), this.roletype.type, err => {
if (err) {
console.error(err);
} else {
template.firstSteps();
}
});
// Store the comment
var comment = template.$('.js-comment').val();
Meteor.call("change_comment", this.course._id, comment);
template.enrolling.set(false);
return false;
>>>>>>>
'click .js-role-subscribe-btn'(event, instance) {
event.preventDefault();
const comment = instance.$('.js-comment').val();
instance.busy('enrolling');
SaveAfterLogin(instance, mf('loginAction.enroll', 'Login and enroll'), () => {
Meteor.call('add_role', this.course._id, Meteor.userId(), this.roletype.type, (err) => {
if (err) {
console.error(err);
} else {
template.firstSteps();
instance.busy(false);
instance.enrolling.set(false);
Meteor.call('change_comment', this.course._id, comment, err => {
instance.busy(false);
if (err) {
console.error(err);
} else {
instance.enrolling.set(false);
}
});
}
});
}); |
<<<<<<<
import { ScssVars } from '/imports/ui/lib/Viewport.js';
import { PleaseLogin } from '/imports/ui/account/AccountTools.js';
import '/imports/ui/components/price-policy/price-policy.js';
=======
import '/imports/IdTools.js';
import { ScssVars } from '/imports/ui/lib/scss-vars.js';
import { PleaseLogin } from '/imports/ui/lib/please-login.js';
>>>>>>>
import '/imports/IdTools.js';
import { ScssVars } from '/imports/ui/lib/scss-vars.js';
import { PleaseLogin } from '/imports/ui/lib/please-login.js';
import '/imports/ui/components/price-policy/price-policy.js'; |
<<<<<<<
=======
add_role: function(courseId, userId, role, incognito) {
check(courseId, String);
check(userId, String);
check(role, String);
check(incognito, Boolean);
var user = Meteor.users.findOne(userId);
if (!user) throw new Meteor.Error(404, "User not found");
var operator = Meteor.user();
if (!operator) throw new Meteor.Error(401, "please log in");
var forThemself = operator._id === user._id;
if (!forThemself && incognito) {
throw new Meteor.Error(401, "not permitted");
}
var course = Courses.findOne({_id: courseId});
if (!course) throw new Meteor.Error(404, "Course not found");
if (course.roles.indexOf(role) == -1) throw new Meteor.Error(404, "No role "+role);
// Check permissions
if (!maySubscribe(operator._id, course, user._id, role)) {
throw new Meteor.Error(401, "not permitted");
}
// The subscriptionId is the user._id unless we're subscribing incognito
var subscriptionId = false;
if (incognito) {
// Re-use anonId if already used on another role
if (user.anonId) {
_.each(course.members, function(member){
if (user.anonId.indexOf(member.user) != -1) {
subscriptionId = member.user;
}
});
}
if (!subscriptionId) {
subscriptionId = Meteor.call('generateAnonId');
}
}
if (!subscriptionId){
subscriptionId = user._id;
}
addRole(course, role, subscriptionId);
var time = new Date;
Courses.update({_id: courseId}, { $set: {time_lastedit: time}}, checkUpdateOne);
},
>>>>>>> |
<<<<<<<
import { ScssVars } from '/imports/ui/lib/Viewport.js';
import { PleaseLogin } from '/imports/ui/account/AccountTools.js';
=======
import '/imports/IdTools.js';
>>>>>>>
import '/imports/IdTools.js';
import { ScssVars } from '/imports/ui/lib/Viewport.js';
import { PleaseLogin } from '/imports/ui/account/AccountTools.js'; |
<<<<<<<
import Regions from '/imports/api/regions/regions.js';
=======
import Courses from '/imports/api/courses/courses.js';
>>>>>>>
import Regions from '/imports/api/regions/regions.js';
import Courses from '/imports/api/courses/courses.js'; |
<<<<<<<
import { PleaseLogin } from '/imports/ui/account/AccountTools.js';
=======
import '/imports/Filtering.js';
import '/imports/Predicates.js';
import '/imports/StringTools.js';
import '/imports/HtmlTools.js';
>>>>>>>
import { PleaseLogin } from '/imports/ui/account/AccountTools.js';
import '/imports/Filtering.js';
import '/imports/Predicates.js';
import '/imports/StringTools.js';
import '/imports/HtmlTools.js'; |
<<<<<<<
for (var count = 0; count < items; count++) {
found = found + $('._m3b',body).eq(count).html() + ", ";
}
}
}
=======
//name list
if (!found && $('#_vBb',body).length>0){
found = $('#_vBb',body).html()
console.log("Found name list")
}
>>>>>>>
for (var count = 0; count < items; count++) {
found = found + $('._m3b',body).eq(count).html() + ", ";
}
}
//name list
if (!found && $('#_vBb',body).length>0){
found = $('#_vBb',body).html();
console.log("Found name list");
}
<<<<<<<
=======
console.log("Found Found instant and desc 2")
var tablehtml = $('._o0d',body).html()
found = tablehtml // fallback in case a table isn't found
xray(tablehtml, ['table@html'])(function (conversionError, tableHtmlList) {
if (conversionError) {
console.log("Xray conversionError");
}
if (tableHtmlList){
// xray returns the html inside each table tag, and tabletojson
// expects a valid html table, so we need to re-wrap the table.
var table1 = tabletojson.convert('<table>' + tableHtmlList[0]+ '</table>');
console.log(table1)
var csv = json2csv({data: table1, hasCSVColumnTitle: false })
csv = csv.replace(/(['"])/g, "") //get rid of double quotes
csv = csv.replace(/\,(.*?)\:/g, ", ") //get rid column names
csv = csv.replace(/\{(.*?)\:/g, ", ") //get rid column names
csv = csv.replace(/([}])/g, " ALEXAPAUSE ") //get rid of } and add a pause which will be replaced with SSML later
found = csv.toString();
}
});
>>>>>>>
console.log("Found Found instant and desc 2")
var tablehtml = $('._o0d',body).html()
found = tablehtml // fallback in case a table isn't found
xray(tablehtml, ['table@html'])(function (conversionError, tableHtmlList) {
if (conversionError) {
console.log("Xray conversionError");
}
if (tableHtmlList){
// xray returns the html inside each table tag, and tabletojson
// expects a valid html table, so we need to re-wrap the table.
var table1 = tabletojson.convert('<table>' + tableHtmlList[0]+ '</table>');
console.log(table1)
var csv = json2csv({data: table1, hasCSVColumnTitle: false })
csv = csv.replace(/(['"])/g, "") //get rid of double quotes
csv = csv.replace(/\,(.*?)\:/g, ", ") //get rid column names
csv = csv.replace(/\{(.*?)\:/g, ", ") //get rid column names
csv = csv.replace(/([}])/g, " ALEXAPAUSE ") //get rid of } and add a pause which will be replaced with SSML later
found = csv.toString();
}
});
<<<<<<<
speechOutputTemp = speechOutputTemp.split('.com').join(" dot com "); // deal with dot com
speechOutputTemp = speechOutputTemp.split('.co.uk').join(" dot co dot uk "); // deal with .co.uk
speechOutputTemp = speechOutputTemp.split('.net').join(" dot net "); // deal with .net
speechOutputTemp = speechOutputTemp.split('.org').join(" dot org "); // deal with .org
// deal with decimal places
var points = speechOutputTemp.match('([0-9]+\.[0-9]+)');
if ( points != null ) {
for (var count = 0; count < points.length ; count++) {
var replaceString = points[count].replace(".", " point ");
speechOutputTemp = speechOutputTemp.split(points[count]).join(replaceString);
}
}
speechOutputTemp = speechOutputTemp.split('ALEXAPAUSE').join(', '); // add in SSML pauses at table ends // disabled until SSML syntax can be checked
cardOutputText = cardOutputText.split('ALEXAPAUSE').join(''); // remove pauses from card text
var speechOutput = speechOutputTemp.split('.').join(". "); // deal with any remaining dots and turn them into full stops
if (speechOutput=="") speechOutput = "I'm sorry, I wasn't able to find an answer.";
response.tellWithCard(speechOutput, cardTitle, cardOutputText);
// response.tell(speechOutput)
}).catch(function(err) {
console.log("ERROR" + err);
speechOutput = "There was an error processing your search.";
response.tell(speechOutput);
});
},
"AMAZON.StopIntent": function(intent, session, response) {
var speechOutput = "";
response.tell(speechOutput);
}
=======
speechOutputTemp = speechOutputTemp.split('.com').join(" dot com ") // deal with dot com
speechOutputTemp = speechOutputTemp.split('.co.uk').join(" dot co dot uk ") // deal with .co.uk
speechOutputTemp = speechOutputTemp.split('.net').join(" dot net ") // deal with .net
speechOutputTemp = speechOutputTemp.split('.org').join(" dot org ") // deal with .org
// deal with decimal places
speechOutputTemp = speechOutputTemp.replace(/\d[\.]{1,}/g,'\$&DECIMALPOINT')// search for decimal points following a digit and add DECIMALPOINT TEXT
speechOutputTemp = speechOutputTemp.replace(/.DECIMALPOINT/g,'DECIMALPOINT')// remove decimal point
speechOutputTemp = speechOutputTemp.split('ALEXAPAUSE').join('<break time=\"500ms\"/>') // add in SSML pauses at table ends
cardOutputText = cardOutputText.split('ALEXAPAUSE').join('') // remove pauses from card text
speechOutputTemp = speechOutputTemp.split('.').join(". <break time=\"250ms\"/>") // Assume any remaining dot are concatonated sentances so turn them into full stops with a pause afterwards
var speechOutput = speechOutputTemp.replace(/DECIMALPOINT/g,'.') // Put back decimal points
if (speechOutput=="") speechOutput = "I'm sorry, I wasn't able to find an answer."
// Covert speechOutput into SSML so that pauses can be processed
var SSMLspeechOutput = {
speech: '<speak>' + speechOutput + '</speak>',
type: 'SSML'
};
response.tellWithCard(SSMLspeechOutput, cardTitle, cardOutputText)
// response.tell(speechOutput)
}).catch(function(err) {
console.log("ERROR" + err)
speechOutput = "There was an error processing your search."
response.tell(speechOutput)
})
},
"AMAZON.StopIntent": function(intent, session, response) {
var speechOutput = ""
response.tell(speechOutput)
}
>>>>>>>
speechOutputTemp = speechOutputTemp.split('.com').join(" dot com ") // deal with dot com
speechOutputTemp = speechOutputTemp.split('.co.uk').join(" dot co dot uk ") // deal with .co.uk
speechOutputTemp = speechOutputTemp.split('.net').join(" dot net ") // deal with .net
speechOutputTemp = speechOutputTemp.split('.org').join(" dot org ") // deal with .org
// deal with decimal places
speechOutputTemp = speechOutputTemp.replace(/\d[\.]{1,}/g,'\$&DECIMALPOINT')// search for decimal points following a digit and add DECIMALPOINT TEXT
speechOutputTemp = speechOutputTemp.replace(/.DECIMALPOINT/g,'DECIMALPOINT')// remove decimal point
speechOutputTemp = speechOutputTemp.split('ALEXAPAUSE').join('<break time=\"500ms\"/>') // add in SSML pauses at table ends
cardOutputText = cardOutputText.split('ALEXAPAUSE').join('') // remove pauses from card text
speechOutputTemp = speechOutputTemp.split('.').join(". <break time=\"250ms\"/>") // Assume any remaining dot are concatonated sentances so turn them into full stops with a pause afterwards
var speechOutput = speechOutputTemp.replace(/DECIMALPOINT/g,'.') // Put back decimal points
if (speechOutput=="") speechOutput = "I'm sorry, I wasn't able to find an answer."
// Covert speechOutput into SSML so that pauses can be processed
var SSMLspeechOutput = {
speech: '<speak>' + speechOutput + '</speak>',
type: 'SSML'
};
response.tellWithCard(SSMLspeechOutput, cardTitle, cardOutputText);
// response.tell(speechOutput)
}).catch(function(err) {
console.log("ERROR" + err);
speechOutput = "There was an error processing your search.";
response.tell(speechOutput);
})
},
"AMAZON.StopIntent": function(intent, session, response) {
var speechOutput = "";
response.tell(speechOutput);
} |
<<<<<<<
/*------------------------- Form_ Neue Kategorie erstellen ------------*/
/*
=======
/*------------------------- Form_ Neue Kategorie erstellen ------------
>>>>>>>
/*
<<<<<<<
*/
=======
*/
>>>>>>>
*/ |
<<<<<<<
import { PleaseLogin } from '/imports/ui/lib/please-login.js';
=======
import { PleaseLogin } from '/imports/ui/account/AccountTools.js';
import '/imports/StringTools.js';
>>>>>>>
import { PleaseLogin } from '/imports/ui/lib/please-login.js';
import '/imports/StringTools.js'; |
<<<<<<<
this.route('showCourse', { ///////// coursedetails /////////
path: 'course/:_id',
template: 'coursedetails',
waitOn: function () {
return [
Meteor.subscribe('courses')
]
},
data: function () {
return Courses.findOne({_id: this.params._id})
},
unload: function () {
Session.set("isEditing", false);
}
})
this.route('locationDetails',{ ///////// locationdetails /////////
path: 'locations/:_id',
template: 'locationdetails',
waitOn: function () {
return Meteor.subscribe('locations');
},
data: function () {
return Locations.findOne({_id: this.params._id})
}
})
this.route('locations',{ ///////// locationlist /////////
path: 'locations',
template: 'locationlist',
waitOn: function () {
return Meteor.subscribe('locations');
},
})
=======
>>>>>>>
this.route('locationDetails',{ ///////// locationdetails /////////
path: 'locations/:_id',
template: 'locationdetails',
waitOn: function () {
return Meteor.subscribe('locations');
},
data: function () {
return Locations.findOne({_id: this.params._id})
}
})
this.route('locations',{ ///////// locationlist /////////
path: 'locations',
template: 'locationlist',
waitOn: function () {
return Meteor.subscribe('locations');
},
}) |
<<<<<<<
description: instance.$('#eventEditDescription').html(),
venue: instance.selectedLocation.get(),
=======
location: instance.selectedLocation.get(),
>>>>>>>
venue: instance.selectedLocation.get(), |
<<<<<<<
date: '2017-09-24',
// eslint-disable-next-line
migrate: async function() {
await r.knex.schema.alterTable('job_request', (table) => {
table.string('result_message').nullable().default('')
})
await r.knex.schema.alterTable('opt_out', (table) => {
table.string('reason_code').nullable().default('')
})
}
},
{ auto: true, //4
date: '2017-09-22',
migrate: async function migrate() {
await r.knex.schema.alterTable('campaign', (table) => {
table.boolean('use_dynamic_assignment').notNullable().default(false);
})
await r.knex.schema.alterTable('assignment', (table) => {
table.integer('max_contacts');
})
console.log('added dynamic_assigment column to campaign table and max_contacts to assignments')
}
},
{ auto: true, //5
date: '2017-09-25',
migrate: async function migrate() {
await r.knex.schema.alterTable('campaign_contact', (table) => {
table.timestamp('updated_at').default('now()');
})
console.log('added updated_at column to campaign_contact')
}
},
{ auto: true, //6
date: '2017-10-03',
migrate: async function migrate() {
await r.knex.schema.alterTable('interaction_step', (table) => {
table.timestamp('is_deleted').notNullable().default(false);
})
console.log('added is_deleted column to interaction_step')
}
},
{ auto: true, //7
date: '2017-10-04',
migrate: async function migrate() {
await r.knex.schema.alterTable('campaign', (table) => {
table.text('intro_html');
table.text('logo_image_url');
table.string('primary_color');
})
console.log('added is_deleted column to interaction_step')
}
},
{ auto: true, //8
date: '2017-09-28',
migrate: async function migrate() {
await r.knex.schema.alterTable('user', (table) => {
table.boolean('terms').default(false);
})
console.log('added terms column to user')
}
},
{ auto: true, //9
date: '2017-10-23',
migrate: async function migrate() {
await r.knex.schema.alterTable('message', (table) => {
table.timestamp('queued_at');
table.timestamp('sent_at');
table.timestamp('service_response_at');
})
console.log('added action timestamp columns to message')
}
},
{ auto: true, //10
date: '2017-10-23',
migrate: async function migrate() {
await r.knex.schema.createTable('log', (table) => {
table.string('message_sid');
table.json('body');
table.timestamp('created_at').default('now()');
})
console.log('added log table')
}
=======
date: '2017-09-24',
// eslint-disable-next-line
migrate: async function() {
await r.knex.schema.alterTable('job_request', (table) => {
table.string('result_message').nullable().default('')
})
await r.knex.schema.alterTable('opt_out', (table) => {
table.string('reason_code').nullable().default('')
})
}
},
{ auto: true, //4
date: '2017-10-23',
migrate: async function migrate() {
await r.knex.schema.alterTable('message', (table) => {
table.timestamp('queued_at');
table.timestamp('sent_at');
table.timestamp('service_response_at');
})
console.log('added action timestamp columns to message')
}
},
{ auto: true, //5
date: '2017-10-23',
migrate: async function migrate() {
await r.knex.schema.createTableIfNotExists('log', (table) => {
table.string('message_sid');
table.json('body');
table.timestamp('created_at').default('now()');
})
console.log('added log table')
}
>>>>>>>
date: '2017-09-24',
// eslint-disable-next-line
migrate: async function() {
await r.knex.schema.alterTable('job_request', (table) => {
table.string('result_message').nullable().default('')
})
await r.knex.schema.alterTable('opt_out', (table) => {
table.string('reason_code').nullable().default('')
})
}
},
{ auto: true, //4
date: '2017-09-22',
migrate: async function migrate() {
await r.knex.schema.alterTable('campaign', (table) => {
table.boolean('use_dynamic_assignment').notNullable().default(false);
})
await r.knex.schema.alterTable('assignment', (table) => {
table.integer('max_contacts');
})
console.log('added dynamic_assigment column to campaign table and max_contacts to assignments')
}
},
{ auto: true, //5
date: '2017-09-25',
migrate: async function migrate() {
await r.knex.schema.alterTable('campaign_contact', (table) => {
table.timestamp('updated_at').default('now()');
})
console.log('added updated_at column to campaign_contact')
}
},
{ auto: true, //6
date: '2017-10-03',
migrate: async function migrate() {
await r.knex.schema.alterTable('interaction_step', (table) => {
table.timestamp('is_deleted').notNullable().default(false);
})
console.log('added is_deleted column to interaction_step')
}
},
{ auto: true, //7
date: '2017-10-04',
migrate: async function migrate() {
await r.knex.schema.alterTable('campaign', (table) => {
table.text('intro_html');
table.text('logo_image_url');
table.string('primary_color');
})
console.log('added is_deleted column to interaction_step')
}
},
{ auto: true, //8
date: '2017-09-28',
migrate: async function migrate() {
await r.knex.schema.alterTable('user', (table) => {
table.boolean('terms').default(false);
})
console.log('added terms column to user')
}
},
{ auto: true, //9
date: '2017-10-23',
migrate: async function migrate() {
await r.knex.schema.alterTable('message', (table) => {
table.timestamp('queued_at');
table.timestamp('sent_at');
table.timestamp('service_response_at');
})
console.log('added action timestamp columns to message')
}
},
{ auto: true, //10
date: '2017-10-23',
migrate: async function migrate() {
await r.knex.schema.createTableIfNotExists('log', (table) => {
table.string('message_sid');
table.json('body');
table.timestamp('created_at').default('now()');
})
console.log('added log table')
} |
<<<<<<<
browser.cookies.getAll({ url: this.currentTab.url }).then(callback, function (e) {
console.error('Failed to retrieve cookies', e);
});
=======
browser.cookies.getAll({
url: this.currentTab.url,
storeId: this.currentTab.cookieStoreId
}).then(callback);
>>>>>>>
browser.cookies.getAll({
url: this.currentTab.url,
storeId: this.currentTab.cookieStoreId
}).then(callback, function (e) {
console.error('Failed to retrieve cookies', e);
});
<<<<<<<
browser.cookies.remove({name: name, url: url}).then(callback, function (e) {
console.error('Failed to remove cookies', e);
});
=======
browser.cookies.remove({
name: name,
url: url,
storeId: this.currentTab.cookieStoreId
}).then(callback);
>>>>>>>
browser.cookies.remove({
name: name,
url: url,
storeId: this.currentTab.cookieStoreId
}).then(callback, function (e) {
console.error('Failed to remove cookies', e);
}); |
<<<<<<<
=======
var paused = startPaused || false;
var readable = false;
// convert to an old-style stream.
stream.readable = true;
stream.pipe = Stream.prototype.pipe;
stream.on = stream.addListener = Stream.prototype.on;
stream.on('readable', function() {
readable = true;
var c;
while (!paused && (null !== (c = stream.read())))
stream.emit('data', c);
if (c === null) {
readable = false;
stream._readableState.needReadable = true;
}
});
stream.pause = function() {
paused = true;
this.emit('pause');
};
stream.resume = function() {
paused = false;
if (readable)
process.nextTick(function() {
stream.emit('readable');
});
else
this.read(0);
this.emit('resume');
};
// Start reading in next tick to allow caller to set event listeners on
// the stream object (like 'error')
process.nextTick(function() {
// now make it start, just in case it hadn't already.
stream.emit('readable');
});
// Let others know about our mode
state.oldMode = true;
>>>>>>> |
<<<<<<<
var index = stack.lastIndexOf(this);
if (index !== -1)
stack.splice(index);
else
stack.length = 0;
_domain_flag[0] = stack.length;
=======
stack.splice(index);
>>>>>>>
stack.splice(index);
_domain_flag[0] = stack.length; |
<<<<<<<
assert.equal(0x6f, z[1]);
assert.equal(0, Buffer('hello').slice(0, 0).length)
b = new Buffer(50);
b.fill("h");
for (var i = 0; i < b.length; i++) {
assert.equal("h".charCodeAt(0), b[i]);
}
b.fill(0);
for (var i = 0; i < b.length; i++) {
assert.equal(0, b[i]);
}
b.fill(1, 16, 32);
for (var i = 0; i < 16; i++) assert.equal(0, b[i]);
for (; i < 32; i++) assert.equal(1, b[i]);
for (; i < b.length; i++) assert.equal(0, b[i]);
=======
assert.equal(0x6f, z[1]);
var b = new SlowBuffer(10);
b.write('γγγγγ', 'ucs2');
assert.equal(b.toString('ucs2'), 'γγγγγ');
>>>>>>>
assert.equal(0x6f, z[1]);
assert.equal(0, Buffer('hello').slice(0, 0).length)
b = new Buffer(50);
b.fill("h");
for (var i = 0; i < b.length; i++) {
assert.equal("h".charCodeAt(0), b[i]);
}
b.fill(0);
for (var i = 0; i < b.length; i++) {
assert.equal(0, b[i]);
}
b.fill(1, 16, 32);
for (var i = 0; i < 16; i++) assert.equal(0, b[i]);
for (; i < 32; i++) assert.equal(1, b[i]);
for (; i < b.length; i++) assert.equal(0, b[i]);
var b = new SlowBuffer(10);
b.write('γγγγγ', 'ucs2');
assert.equal(b.toString('ucs2'), 'γγγγγ'); |
<<<<<<<
assert.ok(util.inspect(x).indexOf('inspect') != -1);
// util.inspect.styles and util.inspect.colors
function test_color_style(style, input, implicit) {
var color_name = util.inspect.styles[style];
var color = ['', ''];
if(util.inspect.colors[color_name])
color = util.inspect.colors[color_name];
var without_color = util.inspect(input, false, 0, false);
var with_color = util.inspect(input, false, 0, true);
var expect = '\u001b[' + color[0] + 'm' + without_color +
'\u001b[' + color[1] + 'm';
assert.equal(with_color, expect, 'util.inspect color for style '+style);
}
test_color_style('special', function(){});
test_color_style('number', 123.456);
test_color_style('boolean', true);
test_color_style('undefined', undefined);
test_color_style('null', null);
test_color_style('string', 'test string');
test_color_style('date', new Date);
test_color_style('regexp', /regexp/);
=======
assert.ok(util.inspect(x).indexOf('inspect') != -1);
// an object with "hasOwnProperty" overwritten should not throw
assert.doesNotThrow(function() {
util.inspect({
hasOwnProperty: null
});
});
>>>>>>>
assert.ok(util.inspect(x).indexOf('inspect') != -1);
// util.inspect.styles and util.inspect.colors
function test_color_style(style, input, implicit) {
var color_name = util.inspect.styles[style];
var color = ['', ''];
if(util.inspect.colors[color_name])
color = util.inspect.colors[color_name];
var without_color = util.inspect(input, false, 0, false);
var with_color = util.inspect(input, false, 0, true);
var expect = '\u001b[' + color[0] + 'm' + without_color +
'\u001b[' + color[1] + 'm';
assert.equal(with_color, expect, 'util.inspect color for style '+style);
}
test_color_style('special', function(){});
test_color_style('number', 123.456);
test_color_style('boolean', true);
test_color_style('undefined', undefined);
test_color_style('null', null);
test_color_style('string', 'test string');
test_color_style('date', new Date);
test_color_style('regexp', /regexp/);
// an object with "hasOwnProperty" overwritten should not throw
assert.doesNotThrow(function() {
util.inspect({
hasOwnProperty: null
});
}); |
<<<<<<<
if (startup.lazyConstants()[sig]) {
err = process._kill(pid, startup.lazyConstants()[sig]);
=======
if (startup.lazyConstants()[sig] &&
sig.slice(0, 3) === 'SIG') {
r = process._kill(pid, startup.lazyConstants()[sig]);
>>>>>>>
if (startup.lazyConstants()[sig] &&
sig.slice(0, 3) === 'SIG') {
err = process._kill(pid, startup.lazyConstants()[sig]); |
<<<<<<<
EventEmitter.prototype.setMaxListeners = function(n) {
if (!util.isNumber(n) || n < 0 || isNaN(n))
=======
var defaultMaxListeners = 10;
EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {
if (typeof n !== 'number' || n < 0 || isNaN(n))
>>>>>>>
EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {
if (!util.isNumber(n) || n < 0 || isNaN(n))
<<<<<<<
EventEmitter.prototype.once = function(type, listener) {
if (!util.isFunction(listener))
=======
EventEmitter.prototype.once = function once(type, listener) {
if (typeof listener !== 'function')
>>>>>>>
EventEmitter.prototype.once = function once(type, listener) {
if (!util.isFunction(listener)) |
<<<<<<<
return (this[offset] * 0x1000000) +
((this[offset + 1] << 16) |
(this[offset + 2] << 8) |
(this[offset + 3]) >>> 0);
};
=======
return (this[offset] * 0x1000000) +
((this[offset + 1] << 16) |
(this[offset + 2] << 8) |
this[offset + 3]);
};
>>>>>>>
return (this[offset] * 0x1000000) +
((this[offset + 1] << 16) |
(this[offset + 2] << 8) |
this[offset + 3]);
};
<<<<<<<
=======
return (this[offset] << 24) |
(this[offset + 1] << 16) |
(this[offset + 2] << 8) |
(this[offset + 3]);
};
Buffer.prototype.readFloatLE = function(offset, noAssert) {
if (!noAssert)
checkOffset(offset, 4, this.length);
return this.parent.readFloatLE(this.offset + offset, !!noAssert);
};
>>>>>>>
<<<<<<<
this[offset] = value;
this[offset + 1] = (value >>> 8);
return offset + 2;
=======
this[offset] = value;
this[offset + 1] = (value >>> 8);
>>>>>>>
this[offset] = value;
this[offset + 1] = (value >>> 8);
return offset + 2;
<<<<<<<
this[offset] = (value >>> 8);
this[offset + 1] = value;
return offset + 2;
=======
this[offset] = (value >>> 8);
this[offset + 1] = value;
>>>>>>>
this[offset] = (value >>> 8);
this[offset + 1] = value;
return offset + 2;
<<<<<<<
this[offset + 3] = (value >>> 24);
this[offset + 2] = (value >>> 16);
this[offset + 1] = (value >>> 8);
this[offset] = value;
return offset + 4;
=======
this[offset + 3] = (value >>> 24);
this[offset + 2] = (value >>> 16);
this[offset + 1] = (value >>> 8);
this[offset] = value;
>>>>>>>
this[offset + 3] = (value >>> 24);
this[offset + 2] = (value >>> 16);
this[offset + 1] = (value >>> 8);
this[offset] = value;
return offset + 4;
<<<<<<<
this[offset] = (value >>> 24);
this[offset + 1] = (value >>> 16);
this[offset + 2] = (value >>> 8);
this[offset + 3] = value;
return offset + 4;
=======
this[offset] = (value >>> 24);
this[offset + 1] = (value >>> 16);
this[offset + 2] = (value >>> 8);
this[offset + 3] = value;
>>>>>>>
this[offset] = (value >>> 24);
this[offset + 1] = (value >>> 16);
this[offset + 2] = (value >>> 8);
this[offset + 3] = value;
return offset + 4;
<<<<<<<
this[offset] = value;
this[offset + 1] = (value >>> 8);
return offset + 2;
=======
this[offset] = value;
this[offset + 1] = (value >>> 8);
>>>>>>>
this[offset] = value;
this[offset + 1] = (value >>> 8);
return offset + 2;
<<<<<<<
this[offset] = (value >>> 8);
this[offset + 1] = value;
return offset + 2;
=======
this[offset] = (value >>> 8);
this[offset + 1] = value;
>>>>>>>
this[offset] = (value >>> 8);
this[offset + 1] = value;
return offset + 2;
<<<<<<<
this[offset] = value;
this[offset + 1] = (value >>> 8);
this[offset + 2] = (value >>> 16);
this[offset + 3] = (value >>> 24);
return offset + 4;
=======
this[offset] = value;
this[offset + 1] = (value >>> 8);
this[offset + 2] = (value >>> 16);
this[offset + 3] = (value >>> 24);
>>>>>>>
this[offset] = value;
this[offset + 1] = (value >>> 8);
this[offset + 2] = (value >>> 16);
this[offset + 3] = (value >>> 24);
return offset + 4;
<<<<<<<
this[offset] = (value >>> 24);
this[offset + 1] = (value >>> 16);
this[offset + 2] = (value >>> 8);
this[offset + 3] = value;
return offset + 4;
=======
this[offset] = (value >>> 24);
this[offset + 1] = (value >>> 16);
this[offset + 2] = (value >>> 8);
this[offset + 3] = value;
};
Buffer.prototype.writeFloatLE = function(value, offset, noAssert) {
if (!noAssert)
checkOffset(offset, 4, this.length);
this.parent.writeFloatLE(value, this.offset + offset, !!noAssert);
};
Buffer.prototype.writeFloatBE = function(value, offset, noAssert) {
if (!noAssert)
checkOffset(offset, 4, this.length);
this.parent.writeFloatBE(value, this.offset + offset, !!noAssert);
};
Buffer.prototype.writeDoubleLE = function(value, offset, noAssert) {
if (!noAssert)
checkOffset(offset, 8, this.length);
this.parent.writeDoubleLE(value, this.offset + offset, !!noAssert);
};
Buffer.prototype.writeDoubleBE = function(value, offset, noAssert) {
if (!noAssert)
checkOffset(offset, 8, this.length);
this.parent.writeDoubleBE(value, this.offset + offset, !!noAssert);
>>>>>>>
this[offset] = (value >>> 24);
this[offset + 1] = (value >>> 16);
this[offset + 2] = (value >>> 8);
this[offset + 3] = value;
return offset + 4; |
<<<<<<<
(util.isFunction(list.listener) && list.listener === listener)) {
this._events[type] = undefined;
=======
(typeof list.listener === 'function' && list.listener === listener)) {
delete this._events[type];
>>>>>>>
(util.isFunction(list.listener) && list.listener === listener)) {
delete this._events[type]; |
<<<<<<<
if (!util.isBuffer(chunk) &&
!util.isString(chunk) &&
!util.isNullOrUndefined(chunk) &&
!state.objectMode &&
!er) {
=======
if (!Buffer.isBuffer(chunk) &&
'string' !== typeof chunk &&
chunk !== null &&
chunk !== undefined &&
!state.objectMode) {
>>>>>>>
if (!util.isBuffer(chunk) &&
!util.isString(chunk) &&
!util.isNullOrUndefined(chunk) &&
!state.objectMode) { |
<<<<<<<
editors: String
=======
overrideOrganizationTextingHours: Boolean
textingHoursEnforced: Boolean
textingHoursStart: Int
textingHoursEnd: Int
timezone: String
>>>>>>>
editors: String
overrideOrganizationTextingHours: Boolean
textingHoursEnforced: Boolean
textingHoursStart: Int
textingHoursEnd: Int
timezone: String |
<<<<<<<
});
test('transpose matrix - (3, 2) to (2, 3)', () => {
let m = new Matrix(3, 2);
m.data[0] = [1, 2]
m.data[1] = [3, 4]
m.data[2] = [5, 6]
let mt = Matrix.transpose(m);
expect(mt).toEqual({
rows: 2,
cols: 3,
data: [
[1, 3, 5],
[2, 4, 6]
]
})
})
test('transpose matrix - (1, 5) to (5, 1)', () => {
let m = new Matrix(1, 5);
m.data[0] = [1, 2, 3, 4, 5]
let mt = Matrix.transpose(m);
expect(mt).toEqual({
rows: 5,
cols: 1,
data: [
[1],
[2],
[3],
[4],
[5]
]
})
})
test('transpose matrix - (5, 1) to (1, 5)', () => {
let m = new Matrix(5, 1);
m.data[0] = [1];
m.data[1] = [2];
m.data[2] = [3];
m.data[3] = [4];
m.data[4] = [5];
let mt = Matrix.transpose(m)
expect(mt).toEqual({
rows: 1,
cols: 5,
data: [
[1, 2, 3, 4, 5]
]
})
})
=======
});
test('mapping with static map', () => {
let m = new Matrix(3, 3);
m.data[0] = [1, 2, 3];
m.data[1] = [4, 5, 6];
m.data[2] = [7, 8, 9];
let mapped = Matrix.map(m, elem => elem * 10);
expect(mapped).toEqual({
rows: 3,
cols: 3,
data: [
[10, 20, 30],
[40, 50, 60],
[70, 80, 90]
]
});
});
test('mapping with instance map', () => {
let m = new Matrix(3, 3);
m.data[0] = [1, 2, 3];
m.data[1] = [4, 5, 6];
m.data[2] = [7, 8, 9];
m.map(elem => elem * 10);
expect(m).toEqual({
rows: 3,
cols: 3,
data: [
[10, 20, 30],
[40, 50, 60],
[70, 80, 90]
]
});
});
test('error handling of matrix product when columns of A don\'t match rows of B.', () => {
//Replace console.log with a jest mock so we can see if it has been called
global.console.log = jest.fn();
let m1 = new Matrix(1, 2);
let m2 = new Matrix(3, 4);
Matrix.multiply(m1, m2);
//Check if the mock console.log has been called
expect(global.console.log).toHaveBeenCalledWith('Columns of A must match rows of B.')
});
test('printing', () => {
//Replace console.table with a jest mock so we can see if it has been called
global.console.table = jest.fn();
let m1 = new Matrix(2, 3);
m1.randomize();
m1.print();
//Check if the mock console.table has been called
expect(global.console.table).toHaveBeenCalledWith(m1.data)
});
test('matrix from array', () => {
let array = [1, 2, 3];
let m = Matrix.fromArray(array);
expect(m).toEqual({
rows: 3,
cols: 1,
data: [
[1],
[2],
[3]
]
});
});
test('matrix to array', () => {
let m = new Matrix(3, 3);
m.data[0] = [1, 2, 3];
m.data[1] = [4, 5, 6];
m.data[2] = [7, 8, 9];
let array = m.toArray();
expect(array).toEqual([1, 2, 3, 4, 5, 6, 7, 8, 9]);
});
test('chanining matrix methods', () => {
let m = new Matrix(3, 3);
m.data[0] = [1, 2, 3];
m.data[1] = [4, 5, 6];
m.data[2] = [7, 8, 9];
m.map(e => e - 1).multiply(10).add(6).print();
expect(m).toEqual({
rows: 3,
cols: 3,
data: [
[6, 16, 26],
[36, 46, 56],
[66, 76, 86]
]
});
});
>>>>>>>
});
test('transpose matrix - (3, 2) to (2, 3)', () => {
let m = new Matrix(3, 2);
m.data[0] = [1, 2]
m.data[1] = [3, 4]
m.data[2] = [5, 6]
let mt = Matrix.transpose(m);
expect(mt).toEqual({
rows: 2,
cols: 3,
data: [
[1, 3, 5],
[2, 4, 6]
]
})
})
test('transpose matrix - (1, 5) to (5, 1)', () => {
let m = new Matrix(1, 5);
m.data[0] = [1, 2, 3, 4, 5]
let mt = Matrix.transpose(m);
expect(mt).toEqual({
rows: 5,
cols: 1,
data: [
[1],
[2],
[3],
[4],
[5]
]
})
})
test('transpose matrix - (5, 1) to (1, 5)', () => {
let m = new Matrix(5, 1);
m.data[0] = [1];
m.data[1] = [2];
m.data[2] = [3];
m.data[3] = [4];
m.data[4] = [5];
let mt = Matrix.transpose(m)
expect(mt).toEqual({
rows: 1,
cols: 5,
data: [
[1, 2, 3, 4, 5]
]
})
})
test('mapping with static map', () => {
let m = new Matrix(3, 3);
m.data[0] = [1, 2, 3];
m.data[1] = [4, 5, 6];
m.data[2] = [7, 8, 9];
let mapped = Matrix.map(m, elem => elem * 10);
expect(mapped).toEqual({
rows: 3,
cols: 3,
data: [
[10, 20, 30],
[40, 50, 60],
[70, 80, 90]
]
});
});
test('mapping with instance map', () => {
let m = new Matrix(3, 3);
m.data[0] = [1, 2, 3];
m.data[1] = [4, 5, 6];
m.data[2] = [7, 8, 9];
m.map(elem => elem * 10);
expect(m).toEqual({
rows: 3,
cols: 3,
data: [
[10, 20, 30],
[40, 50, 60],
[70, 80, 90]
]
});
});
test('error handling of matrix product when columns of A don\'t match rows of B.', () => {
//Replace console.log with a jest mock so we can see if it has been called
global.console.log = jest.fn();
let m1 = new Matrix(1, 2);
let m2 = new Matrix(3, 4);
Matrix.multiply(m1, m2);
//Check if the mock console.log has been called
expect(global.console.log).toHaveBeenCalledWith('Columns of A must match rows of B.')
});
test('printing', () => {
//Replace console.table with a jest mock so we can see if it has been called
global.console.table = jest.fn();
let m1 = new Matrix(2, 3);
m1.randomize();
m1.print();
//Check if the mock console.table has been called
expect(global.console.table).toHaveBeenCalledWith(m1.data)
});
test('matrix from array', () => {
let array = [1, 2, 3];
let m = Matrix.fromArray(array);
expect(m).toEqual({
rows: 3,
cols: 1,
data: [
[1],
[2],
[3]
]
});
});
test('matrix to array', () => {
let m = new Matrix(3, 3);
m.data[0] = [1, 2, 3];
m.data[1] = [4, 5, 6];
m.data[2] = [7, 8, 9];
let array = m.toArray();
expect(array).toEqual([1, 2, 3, 4, 5, 6, 7, 8, 9]);
});
test('chanining matrix methods', () => {
let m = new Matrix(3, 3);
m.data[0] = [1, 2, 3];
m.data[1] = [4, 5, 6];
m.data[2] = [7, 8, 9];
m.map(e => e - 1).multiply(10).add(6).print();
expect(m).toEqual({
rows: 3,
cols: 3,
data: [
[6, 16, 26],
[36, 46, 56],
[66, 76, 86]
]
});
}); |
<<<<<<<
if (res.hasOwnProperty("current_observation")) {
var cur = res.current_observation;
var loc = cur.display_location;
msg.data = res;
msg.payload.weather = cur.weather;
msg.payload.tempk = Number(cur.temp_c) + 273.2;
msg.payload.humidity = cur.relative_humidity;
msg.payload.tempc = cur.temp_c;
msg.payload.windspeed = cur.wind_kph;
msg.payload.winddirection = cur.wind_degrees;
msg.payload.location = cur.observation_location.full;
msg.location.lon = Number(loc.longitude);
msg.location.lat = Number(loc.latitude);
msg.location.city = loc.city;
msg.location.country = loc.country;
msg.time = new Date(Number(cur.observation_epoch*1000));
msg.title = "Data supplied by The Weather Underground.";
msg.description = "Current weather information at coordinates: " + msg.location.lat + ", " + msg.location.lon;
msg.payload.description = ("The weather in " + msg.location.city + " at coordinates: " + msg.location.lat + ", " + msg.location.lon + " is " + cur.weather);
var fcast = res.forecast.txt_forecast.forecastday[0];
msg.payload.forecast = loc.city+" : "+fcast.title+" : "+ fcast.fcttext_metric;
callback(null);
}
else {
callback("Can't find city: "+node.city+", "+node.country+".");
}
=======
var cur = res.current_observation;
var loc = cur.display_location;
msg.data = res;
msg.payload.weather = cur.weather;
msg.payload.tempk = Number(cur.temp_c) + 273.2;
msg.payload.humidity = cur.relative_humidity;
msg.payload.tempc = cur.temp_c;
msg.payload.windspeed = cur.wind_kph;
msg.payload.winddirection = cur.wind_degrees;
msg.payload.location = cur.observation_location.full;
msg.location.lon = Number(loc.longitude);
msg.location.lat = Number(loc.latitude);
msg.location.city = loc.city;
msg.location.country = loc.country;
msg.time = new Date(Number(cur.observation_epoch*1000));
msg.title = RED._("wunder.message.title");
msg.description = RED._("wunder.message.description", {lat: msg.location.lat, lon: msg.location.lon});
msg.payload.description = (RED._("wunder.message.payload", {city: msg.location.city, lat: msg.location.lat, lon: msg.location.lon, weather: cur.weather}));
var fcast = res.forecast.txt_forecast.forecastday[0];
msg.payload.forecast = loc.city+" : "+fcast.title+" : "+ fcast.fcttext_metric;
callback(null);
>>>>>>>
if (res.hasOwnProperty("current_observation")) {
var cur = res.current_observation;
var loc = cur.display_location;
msg.data = res;
msg.payload.weather = cur.weather;
msg.payload.tempk = Number(cur.temp_c) + 273.2;
msg.payload.humidity = cur.relative_humidity;
msg.payload.tempc = cur.temp_c;
msg.payload.windspeed = cur.wind_kph;
msg.payload.winddirection = cur.wind_degrees;
msg.payload.location = cur.observation_location.full;
msg.location.lon = Number(loc.longitude);
msg.location.lat = Number(loc.latitude);
msg.location.city = loc.city;
msg.location.country = loc.country;
msg.time = new Date(Number(cur.observation_epoch*1000));
msg.title = RED._("wunder.message.title");
msg.description = RED._("wunder.message.description", {lat: msg.location.lat, lon: msg.location.lon});
msg.payload.description = (RED._("wunder.message.payload", {city: msg.location.city, lat: msg.location.lat, lon: msg.location.lon, weather: cur.weather}));
var fcast = res.forecast.txt_forecast.forecastday[0];
msg.payload.forecast = loc.city+" : "+fcast.title+" : "+ fcast.fcttext_metric;
callback(null);
else {
callback("Can't find city: "+node.city+", "+node.country+".");
} |
<<<<<<<
componentWillMount = () => {
var initial = Orientation.getInitialOrientation();
if (initial === 'PORTRAIT') {
this.setState({ width: Dimensions.get('window').width});
} else {
this.setState({ width: Dimensions.get('window').width, landscape: true });
}
}
componentDidMount = () => {
Orientation.addOrientationListener(this.orientationDidChange);
}
orientationDidChange = (orientation) => {
if (orientation === 'PORTRAIT') {
this.setState({ width: Dimensions.get('window').width});
} else {
this.setState({ width: Dimensions.get('window').width, landscape: true });
}
}
show() {
=======
show = () => {
>>>>>>>
componentWillMount = () => {
var initial = Orientation.getInitialOrientation();
if (initial === 'PORTRAIT') {
this.setState({ width: Dimensions.get('window').width});
} else {
this.setState({ width: Dimensions.get('window').width, landscape: true });
}
}
componentDidMount = () => {
Orientation.addOrientationListener(this.orientationDidChange);
}
orientationDidChange = (orientation) => {
if (orientation === 'PORTRAIT') {
this.setState({ width: Dimensions.get('window').width});
} else {
this.setState({ width: Dimensions.get('window').width, landscape: true });
}
}
show = () => {
<<<<<<<
render() {
const { placeholder, heightAdjust, backgroundColor, iconColor, textColor, placeholderTextColor, onBack, hideBack, hideX, iOSPadding } = this.props;
const { width, landscape } = this.state;
=======
render = () => {
const {
placeholder,
heightAdjust,
backgroundColor,
iconColor,
textColor,
placeholderTextColor,
onBack,
hideBack,
hideX,
iOSPadding,
onSubmitEditing,
onFocus,
focusOnLayout,
autoCorrect,
autoCapitalize,
fontFamily,
backButton,
backButtonAccessibilityLabel,
closeButton,
closeButtonAccessibilityLabel,
backCloseSize
} = this.props;
>>>>>>>
render = () => {
const {
placeholder,
heightAdjust,
backgroundColor,
iconColor,
textColor,
placeholderTextColor,
onBack,
hideBack,
hideX,
iOSPadding,
onSubmitEditing,
onFocus,
focusOnLayout,
autoCorrect,
autoCapitalize,
fontFamily,
backButton,
backButtonAccessibilityLabel,
closeButton,
closeButtonAccessibilityLabel,
backCloseSize
} = this.props;
const { width, landscape } = this.state;
<<<<<<<
this.state.show &&
<View style={{ backgroundColor, width }} >
{ Platform.OS === 'ios' && iOSPadding && <View style={{ height: 20 }} /> }
<View style={[
styles.nav,
{ height: (Platform.OS === 'ios' ? 52 : 62) + heightAdjust },
]}
>
=======
this.state.show &&
<View style={[styles.navWrapper, { backgroundColor }]} >
{
Platform.OS === 'ios' && iOSPadding &&
<View style={{ height: 20 }} />
}
<View style={[
styles.nav,
{ height: (Platform.OS === 'ios' ? 52 : 62) + heightAdjust },
]}
>
{
!hideBack &&
<TouchableOpacity
accessible={true}
accessibilityComponentType="button"
accessibilityLabel={backButtonAccessibilityLabel}
onPress={onBack || this.hide}>
>>>>>>>
this.state.show &&
<View style={{ backgroundColor, width }} >
{
Platform.OS === 'ios' && iOSPadding &&
<View style={{ height: 20 }} />
}
<View style={[
styles.nav,
{ height: (Platform.OS === 'ios' ? 52 : 62) + heightAdjust },
]}
>
{
!hideBack &&
<TouchableOpacity
accessible={true}
accessibilityComponentType="button"
accessibilityLabel={backButtonAccessibilityLabel}
onPress={onBack || this.hide}> |
<<<<<<<
params: "",
parents: [],
path: "",
pname: "",
query: "",
refs: [],
=======
params: "",
parent: undefined,
path: "",
pname: "",
policyviolations: [],
query: "",
refs: [],
>>>>>>>
params: "",
parents: [],
path: "",
pname: "",
policyviolations: [],
query: "",
refs: [],
<<<<<<<
// convert refs to an array of strings
var refs = [];
vm.data.refs.forEach(function(ref) {
refs.push(ref.value);
});
vm.data.refs = refs;
=======
var policyviolations = [];
vm.data.policyviolations.forEach(function(violation) {
policyviolations.push(violation.value);
});
vm.data.policyviolations = policyviolations;
// delete selection
delete vm.data.parent.selected_modalNewCtrl;
>>>>>>>
// convert refs to an array of strings
var refs = [];
vm.data.refs.forEach(function(ref) {
refs.push(ref.value);
});
vm.data.refs = refs;
var policyviolations = [];
vm.data.policyviolations.forEach(function(violation) {
policyviolations.push(violation.value);
});
vm.data.policyviolations = policyviolations;
// delete selection
delete vm.data.parent.selected_modalNewCtrl; |
<<<<<<<
.controller('modalEditCtrl', ['$modalInstance', 'EASEOFRESOLUTION', 'STATUSES', 'commonsFact', 'severities', 'vuln', 'vulnModelsManager', 'vulnsManager',
function($modalInstance, EASEOFRESOLUTION, STATUSES, commonsFact, severities, vuln, vulnModelsManager, vulnsManager) {
=======
.controller('modalEditCtrl',
['$modalInstance', '$routeParams','EASEOFRESOLUTION', 'STATUSES', 'commonsFact',
'BASEURL', 'severities', 'vuln', 'cweFact', 'referenceFact',
'encodeURIComponentFilter',
function($modalInstance, $routeParams,EASEOFRESOLUTION, STATUSES, commons,
BASEURL, severities, vuln, cweFact, referenceFact,
encodeURIComponent) {
>>>>>>>
.controller('modalEditCtrl',
['$modalInstance', '$routeParams','EASEOFRESOLUTION', 'STATUSES', 'commonsFact',
'BASEURL', 'severities', 'vuln', 'cweFact', 'referenceFact',
'encodeURIComponentFilter',
function($modalInstance, $routeParams,EASEOFRESOLUTION, STATUSES, commonsFact,
BASEURL, severities, vuln, cweFact, referenceFact,
encodeURIComponent) {
<<<<<<<
vm.icons = commonsFact.loadIcons(vm.data._attachments);
=======
vm.icons = commons.loadIcons(vm.data._attachments);
>>>>>>>
vm.icons = commonsFact.loadIcons(vm.data._attachments);
<<<<<<<
vm.icons = commonsFact.loadIcons(vm._attachments);
}
=======
vm.icons = commons.loadIcons(vm._attachments);
};
>>>>>>>
vm.icons = commonsFact.loadIcons(vm._attachments);
} |
<<<<<<<
.controller('modalEditCtrl',
['$scope', '$modalInstance', 'severities', 'vulns', 'commons',
function($scope, $modalInstance, severities, vulns, commons) {
=======
.controller('modalEditCtrl', ['$scope', '$modalInstance', 'commonsFact', 'severities', 'vulns',
function($scope, $modalInstance, commons, severities, vulns) {
$scope.evidence = {};
$scope.icons = {};
$scope.severities = severities;
$scope.vulns = vulns;
$scope.web = false;
$scope.mixed = 0x00;
$scope.vulnc = 0;
var vuln_mask = {"VulnerabilityWeb": 0x01, "Vulnerability": 0x10};
>>>>>>>
.controller('modalEditCtrl', ['$scope', '$modalInstance', 'commonsFact', 'severities', 'vulns',
function($scope, $modalInstance, commons, severities, vulns) {
$scope.evidence = {};
$scope.icons = {};
$scope.severities = severities;
$scope.vulns = vulns;
$scope.web = false;
$scope.mixed = 0x00;
$scope.vulnc = 0;
var vuln_mask = {"VulnerabilityWeb": 0x01, "Vulnerability": 0x10};
<<<<<<<
$scope.call = function(){
$scope.refs = commons.arrayToObject($scope.refs);
}
$scope.severities = severities;
$scope.vulns = vulns;
$scope.web = false;
$scope.mixed = 0x00;
$scope.vulnc = 0;
var vuln_mask = {"VulnerabilityWeb": 0x01, "Vulnerability": 0x10};
=======
>>>>>>>
$scope.call = function(){
$scope.refs = commons.arrayToObject($scope.refs);
}
<<<<<<<
$scope.refs = commons.objectToArray($scope.refs);
=======
var res = {},
evidence = [];
for(var key in $scope.evidence) {
if(Object.keys($scope.evidence[key]).length == 1) {
evidence.push(key);
} else {
evidence.push($scope.evidence[key]);
}
}
>>>>>>>
var res = {},
evidence = [];
for(var key in $scope.evidence) {
if(Object.keys($scope.evidence[key]).length == 1) {
evidence.push(key);
} else {
evidence.push($scope.evidence[key]);
}
}
$scope.refs = commons.objectToArray($scope.refs);
<<<<<<<
"data": $scope.data,
"desc": $scope.desc,
"method": $scope.method,
"name": $scope.name,
"params": $scope.params,
"path": $scope.path,
"pname": $scope.pname,
"query": $scope.query,
"refs": $scope.refs,
"request": $scope.request,
"response": $scope.response,
"resolution": $scope.resolution,
"severity": $scope.severitySelection,
"vulns": $scope.vulns,
"website": $scope.website
=======
"data": $scope.data,
"desc": $scope.desc,
"evidence": $scope.evidence,
"method": $scope.method,
"name": $scope.name,
"params": $scope.params,
"path": $scope.path,
"pname": $scope.pname,
"query": $scope.query,
"request": $scope.request,
"response": $scope.response,
"severity": $scope.severitySelection,
"vulns": $scope.vulns,
"website": $scope.website
>>>>>>>
"data": $scope.data,
"desc": $scope.desc,
"evidence": $scope.evidence,
"method": $scope.method,
"name": $scope.name,
"params": $scope.params,
"path": $scope.path,
"pname": $scope.pname,
"query": $scope.query,
"refs": $scope.refs,
"request": $scope.request,
"response": $scope.response,
"resolution": $scope.resolution,
"severity": $scope.severitySelection,
"vulns": $scope.vulns,
"website": $scope.website
<<<<<<<
"data": $scope.data,
"desc": $scope.desc,
"name": $scope.name,
"refs": $scope.refs,
"resolution": $scope.resolution,
"severity": $scope.severitySelection,
"vulns": $scope.vulns
=======
"data": $scope.data,
"desc": $scope.desc,
"evidence": $scope.evidence,
"name": $scope.name,
"severity": $scope.severitySelection,
"vulns": $scope.vulns
>>>>>>>
"data": $scope.data,
"desc": $scope.desc,
"evidence": $scope.evidence,
"name": $scope.name,
"refs": $scope.refs,
"resolution": $scope.resolution,
"severity": $scope.severitySelection,
"vulns": $scope.vulns
<<<<<<<
$scope.newReference = function($event){
$scope.refs.push({ref:''});
};
}]);
=======
$scope.selectedFiles = function(files, e) {
files.forEach(function(file) {
if(!$scope.evidence.hasOwnProperty(file)) $scope.evidence[file.name] = file;
});
$scope.icons = commons.loadIcons($scope.evidence);
}
$scope.removeEvidence = function(name) {
delete $scope.evidence[name];
delete $scope.icons[name];
}
}]);
>>>>>>>
$scope.newReference = function($event){
$scope.refs.push({ref:''});
};
$scope.selectedFiles = function(files, e) {
files.forEach(function(file) {
if(!$scope.evidence.hasOwnProperty(file)) $scope.evidence[file.name] = file;
});
$scope.icons = commons.loadIcons($scope.evidence);
}
$scope.removeEvidence = function(name) {
delete $scope.evidence[name];
delete $scope.icons[name];
}
}]); |
<<<<<<<
vulnsManager, workspacesFact, csvService, uiGridConstants, vulnModelsManager, ServerAPI) {
=======
vulnsManager, workspacesFact, csvService, uiGridConstants, vulnModelsManager, referenceFact) {
>>>>>>>
vulnsManager, workspacesFact, csvService, uiGridConstants, vulnModelsManager, referenceFact, ServerAPI) {
<<<<<<<
$scope.gridOptions.columnDefs.push({ name : '_id',
displayName : "_id",
cellTemplate: 'scripts/statusReport/partials/ui-grid/columns/idcolumn.html',
headerCellTemplate: header,
width: '50',
sort: getColumnSort('_id'),
visible: $scope.columns["_id"]
});
=======
$scope.gridOptions.columnDefs.push({ name : 'severity',
cellTemplate: 'scripts/statusReport/partials/ui-grid/columns/severitycolumn.html',
headerCellTemplate: header,
displayName : "sev",
type: 'string',
width: '70',
visible: $scope.columns["severity"],
sort: getColumnSort('severity'),
sortingAlgorithm: compareSeverities,
enableColumnResizing: false
});
>>>>>>>
$scope.gridOptions.columnDefs.push({ name : '_id',
displayName : "_id",
cellTemplate: 'scripts/statusReport/partials/ui-grid/columns/idcolumn.html',
headerCellTemplate: header,
width: '50',
sort: getColumnSort('_id'),
visible: $scope.columns["_id"]
});
$scope.gridOptions.columnDefs.push({ name : 'severity',
cellTemplate: 'scripts/statusReport/partials/ui-grid/columns/severitycolumn.html',
headerCellTemplate: header,
displayName : "sev",
type: 'string',
width: '70',
visible: $scope.columns["severity"],
sort: getColumnSort('severity'),
sortingAlgorithm: compareSeverities,
enableColumnResizing: false
});
<<<<<<<
minWidth: '100',
maxWidth: '200',
enableSorting: false,
=======
width: $scope.columnsWidths['hostname'],
sort: getColumnSort('hostnames'),
>>>>>>>
minWidth: '100',
maxWidth: '200',
enableSorting: false,
width: $scope.columnsWidths['hostname'],
sort: getColumnSort('hostnames'),
<<<<<<<
visible: $scope.columns["refs"],
enableSorting: false,
=======
visible: $scope.columns["refs"],
width: $scope.columnsWidths['refs'],
>>>>>>>
visible: $scope.columns["refs"],
enableSorting: false,
width: $scope.columnsWidths['refs'],
<<<<<<<
enableSorting: false,
visible: $scope.columns["impact"]
=======
visible: $scope.columns["impact"],
width: $scope.columnsWidths['impact'],
>>>>>>>
enableSorting: false,
visible: $scope.columns["impact"],
width: $scope.columnsWidths['impact'],
<<<<<<<
// The following line breaks the remembering of the field (i.e.
// setting it in the SRcolumns cookie), so it is better to
// leave it commented (or to debug the problem, which I don't
// want to)
// displayName : "policy violations",
=======
displayName : "policyviolations",
>>>>>>>
// The following line breaks the remembering of the field (i.e.
// setting it in the SRcolumns cookie), so it is better to
// leave it commented (or to debug the problem, which I don't
// want to)
// displayName : "policy violations",
<<<<<<<
$scope.searchExploits = function(){
var promises = [];
var selected = $scope.getCurrentSelection();
selected.forEach(function(vuln){
vuln.refs.forEach(function(ref){
if(ref.toLowerCase().startsWith('cve')){
var response = ServerAPI.getExploits(ref);
promises.push(response);
}
});
});
return $q.all(promises).then(function(modalData){
var response = modalData.map(function(obj){
return obj.data;
});
return response.filter(function(x){!angular.equals(x, {})})
}, function(failed) {
commonsFact.showMessage("Something failed searching vulnerability exploits.");
return [];
});
}
$scope.showExploits = function(){
$scope.searchExploits().then(function(exploits){
if(exploits.length > 0){
var modal = $uibModal.open({
templateUrl: 'scripts/statusReport/partials/exploitsModal.html',
controller: 'commonsModalExploitsCtrl',
resolve: {
msg: function() {
return exploits;
}
}
});
}
});
}
=======
var resizeGrid = function() {
$scope.gridHeight = getGridHeight('grid', 'right-main', 15);
};
var recalculateLastVisibleColSize = function () {
var lastFound = false;
for (i = $scope.gridApi.grid.columns.length - 1; i >= 0; i--) {
if ($scope.gridApi.grid.columns[i].visible) {
if (!lastFound) {
$scope.gridApi.grid.columns[i].width = "*";
lastFound = true
} else if ($scope.gridApi.grid.columns[i].width === "*" && $scope.columnsWidths[$scope.gridApi.grid.columns[i].name] != undefined) {
$scope.gridApi.grid.columns[i].width = parseInt($scope.columnsWidths[$scope.gridApi.grid.columns[i].name]);
}
}
}
};
var getGridHeight = function(gridClass, contentClass, bottomOffset) {
var contentOffset = angular.element(document.getElementsByClassName(contentClass)[0]).offset();
var contentHeight = angular.element(document.getElementsByClassName(contentClass)[0]).height();
var gridOffset = angular.element(document.getElementsByClassName(gridClass)).offset();
if (gridOffset !== undefined) {
var gridHeight = contentHeight - (gridOffset.top) - bottomOffset;
return gridHeight + 'px';
}
};
>>>>>>>
$scope.searchExploits = function(){
var promises = [];
var selected = $scope.getCurrentSelection();
selected.forEach(function(vuln){
vuln.refs.forEach(function(ref){
if(ref.toLowerCase().startsWith('cve')){
var response = ServerAPI.getExploits(ref);
promises.push(response);
}
});
});
return $q.all(promises).then(function(modalData){
var response = modalData.map(function(obj){
return obj.data;
});
return response.filter(function(x){!angular.equals(x, {})});
}, function(failed) {
commonsFact.showMessage("Something failed searching vulnerability exploits.");
return [];
});
}
$scope.showExploits = function(){
$scope.searchExploits().then(function(exploits){
if(exploits.length > 0){
var modal = $uibModal.open({
templateUrl: 'scripts/statusReport/partials/exploitsModal.html',
controller: 'commonsModalExploitsCtrl',
resolve: {
msg: function() {
return exploits;
}
}
});
}
});
}
var resizeGrid = function() {
$scope.gridHeight = getGridHeight('grid', 'right-main', 15);
};
var recalculateLastVisibleColSize = function () {
var lastFound = false;
for (i = $scope.gridApi.grid.columns.length - 1; i >= 0; i--) {
if ($scope.gridApi.grid.columns[i].visible) {
if (!lastFound) {
$scope.gridApi.grid.columns[i].width = "*";
lastFound = true
} else if ($scope.gridApi.grid.columns[i].width === "*" && $scope.columnsWidths[$scope.gridApi.grid.columns[i].name] != undefined) {
$scope.gridApi.grid.columns[i].width = parseInt($scope.columnsWidths[$scope.gridApi.grid.columns[i].name]);
}
}
}
};
var getGridHeight = function(gridClass, contentClass, bottomOffset) {
var contentOffset = angular.element(document.getElementsByClassName(contentClass)[0]).offset();
var contentHeight = angular.element(document.getElementsByClassName(contentClass)[0]).height();
var gridOffset = angular.element(document.getElementsByClassName(gridClass)).offset();
if (gridOffset !== undefined) {
var gridHeight = contentHeight - (gridOffset.top) - bottomOffset;
return gridHeight + 'px';
}
}; |
<<<<<<<
"data": true,
"date": true,
"desc": true,
"method": false,
"name": true,
"params": false,
"path": false,
"pname": false,
"query": false,
"refs": true,
"request": false,
"response": false,
"resolution": false,
"severity": true,
"status": false,
"target": true,
"web": false,
"website": false
=======
"data": true,
"date": true,
"desc": true,
"evidence": false,
"method": false,
"name": true,
"params": false,
"path": false,
"pname": false,
"query": false,
"request": false,
"response": false,
"severity": true,
"status": false,
"target": true,
"web": false,
"website": false
>>>>>>>
"data": true,
"date": true,
"desc": true,
"evidence": false,
"method": false,
"name": true,
"params": false,
"path": false,
"pname": false,
"query": false,
"refs": true,
"request": false,
"response": false,
"resolution": false,
"severity": true,
"status": false,
"target": true,
"web": false,
"website": false
<<<<<<<
if(typeof(data.refs) != "undefined") v.refs = data.refs;
if(typeof(data.resolution) != "undefined") v.resolution = data.resolution;
=======
v.evidence = data.evidence;
>>>>>>>
if(typeof(data.refs) != "undefined") v.refs = data.refs;
if(typeof(data.resolution) != "undefined") v.resolution = data.resolution;
v.evidence = data.evidence; |
<<<<<<<
$scope.loading = false;
=======
$scope.loading = false;
>>>>>>>
$scope.loading = false;
<<<<<<<
$scope.loading = false;
=======
$scope.totalModels = vulnModelsManager.totalNumberOfModels;
>>>>>>>
$scope.loading = false;
$scope.totalModels = vulnModelsManager.totalNumberOfModels; |
<<<<<<<
const getFactorioLocale = require("./lib/getFactorioLocale");
=======
const getFactorioLocale = require("lib/getFactorioLocale");
const stringUtils = require("lib/stringUtils");
const fileOps = require("lib/fileOps");
>>>>>>>
const getFactorioLocale = require("lib/getFactorioLocale");
<<<<<<<
const pluginManager = require("./lib/manager/pluginManager.js")(config);
=======
async function getPlugins(){
const pluginManager = require("lib/manager/pluginManager.js")(config);
>>>>>>>
async function getPlugins(){
const pluginManager = require("lib/manager/pluginManager.js")(config); |
<<<<<<<
ingestMethod.processContactLoad(job, false, {
/*FUTURE: context obj*/
});
=======
dispatchContactIngestLoad(job, organization, {/*FUTURE: context obj*/});
>>>>>>>
dispatchContactIngestLoad(job, organization, {
/*FUTURE: context obj*/
}); |
<<<<<<<
hasUnsentInitialMessages: async (campaign) => {
const contacts = await r.knex('campaign_contact')
.select('id')
.where({ campaign_id: campaign.id, message_status: 'needsMessage' })
.limit(1)
return contacts.length > 0
},
customFields: async (campaign) => {
const campaignContacts = await r.table('campaign_contact')
.getAll(campaign.id, { index: 'campaign_id' })
.limit(1)
if (campaignContacts.length > 0) {
return Object.keys(JSON.parse(campaignContacts[0].custom_fields))
}
return []
},
=======
customFields: async (campaign) => (
campaign.customFields
|| cacheableData.campaign.dbCustomFields(campaign.id)
),
>>>>>>>
hasUnsentInitialMessages: async (campaign) => {
const contacts = await r.knex('campaign_contact')
.select('id')
.where({ campaign_id: campaign.id, message_status: 'needsMessage' })
.limit(1)
return contacts.length > 0
},
customFields: async (campaign) => {
const campaignContacts = await r.table('campaign_contact')
.getAll(campaign.id, { index: 'campaign_id' })
.limit(1)
if (campaignContacts.length > 0) {
return Object.keys(JSON.parse(campaignContacts[0].custom_fields))
}
return []
},
customFields: async (campaign) => (
campaign.customFields
|| cacheableData.campaign.dbCustomFields(campaign.id)
), |
<<<<<<<
else {
module.error(errors.state);
return false;
}
=======
>>>>>>> |
<<<<<<<
console.timeEnd("func2");
console.time("func3");
=======
>>>>>>>
<<<<<<<
console.timeEnd("func3");
console.time("func4");
=======
>>>>>>>
<<<<<<<
console.timeEnd("func4");
console.time("func5");
=======
>>>>>>>
<<<<<<<
console.timeEnd("func5");
console.time("func6");
=======
>>>>>>>
<<<<<<<
console.timeEnd("func6");
console.time("func7");
=======
>>>>>>>
<<<<<<<
console.timeEnd("func7");
console.time("func8");
=======
>>>>>>>
<<<<<<<
console.timeEnd("func8");
console.time("func9");
=======
>>>>>>>
<<<<<<<
console.timeEnd("func9");
console.time("func10");
=======
>>>>>>>
<<<<<<<
console.timeEnd("func10");
console.time("func11");
=======
>>>>>>>
<<<<<<<
console.timeEnd("func11");
console.time("func12");
=======
>>>>>>>
<<<<<<<
console.timeEnd("func12");
console.time("func13");
=======
>>>>>>>
<<<<<<<
console.timeEnd("func13");
console.time("func14");
=======
>>>>>>>
<<<<<<<
console.timeEnd("func14");
=======
>>>>>>>
<<<<<<<
console.timeEnd("fullfunction");
}, 10000); // long test can exceed default 5seconds
});
describe("Bulk Send", async () => {
const OLD_ENV = process.env;
beforeEach(async () => {
jest.resetModules(); // this is important - it clears the cache
process.env = {
...OLD_ENV
};
});
afterEach(async () => {
process.env = OLD_ENV;
});
const testBulkSend = async (
params,
expectedSentCount,
resultTestFunction
) => {
process.env.ALLOW_SEND_ALL = params.allowSendAll;
process.env.NOT_IN_USA = params.notInUsa;
process.env.BULK_SEND_CHUNK_SIZE = params.bulkSendChunkSize;
testCampaign.use_dynamic_assignment = true;
await createScript(testAdminUser, testCampaign);
await startCampaign(testAdminUser, testCampaign);
let texterCampaignDataResults = await runComponentGql(
TexterTodoQuery,
{
contactsFilter: {
messageStatus: "needsMessage",
isOptedOut: false,
validTimezone: true
},
assignmentId
},
testTexterUser
);
// TEXTER 1 (NUMBER_OF_CONTACTS needsMessage)
expect(texterCampaignDataResults.data.assignment.contacts.length).toEqual(
NUMBER_OF_CONTACTS
);
expect(texterCampaignDataResults.data.assignment.allContactsCount).toEqual(
NUMBER_OF_CONTACTS
);
// send some texts
const bulkSendResult = await bulkSendMessages(assignmentId, testTexterUser);
console.log(bulkSendResult);
resultTestFunction(bulkSendResult);
// TEXTER 1 (95 needsMessage, 5 needsResponse)
texterCampaignDataResults = await runComponentGql(
TexterTodoQuery,
{
contactsFilter: {
messageStatus: "needsMessage",
isOptedOut: false,
validTimezone: true
},
assignmentId
},
testTexterUser
);
expect(texterCampaignDataResults.data.assignment.contacts.length).toEqual(
NUMBER_OF_CONTACTS - expectedSentCount
);
expect(texterCampaignDataResults.data.assignment.allContactsCount).toEqual(
NUMBER_OF_CONTACTS
);
};
const expectErrorBulkSending = result => {
expect(result.errors[0]).toBeDefined();
/*
We expect result.errors[0] to be this for the errors encountered in these tests.
This works locally.
GraphQLError {
message: {
status: 403,
message: 'Not allowed to send all messages at once'
},
locations: [{
line: 3,
column: 9
}],
path: ['bulkSendMessages']
}
However, on Travis, result.errors[0].message.status is undefined, causing the assertion
below to fail. Hence, it is commented out.
*/
// expect(result.errors[0].message.status).toEqual(403);
expect(result.data.bulkSendMessages).toBeFalsy();
};
const expectSuccessBulkSending = expectedSentCount => result => {
expect(result.errors).toBeFalsy();
expect(result.data.bulkSendMessages.length).toEqual(expectedSentCount);
};
it("should send initial texts to as many contacts as are in the chunk size if chunk size equals the number of contacts", async () => {
const params = {
allowSendAll: true,
notInUsa: true,
bulkSendChunkSize: NUMBER_OF_CONTACTS
};
await testBulkSend(
params,
NUMBER_OF_CONTACTS,
expectSuccessBulkSending(NUMBER_OF_CONTACTS)
);
});
it("should send initial texts to as many contacts as are in the chunk size if chunk size is smaller than the number of contacts", async () => {
const params = {
allowSendAll: true,
notInUsa: true,
bulkSendChunkSize: NUMBER_OF_CONTACTS - 1
};
await testBulkSend(
params,
NUMBER_OF_CONTACTS - 1,
expectSuccessBulkSending(NUMBER_OF_CONTACTS - 1)
);
});
it("should send initial texts to all contacts if chunk size is greater than the number of contacts", async () => {
const params = {
allowSendAll: true,
notInUsa: true,
bulkSendChunkSize: NUMBER_OF_CONTACTS + 1
};
await testBulkSend(
params,
NUMBER_OF_CONTACTS,
expectSuccessBulkSending(NUMBER_OF_CONTACTS)
);
});
it("should NOT bulk send initial texts if ALLOW_SEND_ALL is not set", async () => {
const params = {
allowSendAll: false,
notInUsa: true,
bulkSendChunkSize: NUMBER_OF_CONTACTS
};
await testBulkSend(params, 0, expectErrorBulkSending);
});
it("should NOT bulk send initial texts if NOT_IN_USA is not set", async () => {
const params = {
allowSendAll: true,
notInUsa: false,
bulkSendChunkSize: NUMBER_OF_CONTACTS
};
await testBulkSend(params, 0, expectErrorBulkSending);
});
it("should NOT bulk send initial texts if neither ALLOW_SEND_ALL nor NOT_IN_USA is not set", async () => {
const params = {
allowSendAll: false,
notInUsa: false,
bulkSendChunkSize: NUMBER_OF_CONTACTS
};
await testBulkSend(params, 0, expectErrorBulkSending);
});
=======
}, 10000); // long test can exceed default 5seconds
>>>>>>>
}, 10000); // long test can exceed default 5seconds
});
describe("Bulk Send", async () => {
const OLD_ENV = process.env;
beforeEach(async () => {
jest.resetModules(); // this is important - it clears the cache
process.env = {
...OLD_ENV
};
});
afterEach(async () => {
process.env = OLD_ENV;
});
const testBulkSend = async (
params,
expectedSentCount,
resultTestFunction
) => {
process.env.ALLOW_SEND_ALL = params.allowSendAll;
process.env.NOT_IN_USA = params.notInUsa;
process.env.BULK_SEND_CHUNK_SIZE = params.bulkSendChunkSize;
testCampaign.use_dynamic_assignment = true;
await createScript(testAdminUser, testCampaign);
await startCampaign(testAdminUser, testCampaign);
let texterCampaignDataResults = await runComponentGql(
TexterTodoQuery,
{
contactsFilter: {
messageStatus: "needsMessage",
isOptedOut: false,
validTimezone: true
},
assignmentId
},
testTexterUser
);
// TEXTER 1 (NUMBER_OF_CONTACTS needsMessage)
expect(texterCampaignDataResults.data.assignment.contacts.length).toEqual(
NUMBER_OF_CONTACTS
);
expect(texterCampaignDataResults.data.assignment.allContactsCount).toEqual(
NUMBER_OF_CONTACTS
);
// send some texts
const bulkSendResult = await bulkSendMessages(assignmentId, testTexterUser);
console.log(bulkSendResult);
resultTestFunction(bulkSendResult);
// TEXTER 1 (95 needsMessage, 5 needsResponse)
texterCampaignDataResults = await runComponentGql(
TexterTodoQuery,
{
contactsFilter: {
messageStatus: "needsMessage",
isOptedOut: false,
validTimezone: true
},
assignmentId
},
testTexterUser
);
expect(texterCampaignDataResults.data.assignment.contacts.length).toEqual(
NUMBER_OF_CONTACTS - expectedSentCount
);
expect(texterCampaignDataResults.data.assignment.allContactsCount).toEqual(
NUMBER_OF_CONTACTS
);
};
const expectErrorBulkSending = result => {
expect(result.errors[0]).toBeDefined();
/*
We expect result.errors[0] to be this for the errors encountered in these tests.
This works locally.
GraphQLError {
message: {
status: 403,
message: 'Not allowed to send all messages at once'
},
locations: [{
line: 3,
column: 9
}],
path: ['bulkSendMessages']
}
However, on Travis, result.errors[0].message.status is undefined, causing the assertion
below to fail. Hence, it is commented out.
*/
// expect(result.errors[0].message.status).toEqual(403);
expect(result.data.bulkSendMessages).toBeFalsy();
};
const expectSuccessBulkSending = expectedSentCount => result => {
expect(result.errors).toBeFalsy();
expect(result.data.bulkSendMessages.length).toEqual(expectedSentCount);
};
it("should send initial texts to as many contacts as are in the chunk size if chunk size equals the number of contacts", async () => {
const params = {
allowSendAll: true,
notInUsa: true,
bulkSendChunkSize: NUMBER_OF_CONTACTS
};
await testBulkSend(
params,
NUMBER_OF_CONTACTS,
expectSuccessBulkSending(NUMBER_OF_CONTACTS)
);
});
it("should send initial texts to as many contacts as are in the chunk size if chunk size is smaller than the number of contacts", async () => {
const params = {
allowSendAll: true,
notInUsa: true,
bulkSendChunkSize: NUMBER_OF_CONTACTS - 1
};
await testBulkSend(
params,
NUMBER_OF_CONTACTS - 1,
expectSuccessBulkSending(NUMBER_OF_CONTACTS - 1)
);
});
it("should send initial texts to all contacts if chunk size is greater than the number of contacts", async () => {
const params = {
allowSendAll: true,
notInUsa: true,
bulkSendChunkSize: NUMBER_OF_CONTACTS + 1
};
await testBulkSend(
params,
NUMBER_OF_CONTACTS,
expectSuccessBulkSending(NUMBER_OF_CONTACTS)
);
});
it("should NOT bulk send initial texts if ALLOW_SEND_ALL is not set", async () => {
const params = {
allowSendAll: false,
notInUsa: true,
bulkSendChunkSize: NUMBER_OF_CONTACTS
};
await testBulkSend(params, 0, expectErrorBulkSending);
});
it("should NOT bulk send initial texts if NOT_IN_USA is not set", async () => {
const params = {
allowSendAll: true,
notInUsa: false,
bulkSendChunkSize: NUMBER_OF_CONTACTS
};
await testBulkSend(params, 0, expectErrorBulkSending);
});
it("should NOT bulk send initial texts if neither ALLOW_SEND_ALL nor NOT_IN_USA is not set", async () => {
const params = {
allowSendAll: false,
notInUsa: false,
bulkSendChunkSize: NUMBER_OF_CONTACTS
};
await testBulkSend(params, 0, expectErrorBulkSending);
}); |
<<<<<<<
if (this.get('session').isAuthenticated) {
this.get('notifications').showAlert('θ―·ε
ιεΊη»ε½οΌηΆεε注εζ°η¨ζ·γ', {type: 'warn', delayed: true});
this.transitionTo(Configuration.routeAfterAuthentication);
=======
if (this.get('session.isAuthenticated')) {
this.get('notifications').showAlert('You need to sign out to register as a new user.', {type: 'warn', delayed: true, key: 'signup.create.already-authenticated'});
this.transitionTo(Configuration.routeIfAlreadyAuthenticated);
>>>>>>>
if (this.get('session.isAuthenticated')) {
this.get('notifications').showAlert('θ―·ε
ιεΊη»ε½οΌηΆεε注εζ°η¨ζ·γ', {type: 'warn', delayed: true, key: 'signup.create.already-authenticated'});
this.transitionTo(Configuration.routeIfAlreadyAuthenticated);
<<<<<<<
self.get('notifications').showAlert('ιθ―·δΈεε¨ζε·²η»ε€±ζγ', {type: 'warn', delayed: true});
=======
self.get('notifications').showAlert('The invitation does not exist or is no longer valid.', {type: 'warn', delayed: true, key: 'signup.create.invalid-invitation'});
>>>>>>>
self.get('notifications').showAlert('ιθ―·δΈεε¨ζε·²η»ε€±ζγ', {type: 'warn', delayed: true, key: 'signup.create.invalid-invitation'}); |
<<<<<<<
const answerOptionStore = {}
for (let index = 0; index < job.payload.interaction_steps.length; index++) {
=======
for (let index = 0; index < payload.interaction_steps.length; index++) {
>>>>>>>
const answerOptionStore = {}
for (let index = 0; index < payload.interaction_steps.length; index++) { |
<<<<<<<
if (s != null) s.volume += interp.arg(b, 0);
};
=======
if (s != null) s.volume += interp.numarg(b, 0);
}
>>>>>>>
if (s != null) s.volume += interp.numarg(b, 0);
};
<<<<<<<
if (s != null) s.volume = interp.arg(b, 0);
};
=======
if (s != null) s.volume = interp.numarg(b, 0);
}
>>>>>>>
if (s != null) s.volume = interp.numarg(b, 0);
}; |
<<<<<<<
var radians = (90 - s.direction) * Math.PI / 180;
var d = interp.arg(b, 0);
=======
var radians = ((Math.PI * (90 - s.direction)) / 180);
var d = interp.numarg(b, 0);
>>>>>>>
var radians = (90 - s.direction) * Math.PI / 180;
var d = interp.numarg(b, 0);
<<<<<<<
s.setDirection(interp.arg(b, 0));
if (s.visible) interp.redraw();
};
=======
s.setDirection(interp.numarg(b, 0));
if(s.visible) interp.redraw();
}
>>>>>>>
s.setDirection(interp.numarg(b, 0));
if (s.visible) interp.redraw();
};
<<<<<<<
var p = mouseOrSpritePosition(interp.arg(b, 0));
if (s == null || p == null) return;
=======
var p = mouseOrSpritePosition(interp.numarg(b, 0));
if (s == null) return;
>>>>>>>
var p = mouseOrSpritePosition(interp.arg(b, 0));
if (s == null || p == null) return;
<<<<<<<
if (s != null) moveSpriteTo(s, interp.arg(b, 0), interp.arg(b, 1));
};
=======
if (s != null) moveSpriteTo(s, interp.numarg(b, 0), interp.numarg(b, 1));
}
>>>>>>>
if (s != null) moveSpriteTo(s, interp.numarg(b, 0), interp.numarg(b, 1));
};
<<<<<<<
if (s != null) moveSpriteTo(s, s.scratchX + interp.arg(b, 0), s.scratchY);
};
=======
if (s != null) moveSpriteTo(s, s.scratchX + interp.numarg(b, 0), s.scratchY);
}
>>>>>>>
if (s != null) moveSpriteTo(s, s.scratchX + interp.numarg(b, 0), s.scratchY);
};
<<<<<<<
if (s != null) moveSpriteTo(s, interp.arg(b, 0), s.scratchY);
};
=======
if (s != null) moveSpriteTo(s, interp.numarg(b, 0), s.scratchY);
}
>>>>>>>
if (s != null) moveSpriteTo(s, interp.numarg(b, 0), s.scratchY);
};
<<<<<<<
if (s != null) moveSpriteTo(s, s.scratchX, s.scratchY + interp.arg(b, 0));
};
=======
if (s != null) moveSpriteTo(s, s.scratchX, s.scratchY + interp.numarg(b, 0));
}
>>>>>>>
if (s != null) moveSpriteTo(s, s.scratchX, s.scratchY + interp.numarg(b, 0));
};
<<<<<<<
if (s != null) moveSpriteTo(s, s.scratchX, interp.arg(b, 0));
};
=======
if (s != null) moveSpriteTo(s, s.scratchX, interp.numarg(b, 0));
}
>>>>>>>
if (s != null) moveSpriteTo(s, s.scratchX, interp.numarg(b, 0));
};
<<<<<<<
if (s != null) s.setPenColor(interp.arg(b, 0));
};
=======
if (s != null) s.setPenColor(interp.numarg(b, 0));
}
>>>>>>>
if (s != null) s.setPenColor(interp.numarg(b, 0));
};
<<<<<<<
if (s != null) s.setPenHue(interp.arg(b, 0));
};
=======
if (s != null) s.setPenHue(interp.numarg(b, 0));
}
>>>>>>>
if (s != null) s.setPenHue(interp.numarg(b, 0));
};
<<<<<<<
if (s != null) s.setPenHue(s.penHue + interp.arg(b, 0));
};
=======
if (s != null) s.setPenHue(s.penHue + interp.numarg(b, 0));
}
>>>>>>>
if (s != null) s.setPenHue(s.penHue + interp.numarg(b, 0));
};
<<<<<<<
if (s != null) s.setPenShade(interp.arg(b, 0));
};
=======
if (s != null) s.setPenShade(interp.numarg(b, 0));
}
>>>>>>>
if (s != null) s.setPenShade(interp.numarg(b, 0));
};
<<<<<<<
if (s != null) s.setPenShade(s.penShade + interp.arg(b, 0));
};
=======
if (s != null) s.setPenShade(s.penShade + interp.numarg(b, 0));
}
>>>>>>>
if (s != null) s.setPenShade(s.penShade + interp.numarg(b, 0));
}; |
<<<<<<<
litmus: common.isNumber,
=======
FunctionController.prototype,
Controller.prototype,
{
fire: function() {
if (this.__onChange) {
this.__onChange.call(this);
}
this.getValue().call(this.object);
if (this.__onFinishChange) {
this.__onFinishChange.call(this, this.getValue());
}
}
}
>>>>>>>
litmus: common.isNumber,
<<<<<<<
=======
// TODO listening?
this.__ul.removeChild(controller.__li);
this.__controllers.splice(this.__controllers.indexOf(controller), 1);
var _this = this;
common.defer(function() {
_this.onResize();
});
>>>>>>>
<<<<<<<
};
=======
dom.addClass(li, GUI.CLASS_CONTROLLER_ROW);
if (controller instanceof ColorController) {
dom.addClass(li, "color");
} else {
dom.addClass(li, typeof controller.getValue());
}
>>>>>>>
};
<<<<<<<
var _this = this;
=======
})(dat.utils.css,
"<div id=\"dg-save\" class=\"dg dialogue\">\n\n Here's the new load parameter for your <code>GUI</code>'s constructor:\n\n <textarea id=\"dg-new-constructor\"></textarea>\n\n <div id=\"dg-save-locally\">\n\n <input id=\"dg-local-storage\" type=\"checkbox\"/> Automatically save\n values to <code>localStorage</code> on exit.\n\n <div id=\"dg-local-explain\">The values saved to <code>localStorage</code> will\n override those passed to <code>dat.GUI</code>'s constructor. This makes it\n easier to work incrementally, but <code>localStorage</code> is fragile,\n and your friends may not see the same values you do.\n \n </div>\n \n </div>\n\n</div>",
".dg {\n /** Clear list styles */\n /* Auto-place container */\n /* Auto-placed GUI's */\n /* Line items that don't contain folders. */\n /** Folder names */\n /** Hides closed items */\n /** Controller row */\n /** Name-half (left) */\n /** Controller-half (right) */\n /** Controller placement */\n /** Shorter number boxes when slider is present. */\n /** Ensure the entire boolean and function row shows a hand */ }\n .dg ul {\n list-style: none;\n margin: 0;\n padding: 0;\n width: 100%;\n clear: both; }\n .dg.ac {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n height: 0;\n z-index: 0; }\n .dg:not(.ac) .main {\n /** Exclude mains in ac so that we don't hide close button */\n overflow: hidden; }\n .dg.main {\n -webkit-transition: opacity 0.1s linear;\n -o-transition: opacity 0.1s linear;\n -moz-transition: opacity 0.1s linear;\n transition: opacity 0.1s linear; }\n .dg.main.taller-than-window {\n overflow-y: auto; }\n .dg.main.taller-than-window .close-button {\n opacity: 1;\n /* TODO, these are style notes */\n margin-top: -1px;\n border-top: 1px solid #2c2c2c; }\n .dg.main ul.closed .close-button {\n opacity: 1 !important; }\n .dg.main:hover .close-button,\n .dg.main .close-button.drag {\n opacity: 1; }\n .dg.main .close-button {\n /*opacity: 0;*/\n -webkit-transition: opacity 0.1s linear;\n -o-transition: opacity 0.1s linear;\n -moz-transition: opacity 0.1s linear;\n transition: opacity 0.1s linear;\n border: 0;\n position: absolute;\n line-height: 19px;\n height: 20px;\n /* TODO, these are style notes */\n cursor: pointer;\n text-align: center;\n background-color: #000; }\n .dg.main .close-button:hover {\n background-color: #111; }\n .dg.a {\n float: right;\n margin-right: 15px;\n overflow-x: hidden; }\n .dg.a.has-save > ul {\n margin-top: 27px; }\n .dg.a.has-save > ul.closed {\n margin-top: 0; }\n .dg.a .save-row {\n position: fixed;\n top: 0;\n z-index: 1002; }\n .dg li {\n -webkit-transition: height 0.1s ease-out;\n -o-transition: height 0.1s ease-out;\n -moz-transition: height 0.1s ease-out;\n transition: height 0.1s ease-out; }\n .dg li:not(.folder) {\n cursor: auto;\n height: 27px;\n line-height: 27px;\n overflow: hidden;\n padding: 0 4px 0 5px; }\n .dg li.folder {\n padding: 0;\n border-left: 4px solid rgba(0, 0, 0, 0); }\n .dg li.title {\n cursor: pointer;\n margin-left: -4px; }\n .dg .closed li:not(.title),\n .dg .closed ul li,\n .dg .closed ul li > * {\n height: 0;\n overflow: hidden;\n border: 0; }\n .dg .cr {\n clear: both;\n padding-left: 3px;\n height: 27px; }\n .dg .property-name {\n cursor: default;\n float: left;\n clear: left;\n width: 40%;\n overflow: hidden;\n text-overflow: ellipsis; }\n .dg .c {\n float: left;\n width: 60%; }\n .dg .c input[type=text] {\n border: 0;\n margin-top: 4px;\n padding: 3px;\n width: 100%;\n float: right; }\n .dg .has-slider input[type=text] {\n width: 30%;\n /*display: none;*/\n margin-left: 0; }\n .dg .slider {\n float: left;\n width: 66%;\n margin-left: -5px;\n margin-right: 0;\n height: 19px;\n margin-top: 4px; }\n .dg .slider-fg {\n height: 100%; }\n .dg .c input[type=checkbox] {\n margin-top: 9px; }\n .dg .c select {\n margin-top: 5px; }\n .dg .cr.function,\n .dg .cr.function .property-name,\n .dg .cr.function *,\n .dg .cr.boolean,\n .dg .cr.boolean * {\n cursor: pointer; }\n .dg .selector {\n display: none;\n position: absolute;\n margin-left: -9px;\n margin-top: 23px;\n z-index: 10; }\n .dg .c:hover .selector,\n .dg .selector.drag {\n display: block; }\n .dg li.save-row {\n padding: 0; }\n .dg li.save-row .button {\n display: inline-block;\n padding: 0px 6px; }\n .dg.dialogue {\n background-color: #222;\n width: 460px;\n padding: 15px;\n font-size: 13px;\n line-height: 15px; }\n\n/* TODO Separate style and structure */\n#dg-new-constructor {\n padding: 10px;\n color: #222;\n font-family: Monaco, monospace;\n font-size: 10px;\n border: 0;\n resize: none;\n box-shadow: inset 1px 1px 1px #888;\n word-wrap: break-word;\n margin: 12px 0;\n display: block;\n width: 440px;\n overflow-y: scroll;\n height: 100px;\n position: relative; }\n\n#dg-local-explain {\n display: none;\n font-size: 11px;\n line-height: 17px;\n border-radius: 3px;\n background-color: #333;\n padding: 8px;\n margin-top: 10px; }\n #dg-local-explain code {\n font-size: 10px; }\n\n#dat-gui-save-locally {\n display: none; }\n\n/** Main type */\n.dg {\n color: #eee;\n font: 11px 'Lucida Grande', sans-serif;\n text-shadow: 0 -1px 0 #111;\n /** Auto place */\n /* Controller row, <li> */\n /** Controllers */ }\n .dg.main {\n /** Scrollbar */ }\n .dg.main::-webkit-scrollbar {\n width: 5px;\n background: #1a1a1a; }\n .dg.main::-webkit-scrollbar-corner {\n height: 0;\n display: none; }\n .dg.main::-webkit-scrollbar-thumb {\n border-radius: 5px;\n background: #676767; }\n .dg li:not(.folder) {\n background: #1a1a1a;\n border-bottom: 1px solid #2c2c2c; }\n .dg li.save-row {\n line-height: 25px;\n background: #dad5cb;\n border: 0; }\n .dg li.save-row select {\n margin-left: 5px;\n width: 108px; }\n .dg li.save-row .button {\n margin-left: 5px;\n margin-top: 1px;\n border-radius: 2px;\n font-size: 9px;\n line-height: 7px;\n padding: 4px 4px 5px 4px;\n background: #c5bdad;\n color: #fff;\n text-shadow: 0 1px 0 #b0a58f;\n box-shadow: 0 -1px 0 #b0a58f;\n cursor: pointer; }\n .dg li.save-row .button.gears {\n background: #c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;\n height: 7px;\n width: 8px; }\n .dg li.save-row .button:hover {\n background-color: #bab19e;\n box-shadow: 0 -1px 0 #b0a58f; }\n .dg li.folder {\n border-bottom: 0; }\n .dg li.title {\n padding-left: 16px;\n background: black url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;\n cursor: pointer;\n border-bottom: 1px solid rgba(255, 255, 255, 0.2); }\n .dg .closed li.title {\n background-image: url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==); }\n .dg .cr.boolean {\n border-left: 3px solid #806787; }\n .dg .cr.color {\n border-left: 3px solid; }\n .dg .cr.function {\n border-left: 3px solid #e61d5f; }\n .dg .cr.number {\n border-left: 3px solid #2fa1d6; }\n .dg .cr.number input[type=text] {\n color: #2fa1d6; }\n .dg .cr.string {\n border-left: 3px solid #1ed36f; }\n .dg .cr.string input[type=text] {\n color: #1ed36f; }\n .dg .cr.function:hover, .dg .cr.boolean:hover {\n background: #111; }\n .dg .c input[type=text] {\n background: #303030;\n outline: none; }\n .dg .c input[type=text]:hover {\n background: #3c3c3c; }\n .dg .c input[type=text]:focus {\n background: #494949;\n color: #fff; }\n .dg .c .slider {\n background: #303030;\n cursor: ew-resize; }\n .dg .c .slider-fg {\n background: #2fa1d6; }\n .dg .c .slider:hover {\n background: #3c3c3c; }\n .dg .c .slider:hover .slider-fg {\n background: #44abda; }\n",
dat.controllers.factory = (function (OptionController, NumberControllerBox, NumberControllerSlider, StringController, FunctionController, BooleanController, common) {
>>>>>>>
var _this = this;
<<<<<<<
}
=======
/**
* requirejs version of Paul Irish's RequestAnimationFrame
* http://paulirish.com/2011/requestanimationframe-for-smart-animating/
*/
return window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.oRequestAnimationFrame ||
window.msRequestAnimationFrame ||
function(callback, element) {
window.setTimeout(callback, 1000 / 60);
};
})(),
dat.dom.CenteredDiv = (function (dom, common) {
var CenteredDiv = function() {
this.backgroundElement = document.createElement('div');
common.extend(this.backgroundElement.style, {
backgroundColor: 'rgba(0,0,0,0.8)',
top: 0,
left: 0,
display: 'none',
zIndex: '1000',
opacity: 0,
WebkitTransition: 'opacity 0.2s linear',
transition: 'opacity 0.2s linear'
});
dom.makeFullscreen(this.backgroundElement);
this.backgroundElement.style.position = 'fixed';
this.domElement = document.createElement('div');
common.extend(this.domElement.style, {
position: 'fixed',
display: 'none',
zIndex: '1001',
opacity: 0,
WebkitTransition: '-webkit-transform 0.2s ease-out, opacity 0.2s linear',
transition: 'transform 0.2s ease-out, opacity 0.2s linear'
});
document.body.appendChild(this.backgroundElement);
document.body.appendChild(this.domElement);
var _this = this;
dom.bind(this.backgroundElement, 'click', function() {
_this.hide();
});
>>>>>>>
}
<<<<<<<
// For each object I'm remembering
common.each(gui.__rememberedObjects, function(val, index) {
var saved_values = {};
=======
var _this = this;
>>>>>>>
// For each object I'm remembering
common.each(gui.__rememberedObjects, function(val, index) {
var saved_values = {}; |
<<<<<<<
draggedNumberField = true;
e.preventDefault();
// We don't want to be highlighting this field as we scroll.
// Or any other fields in this gui for that matter ...
// TODO: Make makeUselectable go through each element and child element.
GUI.makeUnselectable(_this.parent.domElement);
GUI.makeUnselectable(numberField);
if(slider) slider.domElement.className += ' active';
py = y;
y = e.pageY;
var dy = py - y;
var newVal = _this.getValue() + dy*step;
_this.setValue(newVal);
return false;
}
=======
draggedNumberField = true;
e.preventDefault();
// We don't want to be highlighting this field as we scroll.
// Or any other fields in this gui for that matter ...
// TODO: Make makeUselectable go through each element and child element.
GUI.makeUnselectable(_this.parent.domElement);
GUI.makeUnselectable(numberField);
py = y;
y = e.pageY;
var dy = py - y;
var newVal = _this.getValue() + dy*step;
_this.setValue(newVal);
return false;
};
>>>>>>>
draggedNumberField = true;
e.preventDefault();
// We don't want to be highlighting this field as we scroll.
// Or any other fields in this gui for that matter ...
// TODO: Make makeUselectable go through each element and child element.
GUI.makeUnselectable(_this.parent.domElement);
GUI.makeUnselectable(numberField);
if(slider) slider.domElement.className += ' active';
py = y;
y = e.pageY;
var dy = py - y;
var newVal = _this.getValue() + dy*step;
_this.setValue(newVal);
return false;
}; |
<<<<<<<
import del from 'del';
=======
import {
getRenderedTemplate,
makeDestPath,
throwStringifiedError,
getRelativeToBasePath
} from './_common-action-utils';
>>>>>>>
import del from 'del';
import {
getRenderedTemplate,
makeDestPath,
throwStringifiedError,
getRelativeToBasePath
} from './_common-action-utils';
<<<<<<<
// if not already an absolute path, make an absolute path from the basePath (plopfile location)
const makeTmplPath = p => path.resolve(plop.getPlopfilePath(), p);
const makeDestPath = p => path.resolve(plop.getDestBasePath(), p);
let {template} = cfg;
const {force, templateFile} = cfg;
const fileDestPath = makeDestPath(plop.renderString(cfg.path || '', data));
=======
const fileDestPath = makeDestPath(data, cfg, plop);
>>>>>>>
const fileDestPath = makeDestPath(data, cfg, plop);
const {force} = cfg;
<<<<<<<
if (templateFile) {
template = yield fspp.readFile(makeTmplPath(templateFile));
}
if (template == null) { template = ''; }
=======
>>>>>>> |
<<<<<<<
if(shell.notebook.controller.is_mine()) {
if(shell.notebook.model.read_only()) {
$('#revert-notebook').show();
$('#save-notebook').hide();
}
else {
$('#revert-notebook').hide();
$('#save-notebook').show();
}
}
else {
$('#revert-notebook,#save-notebook').hide();
}
=======
var fork_revert = $('#fork-revert-notebook');
var readonly_notebook = $("#readonly-notebook");
>>>>>>>
var readonly_notebook = $("#readonly-notebook");
if(shell.notebook.controller.is_mine()) {
if(shell.notebook.model.read_only()) {
$('#revert-notebook').show();
$('#save-notebook').hide();
}
else {
$('#revert-notebook').hide();
$('#save-notebook').show();
}
}
else {
$('#revert-notebook,#save-notebook').hide();
}
<<<<<<<
=======
fork_revert.text(shell.notebook.controller.is_mine() ? 'Revert' : 'Fork');
fork_revert.show();
readonly_notebook.show();
>>>>>>>
readonly_notebook.show();
<<<<<<<
=======
fork_revert.hide();
readonly_notebook.hide();
>>>>>>>
readonly_notebook.hide(); |
<<<<<<<
return rcloud.rename_notebook(gistname, newname).then(this.load_callback({is_change: true, selroot: true}));
=======
if (result && !/^\s+$/.test(result)) { // not null and not empty or just whitespace
rcloud.rename_notebook(gistname, newname, this.load_callback({is_change: true, selroot: true}));
return true;
}
else return false;
>>>>>>>
if (result && !/^\s+$/.test(result)) { // not null and not empty or just whitespace
rcloud.rename_notebook(gistname, newname).then(this.load_callback({is_change: true, selroot: true}));
return true;
}
else return false; |
<<<<<<<
rcloud.display.set_device_pixel_ratio = function() {
return rcloud_ocaps.set_device_pixel_ratioAsync(window.devicePixelRatio);
=======
var cached_device_pixel_ratio;
rcloud.display.set_device_pixel_ratio = function(k) {
cached_device_pixel_ratio = window.devicePixelRatio;
rcloud_ocaps.set_device_pixel_ratio(window.devicePixelRatio, k || _.identity);
>>>>>>>
var cached_device_pixel_ratio;
rcloud.display.set_device_pixel_ratio = function() {
cached_device_pixel_ratio = window.devicePixelRatio;
return rcloud_ocaps.set_device_pixel_ratioAsync(window.devicePixelRatio); |
<<<<<<<
ui_utils.install_common_ace_key_bindings(widget, function() {
return language;
});
widget.commands.addCommands([{
name: 'sendToR',
bindKey: {
win: 'Alt-Return',
mac: 'Alt-Return',
sender: 'editor'
},
exec: function(widget, args, request) {
execute_cell();
}
}]);
widget.commands.removeCommands(['find', 'replace']);
var change_content = ui_utils.ignore_programmatic_changes(widget, function() {
cell_model.parent_model.on_dirty();
});
=======
function clear_result() {
display_status("(no result)");
}
>>>>>>>
function clear_result() {
display_status("(no result)");
}
<<<<<<<
if(!cell_model.parent_model.prior_cell(cell_model))
join_button.hide();
else if(!am_read_only)
join_button.show();
},
change_highlights: function(ranges) {
if(widget) {
var markers = session.getMarkers();
for(var marker in markers) {
if(markers[marker].type === 'rcloud-select')
session.removeMarker(marker);
};
var Range = ace.require('ace/range').Range;
ranges.forEach(function(range) {
var begin = ui_utils.position_of_character_offset(widget, range.begin),
end = ui_utils.position_of_character_offset(widget, range.end);
var ace_range = new Range(begin.row, begin.column, end.row, end.column);
session.addMarker(ace_range, 'find-highlight', 'rcloud-select');
});
}
=======
above_between_controls_.betweenness(!!cell_model.parent_model.prior_cell(cell_model));
>>>>>>>
above_between_controls_.betweenness(!!cell_model.parent_model.prior_cell(cell_model));
},
change_highlights: function(ranges) {
if(widget) {
var markers = session.getMarkers();
for(var marker in markers) {
if(markers[marker].type === 'rcloud-select')
session.removeMarker(marker);
};
var Range = ace.require('ace/range').Range;
ranges.forEach(function(range) {
var begin = ui_utils.position_of_character_offset(widget, range.begin),
end = ui_utils.position_of_character_offset(widget, range.end);
var ace_range = new Range(begin.row, begin.column, end.row, end.column);
session.addMarker(ace_range, 'find-highlight', 'rcloud-select');
});
} |
<<<<<<<
var scratchpad_editor = $("#scratchpad-editor");
if (scratchpad_editor.length) {
setup_scratchpad(scratchpad_editor);
}
var first = true;
=======
make_cells_sortable();
>>>>>>>
var scratchpad_editor = $("#scratchpad-editor");
if (scratchpad_editor.length) {
setup_scratchpad(scratchpad_editor);
}
make_cells_sortable();
var first = true; |
<<<<<<<
var promises = []; // fetch and setup various ui "in parallel"
current_ = {notebook: result.id, version: options.version};
if(!options.tag) {
for(var i=0;i<result.history.length;i++) {
if(result.history[i].version === options.version) {
options.tag = result.history[i].tag;
}
}
}
=======
var tag;
var find_version = _.find(result.history, function(x) { return x.version === options.version; });
if(find_version)
tag = find_version.tag;
current_ = {notebook: result.id, version: options.version};
>>>>>>>
var promises = []; // fetch and setup various ui "in parallel"
current_ = {notebook: result.id, version: options.version};
var tag;
var find_version = _.find(result.history, function(x) { return x.version === options.version; });
if(find_version)
tag = find_version.tag; |
<<<<<<<
.filter({'is_started': true,
'organization_id': organizationId,
'is_archived': false}
)('left')
}
=======
.filter((row) =>
r.and(
row('right')('is_started').eq(true),
row('right')('organization_id').eq(organizationId),
row('right')('is_archived').eq(false)
)
)('left')
>>>>>>>
.filter({'is_started': true,
'organization_id': organizationId,
'is_archived': false}
)('left') |
<<<<<<<
=======
insert_cell_button.click(function(e) {
if (!$(e.currentTarget).hasClass("button-disabled")) {
shell.insert_cell_before(cell_model.language(), cell_model.id());
}
});
join_button.click(function(e) {
join_button.tooltip('destroy');
if (!$(e.currentTarget).hasClass("button-disabled")) {
shell.join_prior_cell(cell_model);
}
});
split_button.click(function(e) {
if (!$(e.currentTarget).hasClass("button-disabled")) {
var range = ace_widget_.getSelection().getRange();
var point1, point2;
point1 = ui_utils.character_offset_of_pos(ace_widget_, range.start);
if(!range.isEmpty())
point2 = ui_utils.character_offset_of_pos(ace_widget_, range.end);
shell.split_cell(cell_model, point1, point2);
}
});
edit_button.click(function(e) {
if (!$(e.currentTarget).hasClass("button-disabled")) {
result.edit_source(!edit_mode_);
}
});
remove_button.click(function(e) {
if (!$(e.currentTarget).hasClass("button-disabled")) {
cell_model.parent_model.controller.remove_cell(cell_model);
// twitter bootstrap gets confused about its tooltips if parent element
// is deleted while tooltip is active; let's help it
$(".tooltip").remove();
}
});
function execute_cell() {
display_status("Computing...");
result.edit_source(false);
RCloud.UI.with_progress(function() {
return cell_model.controller.execute();
});
}
run_md_button.click(function(e) {
execute_cell();
});
>>>>>>> |
<<<<<<<
checkEndpoint = 'updates.ghostchina.com',
currentVersion = packageInfo.version;
=======
checkEndpoint = 'updates.ghost.org',
currentVersion = config.ghostVersion;
>>>>>>>
checkEndpoint = 'updates.ghostchina.com',
currentVersion = config.ghostVersion; |
<<<<<<<
var hljs_classes_ = {
R: "r",
Python: "python"
};
=======
// the keys of the language map come from GitHub's language detection
// infrastructure which we don't control. (this is likely a bad thing)
// The values are the extensions we use for the gists.
var extensions_ = {
Text: 'txt'
};
>>>>>>>
// the keys of the language map come from GitHub's language detection
// infrastructure which we don't control. (this is likely a bad thing)
// The values are the extensions we use for the gists.
var extensions_ = {
Text: 'txt'
};
var hljs_classes_ = {
R: "r",
Python: "python"
};
<<<<<<<
hljs_class: function(language) {
return hljs_classes_[language] || null;
},
=======
extension: function(language) {
return extensions_[language];
},
>>>>>>>
extension: function(language) {
return extensions_[language];
},
hljs_class: function(language) {
return hljs_classes_[language] || null;
}, |
<<<<<<<
login: token + "\n" + execToken
=======
on_data: opts.on_data,
login: token + "\n" + token
>>>>>>>
on_data: opts.on_data,
login: token + "\n" + execToken |
<<<<<<<
that.set_status_message("Waiting...");
var snapshot = cell_model.get_execution_snapshot();
RCloud.UI.run_button.enqueue(
function() {
that.set_status_message("Computing...");
return cell_model.parent_model.controller.execute_cell_version(snapshot);
},
function() {
that.set_status_message("Cancelled!");
=======
var language = cell_model.language() || 'Text'; // null is a synonym for Text
function callback() {
// note: no result!
_.each(cell_model.parent_model.execution_watchers, function(ew) {
ew.run_cell(cell_model);
>>>>>>>
if(!execution_context_) {
var resulter = this.append_result.bind(this, 'code');
execution_context_ = {start: this.start_output.bind(this),
end: this.end_output.bind(this),
// these should convey the meaning e.g. through color:
out: resulter, err: resulter, msg: resulter,
html_out: this.append_result.bind(this, 'html'),
selection_out: this.append_result.bind(this, 'selection'),
in: this.get_input.bind(this, 'in')
};
}
var context_id = RCloud.register_output_context(execution_context_);
that.set_status_message("Waiting...");
that.edit_source(false);
var snapshot = cell_model.get_execution_snapshot();
RCloud.UI.run_button.enqueue(
function() {
that.set_status_message("Computing...");
return cell_model.parent_model.controller.execute_cell_version(context_id, snapshot);
},
function() {
that.set_status_message("Cancelled!");
<<<<<<<
=======
}
rcloud.record_cell_execution(cell_model);
if(!execution_context_) {
var resulter = this.append_result.bind(this, 'code');
execution_context_ = {start: this.start_output.bind(this),
end: this.end_output.bind(this),
// these should convey the meaning e.g. through color:
out: resulter, err: resulter, msg: resulter,
html_out: this.append_result.bind(this, 'html'),
selection_out: this.append_result.bind(this, 'selection'),
in: this.get_input.bind(this, 'in')
};
}
var context_id = RCloud.register_output_context(execution_context_);
var promise;
if (rcloud.authenticated) {
promise = rcloud.authenticated_cell_eval(context_id, cell_model.content(), language, false);
} else {
promise = rcloud.session_cell_eval(context_id,
Notebook.part_name(cell_model.id(),
cell_model.language()),
cell_model.language(),
false);
}
return promise.then(callback);
>>>>>>> |
<<<<<<<
=======
insert_cell_button.click(function(e) {
if (!$(e.currentTarget).hasClass("button-disabled")) {
shell.insert_cell_before(cell_model.language(), cell_model.id());
}
});
join_button.click(function(e) {
join_button.tooltip('destroy');
if (!$(e.currentTarget).hasClass("button-disabled")) {
shell.join_prior_cell(cell_model);
}
});
split_button.click(function(e) {
if (!$(e.currentTarget).hasClass("button-disabled")) {
var range = ace_widget_.getSelection().getRange();
var point1, point2;
point1 = ui_utils.character_offset_of_pos(ace_widget_, range.start);
if(!range.isEmpty())
point2 = ui_utils.character_offset_of_pos(ace_widget_, range.end);
shell.split_cell(cell_model, point1, point2);
}
});
edit_button.click(function(e) {
if (!$(e.currentTarget).hasClass("button-disabled")) {
result.edit_source(!edit_mode_);
}
});
remove_button.click(function(e) {
if (!$(e.currentTarget).hasClass("button-disabled")) {
cell_model.parent_model.controller.remove_cell(cell_model);
// twitter bootstrap gets confused about its tooltips if parent element
// is deleted while tooltip is active; let's help it
$(".tooltip").remove();
}
});
function execute_cell() {
display_status("Computing...");
result.edit_source(false);
RCloud.UI.with_progress(function() {
return cell_model.controller.execute();
});
}
run_md_button.click(function(e) {
execute_cell();
});
>>>>>>> |
<<<<<<<
rcloud.display.set_device_pixel_ratio = function() {
return rcloud_ocaps.set_device_pixel_ratioAsync(window.devicePixelRatio);
=======
var cached_device_pixel_ratio;
rcloud.display.set_device_pixel_ratio = function(k) {
cached_device_pixel_ratio = window.devicePixelRatio;
rcloud_ocaps.set_device_pixel_ratio(window.devicePixelRatio, k || _.identity);
>>>>>>>
var cached_device_pixel_ratio;
rcloud.display.set_device_pixel_ratio = function() {
cached_device_pixel_ratio = window.devicePixelRatio;
return rcloud_ocaps.set_device_pixel_ratioAsync(window.devicePixelRatio);
<<<<<<<
// FIXME make into promises
rcloud.upload_to_notebook = function(force, k) {
k = k || _.identity;
var on_success = function(v) { k(null, v); };
var on_failure = function(v) { k(v, null); };
=======
rcloud.upload_to_notebook = function(force, on_success, on_failure) {
on_success = on_success || _.identity;
on_failure = on_failure || _.identity;
>>>>>>>
// FIXME make into promises
rcloud.upload_to_notebook = function(force, k) {
k = k || _.identity;
var on_success = function(v) { k(null, v); };
var on_failure = function(v) { k(v, null); };
<<<<<<<
=======
// not awesome to callback to someone else here
k = k || editor.load_callback({is_change: true, selroot: true});
>>>>>>> |
<<<<<<<
.resize(params.width, params.height, params.resizeOption)
.toBuffer(this.image.getImageType(), (error, buffer) => {
=======
.resize(params.width, params.height)
.toBuffer(params.format || this.image.getImageType(), (error, buffer) => {
>>>>>>>
.resize(params.width, params.height, params.resizeOption)
.resize(params.width, params.height)
.toBuffer(params.format || this.image.getImageType(), (error, buffer) => { |
<<<<<<<
const rnInstall = await reactNative.install({ name })
=======
const rnInstall = await reactNative.install({ name, skipJest: true, version: REACT_NATIVE_VERSION })
>>>>>>>
const rnInstall = await reactNative.install({ name, version: REACT_NATIVE_VERSION }) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.