Skip to content

Commit

Permalink
# This is a combination of 2 commits.
Browse files Browse the repository at this point in the history
# The first commit's message is:

Begin.

# This is the 2nd commit message:

# This is a combination of 5 commits.
# The first commit's message is:
# This is a combination of 48 commits.
# The first commit's message is:
Swarmvis

# This is the 2nd commit message:

PropTable

# This is the 3rd commit message:

RIP Semicolins. :(

# This is the 4th commit message:

returns

# This is the 5th commit message:

Page

# This is the 6th commit message:

nodeprops

# This is the 7th commit message:

nav-item

# This is the 8th commit message:

Nav

# This is the 9th commit message:

icon

# This is the 10th commit message:

globe

should probs test this code at some point...

# This is the 11th commit message:

remove rouge semicolin

# This is the 12th commit message:

oopes

# This is the 13th commit message:

whitespace...

# This is the 14th commit message:

cosmetics

# This is the 15th commit message:

formatting

# This is the 16th commit message:

filelist

# This is the 17th commit message:

localStorage

# This is the 18th commit message:

fix : -> =

# This is the 19th commit message:

routing

# This is the 20th commit message:

objects

# This is the 21st commit message:

fix synax errs

# This is the 22nd commit message:

editable and globe ppft

# This is the 23rd commit message:

dhtgraph

# This is the 24th commit message:

fixes for dht graph

# This is the 25th commit message:

connectionlist

# This is the 26th commit message:

connection

# This is the 27th commit message:

config

# This is the 28th commit message:

bump some deps

# This is the 29th commit message:

Oh.

# This is the 30th commit message:

work on removing the evil. (jquery)

# This is the 31st commit message:

remove un-needed lines/stuff

# This is the 32nd commit message:

Die

# This is the 33rd commit message:

remove $

# This is the 34th commit message:

notfound

# This is the 35th commit message:

fixes

# This is the 36th commit message:

Further fixes

# This is the 37th commit message:

more fixes

# This is the 38th commit message:

further fixes

# This is the 39th commit message:

Globe pls.

# This is the 40th commit message:

remove unneeded

# This is the 41st commit message:

config

# This is the 42nd commit message:

home

# This is the 43rd commit message:

connections

# This is the 44th commit message:

fix objects update

# This is the 45th commit message:

bitswap

# This is the 46th commit message:

this and that

# This is the 47th commit message:

logs

# This is the 48th commit message:

files

# This is the 2nd commit message:

rebase

# This is the 3rd commit message:

# This is a combination of 3 commits.
# The first commit's message is:
remove jquery as a dep

# This is the 2nd commit message:

es6 path

# This is the 3rd commit message:

fixes

# This is the 4th commit message:

further linting

# This is the 5th commit message:

# This is a combination of 20 commits.
# The first commit's message is:
work on indent hell

# This is the 2nd commit message:

This is how homicides happen.

# This is the 3rd commit message:

Revert "This is how homicides happen."

This reverts commit c9a1600.

# This is the 4th commit message:

less .bind()

# This is the 5th commit message:

some synax fixes

# This is the 6th commit message:

more lint fixes

# This is the 7th commit message:

further linting

# This is the 8th commit message:

lints

# This is the 9th commit message:

more linting

# This is the 10th commit message:

fix lint

# This is the 11th commit message:

give classes names, make it a more "es7ish"

# This is the 12th commit message:

further work es7ing

# This is the 13th commit message:

further cosmetic fixes

# This is the 14th commit message:

oops

# This is the 15th commit message:

fixes

# This is the 16th commit message:

create a util for comon stuff

# This is the 17th commit message:

fix linting errors

# This is the 18th commit message:

chore(package): update stream-http to version 2.1.0

http://greenkeeper.io/
# This is the 19th commit message:

chore(package): update karma-sourcemap-loader to version 0.3.7

http://greenkeeper.io/
# This is the 20th commit message:

fix the tests
  • Loading branch information
luigiplr committed Jan 19, 2016
1 parent 5270d87 commit 6ed95f6
Show file tree
Hide file tree
Showing 36 changed files with 1,008 additions and 1,081 deletions.
11 changes: 3 additions & 8 deletions app/scripts/app.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react'
import {render} from 'react-dom'
import Router, {hashHistory} from 'react-router'

import { render } from 'react-dom'
import Router from 'react-router'
import routes from './routes'

require('../styles/app.less')
Expand All @@ -10,8 +9,4 @@ if (process.env.NODE_ENV !== 'production') {
localStorage.debug = true
}

document.addEventListener('DOMContentLoaded', () => {
const root = document.getElementById('root')

render(<Router history={hashHistory} routes={routes} />, root)
})
document.addEventListener('DOMContentLoaded', () => render(<Router history={Router.hashHistory} routes={routes} />, document.getElementById('root')))
33 changes: 18 additions & 15 deletions app/scripts/include/Detector.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,20 @@
*/

var Detector = {
canvas: !!window.CanvasRenderingContext2D,
webgl: (function() {
try {
return !!window.WebGLRenderingContext && !!document.createElement('canvas').getContext('experimental-webgl');
} catch (e) {
return false;
}
})(),
workers: !!window.Worker,
fileapi: window.File && window.FileReader && window.FileList && window.Blob,

canvas : !! window.CanvasRenderingContext2D,
webgl : ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )(),
workers : !! window.Worker,
fileapi : window.File && window.FileReader && window.FileList && window.Blob,

getWebGLErrorMessage : function () {
getWebGLErrorMessage: function() {

var domElement = document.createElement( 'div' );
var domElement = document.createElement('div');

domElement.style.fontFamily = 'monospace';
domElement.style.fontSize = '13px';
Expand All @@ -23,25 +28,25 @@ var Detector = {
domElement.style.width = '475px';
domElement.style.margin = '5em auto 0';

if ( ! this.webgl ) {
if (!this.webgl) {

domElement.innerHTML = window.WebGLRenderingContext ? [
'Sorry, your graphics card doesn\'t support <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation">WebGL</a>'
].join( '\n' ) : [
].join('\n') : [
'Sorry, your browser doesn\'t support <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation">WebGL</a><br/>',
'Please try with',
'<a href="http://www.google.com/chrome">Chrome</a>, ',
'<a href="http://www.mozilla.com/en-US/firefox/new/">Firefox 4</a> or',
'<a href="http://nightly.webkit.org/">Webkit Nightly (Mac)</a>'
].join( '\n' );
].join('\n');

}

return domElement;

},

addGetWebGLMessage : function ( parameters ) {
addGetWebGLMessage: function(parameters) {

var parent, id, domElement;

Expand All @@ -53,8 +58,6 @@ var Detector = {
domElement = Detector.getWebGLErrorMessage();
domElement.id = id;

parent.appendChild( domElement );

parent.appendChild(domElement);
}

};
};
72 changes: 37 additions & 35 deletions app/scripts/include/globe.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,16 @@ import debug from 'debug'

const log = debug('globe:scripts')

export default function (container, opts) {
export
default
function(container, opts) {
opts = opts || {}

var colorFn = opts.colorFn || function (x) {
var c = new THREE.Color()
c.setHSL((0.6 - (x * 0.5)), 1.0, 0.5)
return c
}
var colorFn = opts.colorFn || function(x) {
var c = new THREE.Color()
c.setHSL((0.6 - (x * 0.5)), 1.0, 0.5)
return c
}
var imgDir = opts.imgDir || '/globe/'

var Shaders = {
Expand Down Expand Up @@ -108,7 +110,7 @@ export default function (container, opts) {
var padding = 40
var PI_HALF = Math.PI / 2

function init () {
function init() {
container.style.color = '#fff'
container.style.font = '13px/20px Arial, sans-serif'

Expand Down Expand Up @@ -183,20 +185,20 @@ export default function (container, opts) {
container.addEventListener('mouseout', onMouseOutRenderer)
}

function addData (data, opts) {
function addData(data, opts) {
var lat, lng, size, color, i, step, colorFnWrapper

opts.animated = opts.animated || false
this.is_animated = opts.animated
opts.format = opts.format || 'magnitude'; // other option is 'legend'
if (opts.format === 'magnitude') {
step = 3
colorFnWrapper = function (data, i) {
colorFnWrapper = function(data, i) {
return colorFn(data[i + 2])
}
} else if (opts.format === 'legend') {
step = 4
colorFnWrapper = function (data, i) {
colorFnWrapper = function(data, i) {
return colorFn(data[i + 3])
}
} else {
Expand Down Expand Up @@ -241,7 +243,7 @@ export default function (container, opts) {
}
}

function createPoints () {
function createPoints() {
if (this._baseGeometry !== undefined) {
if (this.is_animated === false) {
this.points = new THREE.Mesh(this._baseGeometry, new THREE.MeshBasicMaterial({
Expand Down Expand Up @@ -272,7 +274,7 @@ export default function (container, opts) {
}
}

function addPoint (lat, lng, size, color, subgeo) {
function addPoint(lat, lng, size, color, subgeo) {
var phi = (90 - lat) * Math.PI / 180
var theta = (180 - lng) * Math.PI / 180

Expand All @@ -293,7 +295,7 @@ export default function (container, opts) {
subgeo.merge(point.geometry, point.matrix)
}

function onMouseDown (event) {
function onMouseDown(event) {
event.preventDefault()

container.addEventListener('mousemove', onMouseMove, false)
Expand All @@ -309,7 +311,7 @@ export default function (container, opts) {
container.style.cursor = 'move'
}

function onMouseMove (event) {
function onMouseMove(event) {
mouse.x = -event.clientX
mouse.y = event.clientY

Expand All @@ -322,37 +324,37 @@ export default function (container, opts) {
target.y = target.y < -PI_HALF ? -PI_HALF : target.y
}

function onMouseUp (event) {
function onMouseUp(event) {
container.removeEventListener('mousemove', onMouseMove, false)
container.removeEventListener('mouseup', onMouseUp, false)
container.removeEventListener('mouseout', onMouseOut, false)
container.style.cursor = 'auto'
}

function onMouseOut (event) {
function onMouseOut(event) {
overRenderer = false
container.removeEventListener('mousemove', onMouseMove, false)
container.removeEventListener('mouseup', onMouseUp, false)
container.removeEventListener('mouseout', onMouseOut, false)
}

function onMouseOverRenderer (event) {
function onMouseOverRenderer(event) {
overRenderer = true
}

function onMouseOutRenderer (event) {
function onMouseOutRenderer(event) {
overRenderer = false
}

function onMouseWheel (event) {
function onMouseWheel(event) {
event.preventDefault()
if (overRenderer) {
zoom(event.wheelDeltaY * 0.3)
}
return false
}

function onDocumentKeyDown (event) {
function onDocumentKeyDown(event) {
switch (event.keyCode) {
case 38:
zoom(100)
Expand All @@ -365,24 +367,24 @@ export default function (container, opts) {
}
}

function onWindowResize (event) {
function onWindowResize(event) {
camera.aspect = container.offsetWidth / container.offsetHeight
camera.updateProjectionMatrix()
renderer.setSize(container.offsetWidth, container.offsetHeight)
}

function zoom (delta) {
function zoom(delta) {
distanceTarget -= delta
distanceTarget = distanceTarget > 1000 ? 1000 : distanceTarget
distanceTarget = distanceTarget < 350 ? 350 : distanceTarget
}

function animate () {
function animate() {
requestAnimationFrame(animate)
render()
}

function render () {
function render() {
zoom(curZoomSpeed)

rotation.x += (target.x - rotation.x) * 0.1
Expand All @@ -398,26 +400,26 @@ export default function (container, opts) {
renderer.render(scene, camera)
}

function removeReferences (removeme) {
function removeReferences(removeme) {
try {
removeme.traverse(function (ob) {
removeme.traverse(function(ob) {
try {
renderer.deallocateObject(ob)
} catch(e) {}
} catch (e) {}
try {
ob.geometry.deallocate()
} catch(e) {}
} catch (e) {}
try {
ob.material.deallocate()
} catch(e) {}
} catch (e) {}
try {
ob.deallocate()
} catch(e) {}
} catch (e) {}
})
} catch(e) {}
} catch (e) {}
}

function dispose () {
function dispose() {
onMouseOut()
container.removeEventListener('mouseover', onMouseOverRenderer)
container.removeEventListener('mouseout', onMouseOutRenderer)
Expand All @@ -431,11 +433,11 @@ export default function (container, opts) {
init()
this.animate = animate

this.__defineGetter__('time', function () {
this.__defineGetter__('time', function() {
return this._time || 0
})

this.__defineSetter__('time', function (t) {
this.__defineSetter__('time', function(t) {
var validMorphs = []
var morphDict = this.points.morphTargetDictionary
for (var k in morphDict) {
Expand Down Expand Up @@ -466,4 +468,4 @@ export default function (container, opts) {
this.dispose = dispose

return this
}
}
56 changes: 29 additions & 27 deletions app/scripts/pages/bitswap.js
Original file line number Diff line number Diff line change
@@ -1,44 +1,46 @@
import React from 'react'
import React, {Component} from 'react'
import FileList from '../views/filelist'
import i18n from '../utils/i18n.js'
import {Row, Col, Panel} from 'react-bootstrap'

export default React.createClass({
displayName: 'Bitswap',
propTypes: {
pollInterval: React.PropTypes.func
},
getInitialState: function () {
var t = this
export
default class Bitswap extends Component {
state = {
wantlist: []
};

static displayName = 'Bitswap';
static propTypes = {
pollInterval: React.PropTypes.func,
ipfs: React.PropTypes.object
};

componentDidMount () {
this.props.pollInterval = setInterval(() => this.update(), 1000)
this.update()
}

var update = function () {
t.props.ipfs.send('bitswap/wantlist', null, null, null, function (err, res) {
if (err) return console.error(err)
t.setState({ wantlist: res })
update () {
this.props.ipfs.send('bitswap/wantlist', null, null, null, (err, wantlist) => {
if (err) return console.error(err)
this.setState({
wantlist
})
}

update()
t.props.pollInterval = setInterval(update, 1000)

return {
wantlist: []
}
},
})
}

componentWillUnmount: function () {
componentWillUnmount () {
clearInterval(this.props.pollInterval)
},
}

render: function () {
var wantlist = this.state.wantlist
render () {
const wantlist = this.state.wantlist

return (
<Row>
<Col sm={10} smOffset={1}>
<h3>{i18n.t('Bitswap')}</h3>
<br/>

<div>
<h4>
<strong>{i18n.t('Wantlist')}</strong>&nbsp;
Expand All @@ -53,4 +55,4 @@ export default React.createClass({
</Row>
)
}
})
}
Loading

0 comments on commit 6ed95f6

Please sign in to comment.