<commit_before>//__BEGIN_LICENSE__
//Copyright (c) 2015, United States Government, as represented by the
//Administrator of the National Aeronautics and Space Administration.
//All rights reserved.

//The xGDS platform is licensed under the Apache License, Version 2.0
//(the "License"); you may not use this file except in compliance with the License.
//You may obtain a copy of the License at
//http://www.apache.org/licenses/LICENSE-2.0.

//Unless required by applicable law or agreed to in writing, software distributed
//under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
//CONDITIONS OF ANY KIND, either express or implied. See the License for the
//specific language governing permissions and limitations under the License.
//__END_LICENSE__

//This simple javascript is called by tungsten replicator after it does an insertion.
//To test in your virtual machine, type
//rhino handle_data_insertion.js

//naive java implementation variant, if curl is not available
var prefix = 'http://localhost:8181';
var tableListUrl = '/xgds_core/rebroadcast/tableNamesAndKeys/'
var url = '/xgds_core/tungsten/dataInsert/';
var httpStatusOK = 200;
var colTypeInt = 4;
var colTypeString = 12;

var tableNamesAndKeys = {};
var getTableNamesAndKeys = function() {
    // TODO: Manage exceptions on HTTP GET
    resp = httpGet(prefix + tableListUrl);
    if (resp.statusCode == httpStatusOK) {   // Only process data if we get OK status code
        tableNamesStr = resp.data;
        tableNamesAndKeys = JSON.parse(tableNamesStr);
    }
    logger.info("TABLE LIST: " + tableNames);
    return tableNamesAndKeys;
}

function getMethods(obj) {
    var result = [];
    for (var id in obj) {
        try {
            result.push(id + ": " + obj[id].toString());
        } catch (err) {
            result.push(id + ": inaccessible");
        }
    }
    return result;
}

var prepare = function()
{
    getTableNamesAndKeys();
}

//Perform the filter process; function is called for each event in the THL

var filter= function(event)
{
    if (tableNamesAndKeys.keys().length == 0) {
        logger.info("NO TABLES IN LIST!");
        return;
    }
// Get the array of DBMSData objects
    data = event.getData();

    // Iterate over the individual DBMSData objects
    for(i=0;i<data.size();i++)
    {
      // Get a single DBMSData object
      d = data.get(i);

      // Process a Statement Event; event type is identified by comparing the object class type

      if (d instanceof com.continuent.tungsten.replicator.dbms.StatementData)
      {
        // Do statement processing
    	  logger.info('STATEMENT UPDATE:');
    	  logger.info('  ' + d.getQuery());
      }
      else if (d instanceof com.continuent.tungsten.replicator.dbms.RowChangeData)
      {
        // Get an array of all the row changes
        rows = data.get(i).getRowChanges();

        // Iterate over row changes
        for(j=0;j<rows.size();j++)
        {
        	// Get the single row change
        	rowchange = rows.get(j);

        	// Identify the row change type

        	logger.info(rowchange.getAction());
        	logger.info('TABLE NAME: ' + rowchange.getTableName());
        	var tableName = rowchange.getTableName();
        	var colSpecs = rowchange.getColumnSpec();
        	var idIndex = -1;
        	logger.info('COL SPEC SIZE: ' + colSpecs.size());

        	for (var c=0; c<colSpecs.size(); c++) {
        		logger.info(c);
        		logger.info(colSpecs.get(c));
        		var colName = colSpecs.get(c).getName();
        		var colLength = colSpecs.get(c).getLength();
        		logger.info('COL NAME: ' + colName + '(' + colLength +')');

        		if (colName == 'id'){
        			logger.info('COLUMN ID FOUND ');
        			idIndex = c;
        			break;
        		}
        	}

        	logger.info('ROW CHANGE ACTION: ' + rowchange.getAction());
        	var rowKeys = rowchange.getKeyValues();
        	var rowKeyTypes = rowchange.getKeySpec();
        	for (var i=0; i<rowKeys.size(); i++) {
        	    logger.info('ROW KEYS[' + i + ']: ' + rowKeys.get(i).get(0).getValue() + ' (' + rowKeyTypes.get(i).getTypeDescription() + ' - ' + rowKeyTypes.get(i).getIndex() + ')');
        	}
        	if (tableNamesAndKeys[tableName]){
        		var colValues = rowchange.getColumnValues();
        		logger.info("ROWS CHANGED: " + colValues.size());
        		for (var r=0; r<colValues.size(); r++) {
        			var foundPKValue = colValues.get(r).get(tableNamesAndKeys[tableName].pkColNum).getValue();
//        			var styleName = colValues.get(r).get(1).getValue();
//        			var styleColor = colValues.get(r).get(2).getValue();
        			logger.info('PK: ' + foundPKValue);
//        			logger.info('Style Name: ' + java.lang.String(styleName));
//        			logger.info('Style Color: ' + java.lang.String(styleColor));
        		}
        	}
        	//logger.info(rowchange.getColumnSpec());
        }
      }
    }
}

function doThings() {

	response = httpPost(prefix + url, data).data;

	logger.info('response: ' + response);
	var theResponse = JSON.parse(response);
	logger.info ('timestamp: ' + theResponse.timestamp);
	logger.info ('data: ' + theResponse.data);
}

function httpGet(theUrl){
	var con = new java.net.URL(theUrl).openConnection();
	con.requestMethod = "GET";
	return asResponse(con);
}

function httpPost(theUrl, data, contentType){
	var con = new java.net.URL(theUrl).openConnection();

	con.setRequestMethod("POST");

	var contentType = contentType || "application/json";
	con.setRequestProperty("Content-Type", contentType);

	con.setDoOutput(true);
	con.setDoInput(true);
	con.setAllowUserInteraction(false);
	logger.info('ABOUT TO POST:' + JSON.stringify(data));
	write(con.getOutputStream(), data);
	return asResponse(con);
}

function asResponse(con){
    var d = read(con.inputStream);
    return {data : d, statusCode : con.responseCode};
}

function write(outputStream, data){
	// either way seems to work but on the django side content is in request.body
	var wr = new java.io.OutputStreamWriter(outputStream);
	wr.write(JSON.stringify(data));
//	var wr = new java.io.DataOutputStream(outputStream);
//	wr.writeBytes(data);
	wr.flush();
	wr.close();
}

function read(inputStream){
	var inReader = new java.io.BufferedReader(new java.io.InputStreamReader(inputStream));
	var inputLine;
	var response = new java.lang.StringBuffer();

	while ((inputLine = inReader.readLine()) != null) {
		response.append(inputLine);
	}
	inReader.close();
	return response.toString();
}
<commit_msg>Fix typo<commit_after>//__BEGIN_LICENSE__
//Copyright (c) 2015, United States Government, as represented by the
//Administrator of the National Aeronautics and Space Administration.
//All rights reserved.

//The xGDS platform is licensed under the Apache License, Version 2.0
//(the "License"); you may not use this file except in compliance with the License.
//You may obtain a copy of the License at
//http://www.apache.org/licenses/LICENSE-2.0.

//Unless required by applicable law or agreed to in writing, software distributed
//under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
//CONDITIONS OF ANY KIND, either express or implied. See the License for the
//specific language governing permissions and limitations under the License.
//__END_LICENSE__

//This simple javascript is called by tungsten replicator after it does an insertion.
//To test in your virtual machine, type
//rhino handle_data_insertion.js

//naive java implementation variant, if curl is not available
var prefix = 'http://localhost:8181';
var tableListUrl = '/xgds_core/rebroadcast/tableNamesAndKeys/'
var url = '/xgds_core/tungsten/dataInsert/';
var httpStatusOK = 200;
var colTypeInt = 4;
var colTypeString = 12;

var tableNamesAndKeys = {};
var getTableNamesAndKeys = function() {
    // TODO: Manage exceptions on HTTP GET
    resp = httpGet(prefix + tableListUrl);
    if (resp.statusCode == httpStatusOK) {   // Only process data if we get OK status code
        tableNamesStr = resp.data;
        tableNamesAndKeys = JSON.parse(tableNamesStr);
    }
    logger.info("TABLE LIST: " + tableNamesAndKeys);
    return tableNamesAndKeys;
}

function getMethods(obj) {
    var result = [];
    for (var id in obj) {
        try {
            result.push(id + ": " + obj[id].toString());
        } catch (err) {
            result.push(id + ": inaccessible");
        }
    }
    return result;
}

var prepare = function()
{
    getTableNamesAndKeys();
}

//Perform the filter process; function is called for each event in the THL

var filter= function(event)
{
    if (tableNamesAndKeys.keys().length == 0) {
        logger.info("NO TABLES IN LIST!");
        return;
    }
// Get the array of DBMSData objects
    data = event.getData();

    // Iterate over the individual DBMSData objects
    for(i=0;i<data.size();i++)
    {
      // Get a single DBMSData object
      d = data.get(i);

      // Process a Statement Event; event type is identified by comparing the object class type

      if (d instanceof com.continuent.tungsten.replicator.dbms.StatementData)
      {
        // Do statement processing
    	  logger.info('STATEMENT UPDATE:');
    	  logger.info('  ' + d.getQuery());
      }
      else if (d instanceof com.continuent.tungsten.replicator.dbms.RowChangeData)
      {
        // Get an array of all the row changes
        rows = data.get(i).getRowChanges();

        // Iterate over row changes
        for(j=0;j<rows.size();j++)
        {
        	// Get the single row change
        	rowchange = rows.get(j);

        	// Identify the row change type

        	logger.info(rowchange.getAction());
        	logger.info('TABLE NAME: ' + rowchange.getTableName());
        	var tableName = rowchange.getTableName();
        	var colSpecs = rowchange.getColumnSpec();
        	var idIndex = -1;
        	logger.info('COL SPEC SIZE: ' + colSpecs.size());

        	for (var c=0; c<colSpecs.size(); c++) {
        		logger.info(c);
        		logger.info(colSpecs.get(c));
        		var colName = colSpecs.get(c).getName();
        		var colLength = colSpecs.get(c).getLength();
        		logger.info('COL NAME: ' + colName + '(' + colLength +')');

        		if (colName == 'id'){
        			logger.info('COLUMN ID FOUND ');
        			idIndex = c;
        			break;
        		}
        	}

        	logger.info('ROW CHANGE ACTION: ' + rowchange.getAction());
        	var rowKeys = rowchange.getKeyValues();
        	var rowKeyTypes = rowchange.getKeySpec();
        	for (var i=0; i<rowKeys.size(); i++) {
        	    logger.info('ROW KEYS[' + i + ']: ' + rowKeys.get(i).get(0).getValue() + ' (' + rowKeyTypes.get(i).getTypeDescription() + ' - ' + rowKeyTypes.get(i).getIndex() + ')');
        	}
        	if (tableNamesAndKeys[tableName]){
        		var colValues = rowchange.getColumnValues();
        		logger.info("ROWS CHANGED: " + colValues.size());
        		for (var r=0; r<colValues.size(); r++) {
        			var foundPKValue = colValues.get(r).get(tableNamesAndKeys[tableName].pkColNum).getValue();
//        			var styleName = colValues.get(r).get(1).getValue();
//        			var styleColor = colValues.get(r).get(2).getValue();
        			logger.info('PK: ' + foundPKValue);
//        			logger.info('Style Name: ' + java.lang.String(styleName));
//        			logger.info('Style Color: ' + java.lang.String(styleColor));
        		}
        	}
        	//logger.info(rowchange.getColumnSpec());
        }
      }
    }
}

function doThings() {

	response = httpPost(prefix + url, data).data;

	logger.info('response: ' + response);
	var theResponse = JSON.parse(response);
	logger.info ('timestamp: ' + theResponse.timestamp);
	logger.info ('data: ' + theResponse.data);
}

function httpGet(theUrl){
	var con = new java.net.URL(theUrl).openConnection();
	con.requestMethod = "GET";
	return asResponse(con);
}

function httpPost(theUrl, data, contentType){
	var con = new java.net.URL(theUrl).openConnection();

	con.setRequestMethod("POST");

	var contentType = contentType || "application/json";
	con.setRequestProperty("Content-Type", contentType);

	con.setDoOutput(true);
	con.setDoInput(true);
	con.setAllowUserInteraction(false);
	logger.info('ABOUT TO POST:' + JSON.stringify(data));
	write(con.getOutputStream(), data);
	return asResponse(con);
}

function asResponse(con){
    var d = read(con.inputStream);
    return {data : d, statusCode : con.responseCode};
}

function write(outputStream, data){
	// either way seems to work but on the django side content is in request.body
	var wr = new java.io.OutputStreamWriter(outputStream);
	wr.write(JSON.stringify(data));
//	var wr = new java.io.DataOutputStream(outputStream);
//	wr.writeBytes(data);
	wr.flush();
	wr.close();
}

function read(inputStream){
	var inReader = new java.io.BufferedReader(new java.io.InputStreamReader(inputStream));
	var inputLine;
	var response = new java.lang.StringBuffer();

	while ((inputLine = inReader.readLine()) != null) {
		response.append(inputLine);
	}
	inReader.close();
	return response.toString();
}
<|endoftext|>


<commit_before>'use strict';

module.exports = {

};<commit_msg>Added jasmine config for specs<commit_after>'use strict';

module.exports = {
  specNameMatcher: '_spec',
  projectRoot: ''
};
<|endoftext|>


<commit_before>
import React, { Component, PropTypes } from 'react';

import {
  StyleSheet,
  View,
  TabBarIOS,
  NavigatorIOS,
} from 'react-native';

import {
  TAB_MUSEUM,
  TAB_NEARME,
  TAB_STORIES,
} from '../actions/navigation';

import {
  PLAYER_STATUS_PLAY,
  PLAYER_STATUS_PAUSE,
} from '../actions/audio';

import Tutorial from '../containers/tutorial';
import NearMe from '../containers/nearMe';
import Everything from '../containers/everything';
import Museum from '../containers/museum';
import BottomPlayer from '../containers/bottomPlayer';

import { OFF_WHITE, TEAL, OFF_BLACK, TURQUOISE } from '../styles.js';

export const BOTTOMBARHEIGHT = 49;

const MUSEUM_REF = 'MUSEUM_REF';
const NEARME_REF = 'NEARME_REF';
const STORIES_REF = 'STORIES_REF';

const styles = StyleSheet.create({
  tabContent: {
    flex: 1,
    alignItems: 'center',
  },
  tabText: {
    color: 'white',
    margin: 50,
  },
  container: {
    flex: 1,
  },
});

class RootScreen extends Component {
  static propTypes = {
    beaconsNum: PropTypes.number.isRequired,
    currentAudioRoute: PropTypes.object,
    currentAudioTab: PropTypes.string,
    activeTab: PropTypes.string.isRequired,
    playerStatus: PropTypes.string.isRequired,
    actions: PropTypes.shape({
      togglePausePlay: PropTypes.func.isRequired,
      getScreenReaderStatus: PropTypes.func.isRequired,
      updateActiveTab: PropTypes.func.isRequired,
    }).isRequired,
  }

  componentDidMount() {
    this.props.actions.getScreenReaderStatus();
  }

  render() {
    return (
      <View
        style={styles.container}
        onMagicTap={() => {
          if (this.props.playerStatus === PLAYER_STATUS_PLAY ||
              this.props.playerStatus === PLAYER_STATUS_PAUSE) {
            this.props.actions.togglePausePlay();
          }
        }}
      >
        <Tutorial />
        <TabBarIOS
          translucent={false}
          barTintColor={TURQUOISE}
          unselectedTintColor={OFF_BLACK}
          tintColor={OFF_WHITE}
        >
        {/*
          renderAsOriginal and badge do not seem to play nice, with badge taking precedence.
          Untill the root cause of this issuie can be found modify the React Native lines:
          React/Views/RCTTabBarItem.m
          Line 88 and 99 from:
            if (_renderAsOriginal) {
          to:
            if (true) {
        */}
          <TabBarIOS.Item
            title="Near Me"
            renderAsOriginal={true}
            icon={require('../assets/nearTab.png')}
            selectedIcon={require('../assets/nearTabSelected.png')}
            badge={this.props.beaconsNum}
            selected={this.props.activeTab === TAB_NEARME}
            onPress={() => {
              if (this.props.activeTab === TAB_NEARME &&
                  this.refs.NEARME_REF != null) {
                this.refs.NEARME_REF.popToTop();
              }

              this.props.actions.updateActiveTab(TAB_NEARME);
            }}
          >
            <NavigatorIOS
              ref={NEARME_REF}
              style={styles.container}
              initialRoute={{
                title: 'Near Me',
                component: NearMe,
                navigationBarHidden: true,
                barTintColor: '#ffffff',
                tintColor: TEAL,
                titleTextColor: OFF_BLACK,
                shadowHidden: true,
              }}
            />
          </TabBarIOS.Item>
          <TabBarIOS.Item
            title="Stories"
            renderAsOriginal={true}
            icon={require('../assets/storiesTab.png')}
            selectedIcon={require('../assets/storiesTabSelected.png')}
            selected={this.props.activeTab === TAB_STORIES}
            onPress={() => {
              if (this.props.activeTab === TAB_STORIES &&
                  this.refs.STORIES_REF != null) {
                this.refs.STORIES_REF.popToTop();
                return;
              }

              this.props.actions.updateActiveTab(TAB_STORIES);
            }}
          >
            <NavigatorIOS
              ref={STORIES_REF}
              style={styles.container}
              initialRoute={{
                title: 'Stories',
                component: Everything,
                navigationBarHidden: true,
                barTintColor: '#ffffff',
                tintColor: TEAL,
                titleTextColor: OFF_BLACK,
                shadowHidden: true,
              }}
            />
          </TabBarIOS.Item>
          <TabBarIOS.Item
            title="The Warhol"
            renderAsOriginal={true}
            icon={require('../assets/warholTab.png')}
            selectedIcon={require('../assets/warholTabSelected.png')}
            selected={this.props.activeTab === TAB_MUSEUM}
            onPress={() => {
              if (this.props.activeTab === TAB_MUSEUM &&
                  this.refs.MUSEUM_REF != null) {
                this.refs.MUSEUM_REF.popToTop();
                return;
              }

              this.props.actions.updateActiveTab(TAB_MUSEUM);
            }}
          >
            <NavigatorIOS
              ref={MUSEUM_REF}
              style={styles.container}
              initialRoute={{
                title: 'The Warhol',
                component: Museum,
                navigationBarHidden: true,
                barTintColor: '#ffffff',
                tintColor: TEAL,
                titleTextColor: OFF_BLACK,
                shadowHidden: true,
              }}
            />
          </TabBarIOS.Item>
        </TabBarIOS>
        <BottomPlayer
          navToTourStop={() => {
            const targetRoute = this.props.currentAudioRoute;

            if (this.props.currentAudioTab === TAB_STORIES) {
              const navigator = this.refs.STORIES_REF.navigator;
              const storiesRoute = navigator.navigationContext.currentRoute;

              if (storiesRoute !== targetRoute) {
                try {
                  this.refs.STORIES_REF.popToRoute(targetRoute);
                } catch (err) {
                  this.refs.STORIES_REF.push(targetRoute);
                }
              }
            } else if (this.props.currentAudioTab === TAB_NEARME) {
              const navigator = this.refs.NEARME_REF.navigator;
              const nearmeRoute = navigator.navigationContext.currentRoute;

              if (nearmeRoute !== targetRoute) {
                try {
                  this.refs.NEARME_REF.popToRoute(targetRoute);
                } catch (err) {
                  this.refs.NEARME_REF.push(targetRoute);
                }
              }
            }

            if (this.props.activeTab !== this.props.currentAudioTab) {
              this.props.actions.updateActiveTab(this.props.currentAudioTab);
            }
          }}
        />
      </View>
    );
  }
}

export default RootScreen;
<commit_msg>Bug fix: Loading audio from a new tab pops the prev tab navigator back to root<commit_after>
import React, { Component, PropTypes } from 'react';

import {
  StyleSheet,
  View,
  TabBarIOS,
  NavigatorIOS,
} from 'react-native';

import {
  TAB_MUSEUM,
  TAB_NEARME,
  TAB_STORIES,
} from '../actions/navigation';

import {
  PLAYER_STATUS_PLAY,
  PLAYER_STATUS_PAUSE,
} from '../actions/audio';

import Tutorial from '../containers/tutorial';
import NearMe from '../containers/nearMe';
import Everything from '../containers/everything';
import Museum from '../containers/museum';
import BottomPlayer from '../containers/bottomPlayer';

import { OFF_WHITE, TEAL, OFF_BLACK, TURQUOISE } from '../styles.js';

export const BOTTOMBARHEIGHT = 49;

const MUSEUM_REF = 'MUSEUM_REF';
const NEARME_REF = 'NEARME_REF';
const STORIES_REF = 'STORIES_REF';

const styles = StyleSheet.create({
  tabContent: {
    flex: 1,
    alignItems: 'center',
  },
  tabText: {
    color: 'white',
    margin: 50,
  },
  container: {
    flex: 1,
  },
});

class RootScreen extends Component {
  static propTypes = {
    beaconsNum: PropTypes.number.isRequired,
    currentAudioRoute: PropTypes.object,
    currentAudioTab: PropTypes.string,
    activeTab: PropTypes.string.isRequired,
    playerStatus: PropTypes.string.isRequired,
    actions: PropTypes.shape({
      togglePausePlay: PropTypes.func.isRequired,
      getScreenReaderStatus: PropTypes.func.isRequired,
      updateActiveTab: PropTypes.func.isRequired,
    }).isRequired,
  }

  componentDidMount() {
    this.props.actions.getScreenReaderStatus();
  }

  componentDidUpdate(prevProps, prevState) {
    if (prevProps.currentAudioTab !== this.props.currentAudioTab) {
      if (prevProps.currentAudioTab === TAB_NEARME && this.refs.NEARME_REF != null) {
        this.refs.NEARME_REF.popToTop();
      }
      else if (prevProps.currentAudioTab === TAB_STORIES && this.refs.TAB_STORIES != null) {
        this.refs.TAB_STORIES.popToTop();
      }
    }
  }

  render() {
    return (
      <View
        style={styles.container}
        onMagicTap={() => {
          if (this.props.playerStatus === PLAYER_STATUS_PLAY ||
              this.props.playerStatus === PLAYER_STATUS_PAUSE) {
            this.props.actions.togglePausePlay();
          }
        }}
      >
        <Tutorial />
        <TabBarIOS
          translucent={false}
          barTintColor={TURQUOISE}
          unselectedTintColor={OFF_BLACK}
          tintColor={OFF_WHITE}
        >
        {/*
          renderAsOriginal and badge do not seem to play nice, with badge taking precedence.
          Untill the root cause of this issuie can be found modify the React Native lines:
          React/Views/RCTTabBarItem.m
          Line 88 and 99 from:
            if (_renderAsOriginal) {
          to:
            if (true) {
        */}
          <TabBarIOS.Item
            title="Near Me"
            renderAsOriginal={true}
            icon={require('../assets/nearTab.png')}
            selectedIcon={require('../assets/nearTabSelected.png')}
            badge={this.props.beaconsNum}
            selected={this.props.activeTab === TAB_NEARME}
            onPress={() => {
              if (this.props.activeTab === TAB_NEARME &&
                  this.refs.NEARME_REF != null) {
                this.refs.NEARME_REF.popToTop();
              }

              this.props.actions.updateActiveTab(TAB_NEARME);
            }}
          >
            <NavigatorIOS
              ref={NEARME_REF}
              style={styles.container}
              initialRoute={{
                title: 'Near Me',
                component: NearMe,
                navigationBarHidden: true,
                barTintColor: '#ffffff',
                tintColor: TEAL,
                titleTextColor: OFF_BLACK,
                shadowHidden: true,
              }}
            />
          </TabBarIOS.Item>
          <TabBarIOS.Item
            title="Stories"
            renderAsOriginal={true}
            icon={require('../assets/storiesTab.png')}
            selectedIcon={require('../assets/storiesTabSelected.png')}
            selected={this.props.activeTab === TAB_STORIES}
            onPress={() => {
              if (this.props.activeTab === TAB_STORIES &&
                  this.refs.STORIES_REF != null) {
                this.refs.STORIES_REF.popToTop();
                return;
              }

              this.props.actions.updateActiveTab(TAB_STORIES);
            }}
          >
            <NavigatorIOS
              ref={STORIES_REF}
              style={styles.container}
              initialRoute={{
                title: 'Stories',
                component: Everything,
                navigationBarHidden: true,
                barTintColor: '#ffffff',
                tintColor: TEAL,
                titleTextColor: OFF_BLACK,
                shadowHidden: true,
              }}
            />
          </TabBarIOS.Item>
          <TabBarIOS.Item
            title="The Warhol"
            renderAsOriginal={true}
            icon={require('../assets/warholTab.png')}
            selectedIcon={require('../assets/warholTabSelected.png')}
            selected={this.props.activeTab === TAB_MUSEUM}
            onPress={() => {
              if (this.props.activeTab === TAB_MUSEUM &&
                  this.refs.MUSEUM_REF != null) {
                this.refs.MUSEUM_REF.popToTop();
                return;
              }

              this.props.actions.updateActiveTab(TAB_MUSEUM);
            }}
          >
            <NavigatorIOS
              ref={MUSEUM_REF}
              style={styles.container}
              initialRoute={{
                title: 'The Warhol',
                component: Museum,
                navigationBarHidden: true,
                barTintColor: '#ffffff',
                tintColor: TEAL,
                titleTextColor: OFF_BLACK,
                shadowHidden: true,
              }}
            />
          </TabBarIOS.Item>
        </TabBarIOS>
        <BottomPlayer
          navToTourStop={() => {
            const targetRoute = this.props.currentAudioRoute;

            if (this.props.currentAudioTab === TAB_STORIES) {
              const navigator = this.refs.STORIES_REF.navigator;
              const storiesRoute = navigator.navigationContext.currentRoute;

              if (storiesRoute !== targetRoute) {
                try {
                  this.refs.STORIES_REF.popToRoute(targetRoute);
                } catch (err) {
                  this.refs.STORIES_REF.push(targetRoute);
                }
              }
            } else if (this.props.currentAudioTab === TAB_NEARME) {
              const navigator = this.refs.NEARME_REF.navigator;
              const nearmeRoute = navigator.navigationContext.currentRoute;

              if (nearmeRoute !== targetRoute) {
                try {
                  this.refs.NEARME_REF.popToRoute(targetRoute);
                } catch (err) {
                  this.refs.NEARME_REF.push(targetRoute);
                }
              }
            }

            if (this.props.activeTab !== this.props.currentAudioTab) {
              this.props.actions.updateActiveTab(this.props.currentAudioTab);
            }
          }}
        />
      </View>
    );
  }
}

export default RootScreen;
<|endoftext|>


<commit_before>// __BEGIN_LICENSE__
//Copyright (c) 2015, United States Government, as represented by the
//Administrator of the National Aeronautics and Space Administration.
//All rights reserved.
//
//The xGDS platform is licensed under the Apache License, Version 2.0
//(the "License"); you may not use this file except in compliance with the License.
//You may obtain a copy of the License at
//http://www.apache.org/licenses/LICENSE-2.0.
//
//Unless required by applicable law or agreed to in writing, software distributed
//under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
//CONDITIONS OF ANY KIND, either express or implied. See the License for the
//specific language governing permissions and limitations under the License.
// __END_LICENSE__

var options = {
        // target: '#output0', // target element(s) to be updated with
        // server response
        // beforeSubmit: showRequest, // pre-submit callback
        // success: showResponse, // post-submit callback

        // other available options:
        url: submitNoteUrl, // override for form's 'action' attribute
        type: 'post',       // 'get' or 'post', override for form's 'method' attribute
        dataType: 'json',   // 'xml', 'script', or 'json' (expected server response type)
        // clearForm: false // clear all form fields after successful submit
        // resetForm: true // reset the form after successful submit

        // $.ajax options can be used here too, for example:
        timeout: 3000
};

var check_image_url = 'url(' + STATIC_URL + 'xgds_video/images/check.png)';
var cross_image_url = 'url(' + STATIC_URL + 'xgds_video/images/cross.png)';

function showSuccess(errorMessage, index) {
    $('#error_content' + index).text(errorMessage);
    $('#error_image' + index).css('background', check_image_url);
    $('#error_div' + index).show();
}

function showError(errorMessage, index) {
    $('#error_content' + index).text(errorMessage);
    $('#error_image' + index).css('background', cross_image_url);
    $('#error_div' + index).show();
}

function hideError(index) {
    // $('#error_content').text('');
    $('#error_div' + index).hide();
}

/*
 * Form submission
 *
 */
$(function() {
    $('.noteSubmit').on('click', function(e) {
        var parent = $(this).closest('form');
        // get the index
        var index = parent.find('input#id_index').val();
        // validate and process form here
        var content_text = parent.find('input#id_content' + index);
        var content = content_text.val();

        hideError(index);
        var tagsId = 'input#id_tags' + index;
        var tagInput = parent.find(tagsId);
        var tags = tagInput.val();

        if (tags == '') {
            var addtag = parent.find('input#id_tags' + index + '_tag');
            // see if we have any contents in the tag that should be created as a tag
            if (addtag.val() != '' && addtag.val() != 'add a tag') {
                tagInput.addTag(addtag.val());
                tags = tagInput.val();
            }
        }
        if ((content == '') && (tags == '')) {
            content_text.focus();
            showError('Note must not be empty.', index);
            return false;
        }
        var extras = parent.find('input#id_extras').val();
        var dataString = 'content=' + content + '&tags=' + tags + '&extras=' + extras;
        // not live, pull the time out of the video
        var iso_string = '';
        if (isLive == false) {
            var event_time = getPlayerVideoTime(parent.find('input#source').val());
            iso_string = event_time.toISOString();
            iso_string = iso_string.replace('T', ' ');
            iso_string = iso_string.substring(0, 19);
            dataString = dataString + '&event_time=' + iso_string;
        } else {
            try {
                if (event_timestring !== undefined){
                    dataString = dataString + '&event_time=' + event_timestring;
                } else {
                    dataString = dataString + "&serverNow=true";
                }
            }
            catch(err) {
                dataString = dataString + "&serverNow=true";
            }
        }
        $.ajax({
            type: 'POST',
            url: submitNoteUrl,
            data: dataString,
            success: function(response) {
                showSuccess('Saved ' + content + ' ' + iso_string, index);
                content_text.val('');
                tagInput.importTags('');
            },
            error: function(jqXHR, textStatus, errorThrown) {
                if (errorThrown == '' && textStatus == 'error') {
                    showError('Lost server connection', index);
                } else {
                    showError(textStatus + ' ' + errorThrown, index);
                }
                console.log(jqXHR.getAllResponseHeaders());
            }

        });
        e.preventDefault();
    });
});

/*
 * // pre-submit callback function showRequest(formData, jqForm, options) { //
 * formData is an array; here we use $.param to convert it to a string to
 * display it // but the form plugin does this for you automatically when it
 * submits the data var queryString = $.param(formData); // jqForm is a jQuery
 * object encapsulating the form element. To access the // DOM element for the
 * form do this: // var formElement = jqForm[0];
 *
 * alert('About to submit: \n\n' + queryString); // here we could return false
 * to prevent the form from being submitted; // returning anything other than
 * false will allow the form submit to continue return true; }
 */

//post-submit callback
function showResponse(responseText, statusText, xhr, $form) {
    // for normal html responses, the first argument to the success callback
    // is the XMLHttpRequest object's responseText property

    // if the ajaxForm method was passed an Options Object with the dataType
    // property set to 'xml' then the first argument to the success callback
    // is the XMLHttpRequest object's responseXML property

    // if the ajaxForm method was passed an Options Object with the dataType
    // property set to 'json' then the first argument to the success callback
    // is the json data object returned by the server

    alert('status: ' + statusText + '\n\nresponseText: \n' + responseText +
    '\n\nThe output div should have already been updated with the responseText.');
}

function setupNotesUI(){
    var $noteElems = $(".noteinput");
    $noteElems.resizable();

    var $tagsElems = $(".tagsinput");
    $tagsElems.resizable();

}
<commit_msg>correctly take notes in delay and show time<commit_after>// __BEGIN_LICENSE__
//Copyright (c) 2015, United States Government, as represented by the
//Administrator of the National Aeronautics and Space Administration.
//All rights reserved.
//
//The xGDS platform is licensed under the Apache License, Version 2.0
//(the "License"); you may not use this file except in compliance with the License.
//You may obtain a copy of the License at
//http://www.apache.org/licenses/LICENSE-2.0.
//
//Unless required by applicable law or agreed to in writing, software distributed
//under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
//CONDITIONS OF ANY KIND, either express or implied. See the License for the
//specific language governing permissions and limitations under the License.
// __END_LICENSE__

var options = {
        // target: '#output0', // target element(s) to be updated with
        // server response
        // beforeSubmit: showRequest, // pre-submit callback
        // success: showResponse, // post-submit callback

        // other available options:
        url: submitNoteUrl, // override for form's 'action' attribute
        type: 'post',       // 'get' or 'post', override for form's 'method' attribute
        dataType: 'json',   // 'xml', 'script', or 'json' (expected server response type)
        // clearForm: false // clear all form fields after successful submit
        // resetForm: true // reset the form after successful submit

        // $.ajax options can be used here too, for example:
        timeout: 3000
};

var check_image_url = 'url(' + STATIC_URL + 'xgds_video/images/check.png)';
var cross_image_url = 'url(' + STATIC_URL + 'xgds_video/images/cross.png)';

function showSuccess(errorMessage, index) {
    $('#error_content' + index).text(errorMessage);
    $('#error_image' + index).css('background', check_image_url);
    $('#error_div' + index).show();
}

function showError(errorMessage, index) {
    $('#error_content' + index).text(errorMessage);
    $('#error_image' + index).css('background', cross_image_url);
    $('#error_div' + index).show();
}

function hideError(index) {
    // $('#error_content').text('');
    $('#error_div' + index).hide();
}

/*
 * Form submission
 *
 */
$(function() {
    $('.noteSubmit').on('click', function(e) {
        var parent = $(this).closest('form');
        // get the index
        var index = parent.find('input#id_index').val();
        // validate and process form here
        var content_text = parent.find('input#id_content' + index);
        var content = content_text.val();

        hideError(index);
        var tagsId = 'input#id_tags' + index;
        var tagInput = parent.find(tagsId);
        var tags = tagInput.val();

        if (tags == '') {
            var addtag = parent.find('input#id_tags' + index + '_tag');
            // see if we have any contents in the tag that should be created as a tag
            if (addtag.val() != '' && addtag.val() != 'add a tag') {
                tagInput.addTag(addtag.val());
                tags = tagInput.val();
            }
        }
        if ((content == '') && (tags == '')) {
            content_text.focus();
            showError('Note must not be empty.', index);
            return false;
        }
        var extras = parent.find('input#id_extras').val();
        var dataString = 'content=' + content + '&tags=' + tags + '&extras=' + extras;
        // not live, pull the time out of the video
        var iso_string = '';
        if (isLive == false) {
            var event_time = getPlayerVideoTime(parent.find('input#source').val());
            iso_string = event_time.toISOString();
            iso_string = iso_string.replace('T', ' ');
            iso_string = iso_string.substring(0, 19);
            dataString = dataString + '&event_time=' + iso_string;
        } else {
            try {
                if (event_timestring !== undefined){
                    dataString = dataString + '&event_time=' + event_timestring;
                } else {
                    dataString = dataString + "&serverNow=true";
                }
            }
            catch(err) {
                dataString = dataString + "&serverNow=true";
            }
        }
        $.ajax({
            type: 'POST',
            url: submitNoteUrl,
            data: dataString,
            success: function(response) {
                var printtime = iso_string;
                try {
                    printtime = response['event_time'];
                    m = moment(new Date(response['event_time']));
                    printtime = m.format("MM/DD/YYYY HH:mm:ss");
                } catch(err) {
                    // pass
                }
                showSuccess('Saved ' + content + ' ' + printtime, index);
                content_text.val('');
                tagInput.importTags('');
            },
            error: function(jqXHR, textStatus, errorThrown) {
                if (errorThrown == '' && textStatus == 'error') {
                    showError('Lost server connection', index);
                } else {
                    showError(textStatus + ' ' + errorThrown, index);
                }
                console.log(jqXHR.getAllResponseHeaders());
            }

        });
        e.preventDefault();
    });
});

/*
 * // pre-submit callback function showRequest(formData, jqForm, options) { //
 * formData is an array; here we use $.param to convert it to a string to
 * display it // but the form plugin does this for you automatically when it
 * submits the data var queryString = $.param(formData); // jqForm is a jQuery
 * object encapsulating the form element. To access the // DOM element for the
 * form do this: // var formElement = jqForm[0];
 *
 * alert('About to submit: \n\n' + queryString); // here we could return false
 * to prevent the form from being submitted; // returning anything other than
 * false will allow the form submit to continue return true; }
 */

//post-submit callback
function showResponse(responseText, statusText, xhr, $form) {
    // for normal html responses, the first argument to the success callback
    // is the XMLHttpRequest object's responseText property

    // if the ajaxForm method was passed an Options Object with the dataType
    // property set to 'xml' then the first argument to the success callback
    // is the XMLHttpRequest object's responseXML property

    // if the ajaxForm method was passed an Options Object with the dataType
    // property set to 'json' then the first argument to the success callback
    // is the json data object returned by the server

    alert('status: ' + statusText + '\n\nresponseText: \n' + responseText +
    '\n\nThe output div should have already been updated with the responseText.');
}

function setupNotesUI(){
    var $noteElems = $(".noteinput");
    $noteElems.resizable();

    var $tagsElems = $(".tagsinput");
    $tagsElems.resizable();

}
<|endoftext|>


<commit_before>'use strict';

/* Services */
angular.module('clinicico', []).
  value('version', '0.1').
  factory('clinicico.tasks', function ($q, $rootScope, $http) {
  // Bind config to window
  if(!angular.isDefined(window.clinicico)) {
    window.clinicico = {};
    window.clinicico.config = {};
    window.clinicico.config.baseUrl = "http://localhost:3000/tasks/";
  }

  var Task = function(method, data) {
    var self = this;
    var scope = $rootScope.$new(true);
    var resultsFuture = $q.defer();

    this.method = method;
    this.url = clinicico.config.baseUrl + method;
    this.results = resultsFuture.promise;
    this.lastStatus = null;

    this.on = function(eventName, callback) {
      scope.$on(eventName, function(e, data) {
        self.status = data;
        callback(data);
      });
    }

    /* Needed because WebSocket does not trigger
       a digest but $http does
       see https://coderwall.com/p/ngisma */
    scope.safeApply = function(fn) {
      var phase = this.$root.$$phase;
      if(phase == '$apply' || phase == '$digest') {
        if(fn && (typeof(fn) === 'function')) {
          fn();
        }
      } else {
        this.$apply(fn);
      }
    };

    function update(eventName, data) {
      scope.safeApply(function() {
        scope.$broadcast(eventName, data);
      });
      self.lastStatus = data;

      if(data.results) {
        angular.forEach(data._links, function(link) {
          if(link.rel === "results") {
            $http.jsonp(link.href + "?callback=JSON_CALLBACK").
              success(function(results) {
              scope.$broadcast("results", results);
              resultsFuture.resolve(results);
            }).
              error(function(data, status) {
              scope.$broadcast("error", data);
              resultsFuture.reject("Failed to fetch results" + status);
            });
          }
        });
      }
    }

    var __nonPoll = ["failed", "completed", "canceled"];
    var longPoll = function(url) {
      (function doPoll() {
        $http.get(url).success(function(data) {
          update("update", data);
          if(__nonPoll.indexOf(data.status) === -1) {
            doPoll();
          }
        });
      })();
    }

    var webSocket = function(url) {
      var socket = new WebSocket(url);

      socket.onmessage = function(event) {
        var data = angular.fromJson(event.data);
        if(__nonPoll.indexOf(data.status) !== -1) {
          socket.close();
        }
        update("update", data);
      };
    }

    $http.post(this.url, data)
    .success(function(data) {
      angular.forEach(data._links, function(link) {
        if(link.rel === "status") {
          if(window.WebSocket && link.websocket) {
            webSocket(link.websocket);
          } else {
            longPoll(link.href);
          }
        } else if (link.rel === "self") {
          $http.get(link.href).success(function(data) {
            update("update", data);
          });
        }
      });
    })
    .error(function(data, status) {
      scope.$broadcast("error", data);
      resultsFuture.reject("Failed to fetch results" + status);
    });
  }

  return {
    submit: function(method, data) { return new Task(method, data); }
  }
});
<commit_msg>More sensible loading of default configuration<commit_after>'use strict';

/* Services */
angular.module('clinicico', []).
  value('version', '0.1').
  factory('clinicico.tasks', function ($q, $rootScope, $http) {

  var clinicico = {};
  // Load default config if none found
  if(!angular.isDefined(window.clinicico)) {
    clinicico = angular.extend(clinicico, { config: { baseUrl: "http://localhost:3000/tasks/" } })
  } else {
    clinicico = window.clinicico;
  }

  var Task = function(method, data) {
    var self = this;
    var scope = $rootScope.$new(true);
    var resultsFuture = $q.defer();

    this.method = method;
    this.url = clinicico.config.baseUrl + method;
    this.results = resultsFuture.promise;
    this.lastStatus = null;

    this.on = function(eventName, callback) {
      scope.$on(eventName, function(e, data) {
        self.status = data;
        callback(data);
      });
    }

    /* Needed because WebSocket does not trigger
       a digest but $http does
       see https://coderwall.com/p/ngisma */
    scope.safeApply = function(fn) {
      var phase = this.$root.$$phase;
      if(phase == '$apply' || phase == '$digest') {
        if(fn && (typeof(fn) === 'function')) {
          fn();
        }
      } else {
        this.$apply(fn);
      }
    };

    function update(eventName, data) {
      scope.safeApply(function() {
        scope.$broadcast(eventName, data);
      });
      self.lastStatus = data;

      if(data.results) {
        angular.forEach(data._links, function(link) {
          if(link.rel === "results") {
            $http.jsonp(link.href + "?callback=JSON_CALLBACK").
              success(function(results) {
              scope.$broadcast("results", results);
              resultsFuture.resolve(results);
            }).
              error(function(data, status) {
              scope.$broadcast("error", data);
              resultsFuture.reject("Failed to fetch results" + status);
            });
          }
        });
      }
    }

    var __nonPoll = ["failed", "completed", "canceled"];
    var longPoll = function(url) {
      (function doPoll() {
        $http.get(url).success(function(data) {
          update("update", data);
          if(__nonPoll.indexOf(data.status) === -1) {
            doPoll();
          }
        });
      })();
    }

    var webSocket = function(url) {
      var socket = new WebSocket(url);

      socket.onmessage = function(event) {
        var data = angular.fromJson(event.data);
        if(__nonPoll.indexOf(data.status) !== -1) {
          socket.close();
        }
        update("update", data);
      };
    }

    $http.post(this.url, data)
    .success(function(data) {
      angular.forEach(data._links, function(link) {
        if(link.rel === "status") {
          if(window.WebSocket && link.websocket) {
            webSocket(link.websocket);
          } else {
            longPoll(link.href);
          }
        } else if (link.rel === "self") {
          $http.get(link.href).success(function(data) {
            update("update", data);
          });
        }
      });
    })
    .error(function(data, status) {
      scope.$broadcast("error", data);
      resultsFuture.reject("Failed to fetch results" + status);
    });
  }

  return {
    submit: function(method, data) { return new Task(method, data); }
  }
});
<|endoftext|>


<commit_before>import { computed } from '@ember/object'; // eslint-disable-line
import FacilitiesSection from './facilities-section';
import carto from '../utils/carto';

const SQL = 'SELECT *, LEFT(zonedist, 2) as primaryzone FROM support_zoning_zd';
const zdConfig = {
  id: 'zoning',
  type: 'fill',
  source: 'zoning',
  'source-layer': 'layer0',
  paint: {
    'fill-color': {
      property: 'primaryzone',
      type: 'categorical',
      stops: [
        ['BP', '#666666'],
        ['C1', '#ff0000'],
        ['C2', '#ff0000'],
        ['C3', '#ff0000'],
        ['C4', '#ff0000'],
        ['C5', '#ff0000'],
        ['C6', '#ff0000'],
        ['C7', '#ff0000'],
        ['C8', '#ff0000'],
        ['M1', '#E362FB'],
        ['M2', '#E362FB'],
        ['M3', '#E362FB'],
        ['PA', '#78D271'],
        ['R1', '#F2F618'],
        ['R2', '#F2F618'],
        ['R3', '#F2F618'],
        ['R4', '#F2F618'],
        ['R5', '#F2F618'],
        ['R6', '#F2F618'],
        ['R7', '#F2F618'],
        ['R8', '#F2F618'],
        ['R9', '#F2F618'],
      ],
    },
    'fill-opacity': 0.4,
    'fill-antialias': true,
    'fill-outline-color': '#444',
  },
};

const paint = {
  labels: {
    'text-color': '#626262',
    'text-halo-color': '#FFFFFF',
    'text-halo-width': 2,
    'text-halo-blur': 2,
  },
  co_labels: {
    'text-color': 'rgba(255, 0, 0, 1)',
    'text-halo-color': '#FFFFFF',
    'text-halo-width': 2,
    'text-halo-blur': 2,
  },
};

const zdLabelConfig = {
  id: 'zd_labels',
  source: 'zoning',
  type: 'symbol',
  'source-layer': 'layer0',
  paint: paint.labels,
  layout: {
    'symbol-placement': 'point',
    'text-field': '{zonedist}',
    'text-size': {
      stops: [
        [
          10,
          8,
        ],
        [
          14,
          16,
        ],
      ],
    },
  },
  minzoom: 12,
};

export default FacilitiesSection.extend({
  vectorSource: computed('zoningTemplate', function () {
    return carto.getVectorTileTemplate([SQL])
      .then(zoningTemplate => ({
        type: 'vector',
        tiles: [zoningTemplate],
      }));
  }),

  fitBoundsOptions: {
    linear: true,
    duration: 0,
  },

  pointsLayer: zdConfig,

  zoningLabelsLayer: zdLabelConfig,

  actions: {
    handleMouseover(e) {
      const feature = e.target.queryRenderedFeatures(e.point, { layers: ['zoning'] })[0];

      if (feature) {
        const { primaryzone } = feature.properties;
        e.target.getCanvas().style.cursor = 'pointer';
        this.set('mouseoverLocation', {
          x: e.point.x + 30,
          y: e.point.y,
        });
        this.set('tooltip-text', `${primaryzone}`);
      } else {
        e.target.getCanvas().style.cursor = '';
        this.set('mouseoverLocation', null);
      }
    },
  },
});
<commit_msg>764: use aliased view for zoning on carto<commit_after>import { computed } from '@ember/object'; // eslint-disable-line
import FacilitiesSection from './facilities-section';
import carto from '../utils/carto';

const SQL = 'SELECT *, LEFT(zonedist, 2) as primaryzone FROM zoning_districts';
const zdConfig = {
  id: 'zoning',
  type: 'fill',
  source: 'zoning',
  'source-layer': 'layer0',
  paint: {
    'fill-color': {
      property: 'primaryzone',
      type: 'categorical',
      stops: [
        ['BP', '#666666'],
        ['C1', '#ff0000'],
        ['C2', '#ff0000'],
        ['C3', '#ff0000'],
        ['C4', '#ff0000'],
        ['C5', '#ff0000'],
        ['C6', '#ff0000'],
        ['C7', '#ff0000'],
        ['C8', '#ff0000'],
        ['M1', '#E362FB'],
        ['M2', '#E362FB'],
        ['M3', '#E362FB'],
        ['PA', '#78D271'],
        ['R1', '#F2F618'],
        ['R2', '#F2F618'],
        ['R3', '#F2F618'],
        ['R4', '#F2F618'],
        ['R5', '#F2F618'],
        ['R6', '#F2F618'],
        ['R7', '#F2F618'],
        ['R8', '#F2F618'],
        ['R9', '#F2F618'],
      ],
    },
    'fill-opacity': 0.4,
    'fill-antialias': true,
    'fill-outline-color': '#444',
  },
};

const paint = {
  labels: {
    'text-color': '#626262',
    'text-halo-color': '#FFFFFF',
    'text-halo-width': 2,
    'text-halo-blur': 2,
  },
  co_labels: {
    'text-color': 'rgba(255, 0, 0, 1)',
    'text-halo-color': '#FFFFFF',
    'text-halo-width': 2,
    'text-halo-blur': 2,
  },
};

const zdLabelConfig = {
  id: 'zd_labels',
  source: 'zoning',
  type: 'symbol',
  'source-layer': 'layer0',
  paint: paint.labels,
  layout: {
    'symbol-placement': 'point',
    'text-field': '{zonedist}',
    'text-size': {
      stops: [
        [
          10,
          8,
        ],
        [
          14,
          16,
        ],
      ],
    },
  },
  minzoom: 12,
};

export default FacilitiesSection.extend({
  vectorSource: computed('zoningTemplate', function () {
    return carto.getVectorTileTemplate([SQL])
      .then(zoningTemplate => ({
        type: 'vector',
        tiles: [zoningTemplate],
      }));
  }),

  fitBoundsOptions: {
    linear: true,
    duration: 0,
  },

  pointsLayer: zdConfig,

  zoningLabelsLayer: zdLabelConfig,

  actions: {
    handleMouseover(e) {
      const feature = e.target.queryRenderedFeatures(e.point, { layers: ['zoning'] })[0];

      if (feature) {
        const { primaryzone } = feature.properties;
        e.target.getCanvas().style.cursor = 'pointer';
        this.set('mouseoverLocation', {
          x: e.point.x + 30,
          y: e.point.y,
        });
        this.set('tooltip-text', `${primaryzone}`);
      } else {
        e.target.getCanvas().style.cursor = '';
        this.set('mouseoverLocation', null);
      }
    },
  },
});
<|endoftext|>


<commit_before>/*
 *
 * Home
 *
 */

import React from 'react';
import Helmet from 'react-helmet';
import {Link} from 'react-router';
import Responsive from 'react-responsive';
import NavLeft from 'material-ui/svg-icons/navigation/chevron-left';
import NavRight from 'material-ui/svg-icons/navigation/chevron-right';
import NavUp from 'material-ui/svg-icons/navigation/expand-less';
import NavDown from 'material-ui/svg-icons/navigation/expand-more';
import MoreOver from 'material-ui/svg-icons/navigation/more-horiz';
import MoreUp from 'material-ui/svg-icons/navigation/more-vert';
import BurgerMenu from 'material-ui/svg-icons/navigation/menu';

export default class Home extends React.PureComponent

{
  render() {
    const navStyle={
      border: "1px solid #bbbbbb",
      borderRadius:"5px",
      display: "flex",
      flexDirection: "row",
      justifyContent: "space-around",
      position:"fixed",
      width:"100%",
      zIndex:"99999",

    }

    const mobileNav={
      border: "1px solid #bbbbbb",
      borderRadius:"5px",
      display: "flex",
      flexDirection: "row",
      justifyContent: "space-around",
      position:"fixed",
      width:"100%",
      background:"rgb(0, 0, 0, .0",
      zIndex:"99999",

    }

    const linkStyleM={
      textDecoration:"none",
      color:"#ffffff",
      fontSize:"1.6em",
      fontFamily:"'Squada One', cursive",

    }

    const linkStyle={
      textDecoration:"none",
      color:"#ffffff",
      fontSize:"45px",
      fontFamily:"'Squada One', cursive",

    }

    const container={
      background:"url(http://www.studiorussophotography.com/img/s/v-2/p693323167-5.jpg)",
      minHeight:"100vh",
      backgroundSize:"cover",
      backgroundPosition:"center center",
      backgroundAttachment:"scroll",
      display:"block",

    }

    const vidScreen={
      position:"relative"

    }

    const NavLeftStyle={
      color:"#c0c0c0",
      position:"absolute",
      top:"50%",
      width:"64px",
      height:"64px",
      left:"0px",
    }

    const NavRightStyle={
      color:"#c0c0c0",
      position:"absolute",
      top:"50%",
      width:"64px",
      height:"64px",
      right:"0px"

    }

    const NavUpStyle={
      color:"#ffffff",
    }

    const NavDownStyle={
      color:"#ffffff",
    }

    const MoreOverStyle={
      color:"#c0c0c0",
      position:"absolute",
      bottom:"30px",
      width:"100%",
      height:"70px"

    }

    const MoreUpStyle={
      color:"#ffffff",
    }

    const burgerMenuStyleM={
      color:"#c0c0c0",
      position:"absolute",
      height:"50px",
      width:"60px",
      top:"0",
      left:"0",
      margin:"auto"

    }

    const NavLeftStyleM={
      color:"#c0c0c0",
      position:"absolute",
      top:"50%",
      width:"64px",
      height:"64px",
      left:"1em"
    }

    const NavRightStyleM={
      color:"#ffffff",
      position:"absolute",
      top:"50%",
      width:"64px",
      height:"64px",
      right:"1em"
    }

    const MoreOverStyleM={
      color:"#c0c0c0",
      position:"absolute",
      bottom:"5px",
      width:"100%",
      height:"40px"

    }

    const articleStyle={
      boxSizing:"content-box",
      marginTop:"0.7em",

    }

    const pStyle={
      color:"#ffffff",
      fontSize:"45px",
      fontFamily:"'Squada One', cursive",
      bottom:"auto",

    }

    const vidStyle={
      position:"relative",
      bottom:"20px"
    }

    return (

        <Helmet title="Home" meta={[ { name: 'description', content: 'Description of Home' }]}/>

        <Responsive minDeviceWidth={1024}>

            <Link style={linkStyle} to= '/media'>Media </Link>
            <Link style={linkStyle} to= '/'> Home </Link>
            <Link style={linkStyle} to= '/tour'>Tour </Link>
            <Link style={linkStyle} to= '/shop'>Shop </Link>

        </Responsive>
        <Responsive maxDeviceWidth={1023}>

        </Responsive>

          <Responsive minDeviceWidth={1024}>
          </Responsive>
          <Responsive maxDeviceWidth={1023}>
          </Responsive>

         <Responsive minDeviceWidth={1024}>

            <NavLeft style={NavLeftStyle}/>
            <NavRight style={NavRightStyle}/>
            <NavUp style={NavUpStyle}/>
            <NavDown style={NavDownStyle}/>
            <MoreOver style={MoreOverStyle}/>

        </Responsive>
        <Responsive maxDeviceWidth={1023}>

           <NavLeft style={NavLeftStyleM}/>
           <NavRight style={NavRightStyleM}/>
           <MoreOver style={MoreOverStyleM}/>
           <BurgerMenu style={burgerMenuStyleM}/>

        </Responsive>

     );
   }
  }
<commit_msg>Added article and video. Updated bkgd image<commit_after>/*
 *
 * Home
 *
 */

import React from 'react';
import Helmet from 'react-helmet';
import {Link} from 'react-router';
import Responsive from 'react-responsive';
import NavLeft from 'material-ui/svg-icons/navigation/chevron-left';
import NavRight from 'material-ui/svg-icons/navigation/chevron-right';
import NavUp from 'material-ui/svg-icons/navigation/expand-less';
import NavDown from 'material-ui/svg-icons/navigation/expand-more';
import MoreOver from 'material-ui/svg-icons/navigation/more-horiz';
import MoreUp from 'material-ui/svg-icons/navigation/more-vert';
import BurgerMenu from 'material-ui/svg-icons/navigation/menu';

export default class Home extends React.PureComponent

{
  render() {
    const navStyle={
      border: "1px solid #bbbbbb",
      borderRadius:"5px",
      display: "flex",
      flexDirection: "row",
      justifyContent: "space-around",
      position:"fixed",
      width:"100%",
      zIndex:"99999",

    }

    const mobileNav={
      border: "1px solid #bbbbbb",
      borderRadius:"5px",
      display: "flex",
      flexDirection: "row",
      justifyContent: "space-around",
      position:"fixed",
      width:"100%",
      background:"rgb(0, 0, 0, .0",
      zIndex:"99999",

    }

    const linkStyleM={
      textDecoration:"none",
      color:"#ffffff",
      fontSize:"1.6em",
      fontFamily:"'Squada One', cursive",

    }

    const linkStyle={
      textDecoration:"none",
      color:"#ffffff",
      fontSize:"45px",
      fontFamily:"'Squada One', cursive",

    }

    const background={
      color:"#000000",

    }

    const NavLeftStyle={
      color:"#c0c0c0",
      position:"absolute",
      top:"50%",
      width:"64px",
      height:"64px",
      left:"0px",
    }

    const NavRightStyle={
      color:"#c0c0c0",
      position:"absolute",
      top:"50%",
      width:"64px",
      height:"64px",
      right:"0px"

    }

    const NavUpStyle={
      color:"#ffffff",
    }

    const NavDownStyle={
      color:"#ffffff",
    }

    const MoreOverStyle={
      color:"#c0c0c0",
      position:"absolute",
      bottom:"30px",
      width:"100%",
      height:"70px"

    }

    const MoreUpStyle={
      color:"#ffffff",
    }

    const burgerMenuStyleM={
      color:"#c0c0c0",
      position:"fixed",
      height:"50px",
      width:"60px",
      top:"25",
      left:"0",
      margin:"auto",

    }

    const NavLeftStyleM={
      color:"#c0c0c0",
      position:"fixed",
      top:"50%",
      width:"64px",
      height:"64px",
      left:"1em"
    }

    const NavRightStyleM={
      color:"#ffffff",
      position:"fixed",
      top:"50%",
      width:"64px",
      height:"64px",
      right:"1em"
    }

    const MoreOverStyleM={
      color:"#c0c0c0",
      position:"absolute",
      bottom:"5px",
      width:"100%",
      height:"40px"

    }

    const articleStyle={
      boxSizing:"content-box",
      marginTop:"0.7em",

    }

    const bannerStyle={
      backgroundImage:"url(http://www.studiorussophotography.com/img/s/v-2/p693323167-5.jpg",
      minHeight:"100vh",
      backgroundSize:"cover",
      backgroundPosition:"center center",
      backgroundAttachment:"scroll",
      display:"block",
    }

    const pStyle={
      color:"#330000",
      fontSize:"18px",
      fontFamily:"'Squada One', cursive",
      padding:"15px",
      paddingLeft:"15px",
      paddingRight:"15px",

    }

    const span={
      color:"000000",
      fontSize:"25px",
      fontFamily:"'Squada One', cursive",
      padding:"15px",
      paddingLeft:"15px",
      paddingRight:"15px",
    }

    const vidScreen={
      position:"relative"

    }

    return (

        <Helmet title="Home" meta={[ { name: 'description', content: 'Description of Home' }]}/>

        <Responsive minDeviceWidth={1024}>

            <Link style={linkStyle} to= '/media'>Media </Link>
            <Link style={linkStyle} to= '/'> Home </Link>
            <Link style={linkStyle} to= '/tour'>Tour </Link>
            <Link style={linkStyle} to= '/shop'>Shop </Link>

        </Responsive>
        <Responsive maxDeviceWidth={1023}>

        </Responsive>

          <Responsive minDeviceWidth={1024}>
          </Responsive>
          <Responsive maxDeviceWidth={1023}>
          </Responsive>

         <Responsive minDeviceWidth={1024}>

            <NavLeft style={NavLeftStyle}/>
            <NavRight style={NavRightStyle}/>
            <NavUp style={NavUpStyle}/>
            <NavDown style={NavDownStyle}/>
            <MoreOver style={MoreOverStyle}/>

        </Responsive>
        <Responsive maxDeviceWidth={1023}>

           <NavLeft style={NavLeftStyleM}/>
           <NavRight style={NavRightStyleM}/>
           <MoreOver style={MoreOverStyleM}/>
           <BurgerMenu style={burgerMenuStyleM}/>

        </Responsive>

George Ball, Vietnam veteran of 1967-69. Also known as History Man, the Athens Bird.
        I witnessed firsthand the Bird glide out of his wheelchair like he’d just been brushed by the hems  of Jesus Christ, and WALTZ over to the owner of Knuckle Sandwiches and say “Scuse me sir, can a old nigga please get  a sandwich – FOR FREE?!”

History Man, the Athens Bird.  A Broad Street miracle. He told me he wrote a newsletter and gave me a copy to take for myself. It was a single sheet of white paper that looked to be covered in pen illustrations and gibberish. Upon closer inspection, it was a Xeroxed copy of another piece of paper that was covered in pen illustrations and gibberish. Some of the sentences ran over to the opposite side of the paper and some of them were written in the margins perpendicular to others. Hand drawn borders and underlines divided the different sections of the newsletter into barely decipherable nuggets of meaninglessness.

The illustration was a stick figure drawing of a bird. Written at the top center of the page, I took it as the brand icon and letterhead and started there. As best as a mere human could possibly do, I will try to relay what I was shown. Dear reader, I cannot make this shit up:

ATHENS Bird is not feeling at his best and he and his History Man are citizens of Athens, Clarke   County, Georgia is requesting all concern people of this town Classic City, which mean Learning to call  endandger missing person hotline or call the Clarke County Sheriff Ira Edward Jr or Police Chief Jackie Lumpkin of any news of Mayflower Restaurant employee Della an yellow skin, 5-7’ 130 LB Female that is missing fer over 9 months.

Terry Lynn Hunter, my second cusion, is also dead and Mr. Colling also and first a female Caucasian girl was Jimmy first Athens KILL AND Jimmy was boyfriend to all four girls. He was living on Farview with bad apple Tommy Brown and now its said he cut off his ankle brace and left town . Chicago, South Carolina was said he come from.

Athens Bird was told that Jimmy say he buries women where no one can find them. I was said that he receive $150,000 from his uncle and left dodoe as meaning left town.

The paper, as you can see, had tidbits on local crime, as well as a ticker for social and cultural   happenings and commentary: Pretty progressive layout for a down on his luck, hungry as shit Vietnam veteran   with no legs. But who am I to lay standards?

Pop the black man fly that homeless sign to get crack money. Mike that draw bulldog on crack. Lizziemae the black girl on crack.
        The Caucasian white female is being pimp by her boyfriend in front of Herry Clothes Closet for change...

Giving those so call homeless people money you are causing strokes, seizures to them as paramedic can prove treating them several times they are on crack whisky.

There are seven Caucasian females living alone and I have observe one black one white male both muscle around 6’1 240-260 lbs. Knocking on their door and coming from around their apartment and even the black guy was sitting on the porch and the first murder of a Caucasian female haven’t even been found out. The surspected killer probley running afraid and thanks to his daddy power he getting away more on that story in the next edition look for it.

I’m still looking for it.

     );
   }
  }
<|endoftext|>


<commit_before>//initializes and maintains phaser game instance

angular.module('app.game', [])

.controller('GameController', ['$scope', '$state', 'requestNotificationChannel', 'Panel', 'Puzzle',
  function($scope, $state, requestNotificationChannel, Panel, Puzzle) {

    // Initializes game
    var game = new Phaser.Game(
      800, 533,
      Phaser.AUTO,
      'game_canvas');

    // Main game state, container to pass angular modules between states
    var Main = function(){
      this.game = game;
      this.puzzle = Puzzle;
      this.panel = Panel;
      this.requestNotificationChannel = requestNotificationChannel;
    };

    Main.prototype = {

      // Preload scripts, mandatory, ASYNC
      preload: function() {
        game.load.image('stars',    'assets/images/stars.jpg');
        game.load.image('loading',  'assets/images/loading.png');
        game.load.image('brand',    'assets/images/logo.png');
        game.load.script('utils',   'utils/utils.js');
        game.load.script('style',    'utils/style.js');
        game.load.script('splash',  'gamestates/splash.js');
      },

      // Route to Splash state
      create: function(){
        game.state.add('Splash', Splash);
        game.state.start('Splash');
      }

    };

    // Starts up main state as the first state
    game.state.add('Main', Main);
    game.state.start('Main');
  }
]);
<commit_msg>indent clean up<commit_after>//initializes and maintains phaser game instance

angular.module('app.game', [])

.controller('GameController', ['$scope', '$state', 'requestNotificationChannel', 'Panel', 'Puzzle',
  function($scope, $state, requestNotificationChannel, Panel, Puzzle) {

    // Initializes game
    var game = new Phaser.Game(
      800, 533,
      Phaser.AUTO,
      'game_canvas');

    // Main game state, container to pass angular modules between states
    var Main = function(){
      this.game = game;
      this.puzzle = Puzzle;
      this.panel = Panel;
      this.requestNotificationChannel = requestNotificationChannel;
    };

    Main.prototype = {

      // Preload scripts, mandatory, ASYNC
      preload: function() {
        game.load.image('stars',    'assets/images/stars.jpg');
        game.load.image('loading',  'assets/images/loading.png');
        game.load.image('brand',    'assets/images/logo.png');
        game.load.script('utils',   'utils/utils.js');
        game.load.script('style',    'utils/style.js');
        game.load.script('splash',  'gamestates/splash.js');
      },

      // Route to Splash state
      create: function(){
        game.state.add('Splash', Splash);
        game.state.start('Splash');

      }

    };

    // Starts up main state as the first state
    game.state.add('Main', Main);
    game.state.start('Main');
  }
]);
<|endoftext|>


<commit_before>var express = require('express')
var config = require('../../../config/config')
var sendgrid = require('sendgrid')(config.sendgrid.apikey)

module.exports = function() {
  var router = express.Router()

  router.post('/', function(req, res, next) {
    var queries = req.body
    var fromEmail = queries.fromEmail
    var html = '
' + queries.content + '
'
    var subject = '고위공직자 재산 공개 - ' + queries.type

    var email = new sendgrid.Email({
      to:       'hoonch3@gmail.com',
      from:     fromEmail,
      subject:  subject,
      html:     html
    })

    return sendgrid.send(email, function(err, json) {
      if (err) { return res.json(err); }
      return res.json(json)
    })
  })

  return router
}
<commit_msg>change email account<commit_after>var express = require('express')
var config = require('../../../config/config')
var sendgrid = require('sendgrid')(config.sendgrid.apikey)

module.exports = function() {
  var router = express.Router()

  router.post('/', function(req, res, next) {
    var queries = req.body
    var fromEmail = queries.fromEmail
    var html = '
' + queries.content + '
'
    var subject = '고위공직자 재산 공개 - ' + queries.type

    var email = new sendgrid.Email({
      to:       'data@codenamu.org',
      from:     fromEmail,
      subject:  subject,
      html:     html
    })

    return sendgrid.send(email, function(err, json) {
      if (err) { return res.json(err); }
      return res.json(json)
    })
  })

  return router
}
<|endoftext|>


<commit_before>import React, { Component } from 'react';
import { Card, CardTitle, CardText, CardActions, CardMenu, Badge, Button } from 'react-mdl';

class App extends Component {

  componentDidMount() {

  }

  componentWillUnmount() {

  }

  approveRequest = () => {
    this.props.approveRequest({id: this.props.id, type: 'approved', votes: this.props.votes});
  }

  rejectRequest = () => {
    this.props.rejectRequest({id: this.props.id, type: 'rejected', votes: this.props.votes});
  }

  upvoteRequest = () => {
    this.props.upvoteRequest({id: this.props.id, type: this.props.requestType, votes: this.props.votes + 1});
  }

  render() {
    return (
      <Card shadow={0} className="card">
        <CardTitle className="card-title"></CardTitle>
        <CardText>
          {this.props.description}
        </CardText>
        <CardActions border>

            <Button raised colored className="action-button" onClick={this.rejectRequest}>Reject</Button>
            <Button raised colored className="action-button" onClick={this.approveRequest}>Approve</Button>
            <Button raised colored className="action-button" onClick={this.upvoteRequest}>Vote</Button>

        </CardActions>
        <CardMenu className="white">
            <Badge text={this.props.votes}>votes</Badge>
        </CardMenu>
      </Card>
    );
  }
}

export default App;
<commit_msg>disable buttons on approved or rejected requests<commit_after>import React, { Component } from 'react';
import { Card, CardTitle, CardText, CardActions, CardMenu, Badge, Button } from 'react-mdl';

class ListItem extends Component {

  componentDidMount() {

  }

  componentWillUnmount() {

  }

  approveRequest = () => {
    this.props.approveRequest({id: this.props.id, type: 'approved', votes: this.props.votes});
  }

  rejectRequest = () => {
    this.props.rejectRequest({id: this.props.id, type: 'rejected', votes: this.props.votes});
  }

  upvoteRequest = () => {
    this.props.upvoteRequest({id: this.props.id, type: this.props.requestType, votes: this.props.votes + 1});
  }

  render() {
    const disabled = this.props.requestType !== 'pending';
    return (
      <Card shadow={0} className="card">
        <CardTitle className="card-title"></CardTitle>
        <CardText>
          {this.props.description}
        </CardText>
        <CardActions border>

            <Button disabled={disabled} raised colored className="action-button" onClick={this.rejectRequest}>Reject</Button>
            <Button disabled={disabled} raised colored className="action-button" onClick={this.approveRequest}>Approve</Button>
            <Button disabled={disabled} raised colored className="action-button" onClick={this.upvoteRequest}>Vote</Button>

        </CardActions>
        <CardMenu className="white">
            <Badge text={this.props.votes}>votes</Badge>
        </CardMenu>
      </Card>
    );
  }
}

export default ListItem;
<|endoftext|>


<commit_before>// @flow
import {crud as crudCreator} from 'hw-react-shared/src/crud/hoc/crud';
import type {Config} from 'hw-react-shared/src/crud/hoc/types';
import cuid from 'cuid';
import {clearToken} from '../reducers/credentials';
import {addError} from '../actions/error';

const CrudConfig: Config = {
  backendSelector(state) {
    return state.credentials.backend;
  },

  tokenSelector(state) {
    return state.credentials.token;
  },

  tokenToHeader(token) {
    if (token) {
      return {Authorization: token};
    }
    return {};
  },

  onAuthError({dispatch}) {
    dispatch(clearToken());
  },

  onError({dispatch}, resource, operation, error) {
    dispatch(addError(`Error: ${operation} - ${error.response.data.error}`));
  },

  cuid() {
    return cuid();
  }
};

export const crud = crudCreator(CrudConfig);
<commit_msg>Fixed error handling for crud hoc<commit_after>// @flow
import {crud as crudCreator} from 'hw-react-shared/src/crud/hoc/crud';
import type {Config} from 'hw-react-shared/src/crud/hoc/types';
import cuid from 'cuid';
import {clearToken} from '../reducers/credentials';
import {addError} from '../actions/error';

const CrudConfig: Config = {
  backendSelector(state) {
    return state.credentials.backend;
  },

  tokenSelector(state) {
    return state.credentials.token;
  },

  tokenToHeader(token) {
    if (token) {
      return {Authorization: token};
    }
    return {};
  },

  onAuthError({dispatch}) {
    dispatch(clearToken());
  },

  onError({dispatch}, resource, operation, error) {
    dispatch(addError(`Error: ${operation} - ${error}`));
  },

  cuid() {
    return cuid();
  }
};

export const crud = crudCreator(CrudConfig);
<|endoftext|>


<commit_before>
import StellarSdk from 'stellar-sdk';

const networkList = [{
	name:	'Public',
	phrase: 'Public Global Stellar Network ; September 2015',
	server: 'https://horizon.stellar.org'
}, {
	name:	'Testnet',
	phrase: 'Test SDF Network ; September 2015',
	server: 'https://horizon-testnet.stellar.org'
}];
const fees = {};

const publicNetwork = getHash('Public Global Stellar Network ; September 2015');

function getHash(passphrase) {
	return new StellarSdk.Network(passphrase)
	.networkId()
	.toString('hex')
	.slice(0, 8);
}

const networks = {};
networkList.forEach(network => {
	const hash = getHash(network.phrase);
	networks[hash] = network;
});

function getServer(hash) {
	const url = networks[hash].server;
	return new StellarSdk.Server(url);
}

function getFees(hash) {

	if (!(hash in fees)) {

		const server = getServer(hash);
		server.ledgers().order('desc').limit(1).call()
		.then(res => {
			const ledger = res.records[0];
			fees[hash] = {
				baseFee: ledger.base_fee,
				baseReserve: ledger.base_reserve
			};
		});

		fees[hash] = {
			baseFee: 100,
			baseReserve: '0.5'
		};
	}

	return fees[hash];
}

export default {
	public: publicNetwork,
	getHash: getHash,
	getFees: getFees,
	getMinimumAccountBalance: hash => getFees(hash).baseReserve * 2,

	getNetwork: function (hash) {
		if (!hash) {
			hash = publicNetwork;
		}
		return networks[hash];
	},

	getNetworks: () => networkList,
	getServer: getServer
};
<commit_msg>Adapt to new ledger property names<commit_after>
import StellarSdk from 'stellar-sdk';

const networkList = [{
	name:	'Public',
	phrase: 'Public Global Stellar Network ; September 2015',
	server: 'https://horizon.stellar.org'
}, {
	name:	'Testnet',
	phrase: 'Test SDF Network ; September 2015',
	server: 'https://horizon-testnet.stellar.org'
}];
const fees = {};

const publicNetwork = getHash('Public Global Stellar Network ; September 2015');

function getHash(passphrase) {
	return new StellarSdk.Network(passphrase)
	.networkId()
	.toString('hex')
	.slice(0, 8);
}

const networks = {};
networkList.forEach(network => {
	const hash = getHash(network.phrase);
	networks[hash] = network;
});

function getServer(hash) {
	const url = networks[hash].server;
	return new StellarSdk.Server(url);
}

function getFees(hash) {

	if (!(hash in fees)) {

		const server = getServer(hash);
		server.ledgers().order('desc').limit(1).call()
		.then(res => {
			const ledger = res.records[0];
			if ('base_fee' in ledger) {
				fees[hash] = {
					baseFee: ledger.base_fee,
					baseReserve: ledger.base_reserve
				};
			} else {
				fees[hash] = {
					baseFee: ledger.base_fee_in_stroops,
					baseReserve: ledger.base_reserve_in_stroops / 10000000.0
				};
			}
		});

		fees[hash] = {
			baseFee: 100,
			baseReserve: 0.5
		};
	}

	return fees[hash];
}

export default {
	public: publicNetwork,
	getHash: getHash,
	getFees: getFees,
	getMinimumAccountBalance: hash => getFees(hash).baseReserve * 2,

	getNetwork: function (hash) {
		if (!hash) {
			hash = publicNetwork;
		}
		return networks[hash];
	},

	getNetworks: () => networkList,
	getServer: getServer
};
<|endoftext|>