Merge branch 'test' of https://github.com/urbit/urbit into test

This commit is contained in:
Anton Dyudin 2015-06-18 11:31:37 -07:00
commit 37161d9c3a
7 changed files with 124 additions and 27 deletions

View File

@ -127,6 +127,24 @@ h3 code {
font-size: inherit;
padding: 0.3rem;
}
#body > div > h1 {
height: 3rem;
}
#body > div > h1 span {
background-color: #000;
padding: 1rem;
margin-left: -1rem;
color: #fff;
}
#body > div > h2 {
height: 2.2rem;
}
#body > div > h2 span {
background-color: #c6c6c6;
padding: 0.6rem;
margin-left: -0.6rem;
color: #fff;
}
pre,
code {
font-size: 0.8rem;
@ -357,6 +375,11 @@ li:before {
.list h1 {
font-size: 0.7rem;
}
.list.default > li > a,
.list.default > li > a > h1,
.list.default li:before {
font-size: 1rem;
}
#body .CodeMirror {
font-size: 0.8rem;
line-height: 1rem;
@ -369,6 +392,9 @@ li:before {
padding-right: 1rem;
margin-left: -1rem;
}
.error {
color: #f91733;
}
@media only screen and (max-width: 1170px) {
#nav,
#nav > div,

View File

@ -57,6 +57,24 @@ h3 code
font-size inherit
padding .3rem
#body > div > h1
height 3rem
#body > div > h1 span
background-color #000
padding 1rem
margin-left -1rem
color #fff
#body > div > h2
height 2.2rem
#body > div > h2 span
background-color rgba(198,198,198,1)
padding .6rem
margin-left -.6rem
color #fff
pre
code
font-size .8rem
@ -282,6 +300,11 @@ li:before
.list h1
font-size .7rem
.list.default > li > a
.list.default > li > a > h1
.list.default li:before
font-size 1rem
#body .CodeMirror
font-size .8rem
line-height 1rem
@ -294,4 +317,7 @@ li:before
padding-right 1rem
margin-left -1rem
.error
color rgba(249,23,51,1)
@import 'mobile'

View File

@ -1,4 +1,4 @@
# comment
BodyComponent = require './BodyComponent.coffee'
TreeStore = require '../stores/TreeStore.coffee'
TreeActions = require '../actions/TreeActions.coffee'
@ -38,7 +38,14 @@ module.exports = recl
setPath: (href,hist) ->
if hist isnt false then history.pushState {}, "", window.tree.basepath href
TreeActions.setCurr href.split("#")[0]
next = href.split("#")[0]
rend = false
if next isnt @state.curr
React.unmountComponentAtNode $('#cont')[0]
rend = true
TreeActions.setCurr next
if rend is true
React.render (BodyComponent {}, ""),$('#cont')[0]
goTo: (path) ->
@toggleFocus false

View File

@ -16,13 +16,17 @@ module.exports = recl
componentDidMount: ->
TreeStore.addChangeListener @_onChangeStore
componentWillUnmount: ->
TreeStore.removeChangeListener @_onChangeStore
componentDidUpdate: (_props,_state) ->
if _state.curr isnt @state.curr
setTimeout (=> @getPath _state.curr), 0
getInitialState: -> @stateFromStore()
_onChangeStore: -> @setState @stateFromStore()
_onChangeStore: ->
@setState @stateFromStore()
getPath: (path) ->
if not @state.cont[path]?

View File

@ -56,4 +56,6 @@ module.exports = recl
prev = (h1 {},v)
href = window.tree.basepath _path
(li {}, (a {href:href,className:c,key:"list-a-"+_path}, prev))
(ul {className:"list",key:"list-"+@state.path}, _list)
k = "list"
if @props['data-source'] is 'default' then k += " default"
(ul {className:k,key:"list-"+@state.path}, _list)

View File

@ -1,4 +1,4 @@
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({"/Users/galen/src/urbit-dev/urb/zod/base/pub/tree/src/js/actions/TreeActions.coffee":[function(require,module,exports){
var TreeDispatcher, TreePersistence;
TreeDispatcher = require('../dispatcher/Dispatcher.coffee');
@ -71,8 +71,11 @@ module.exports = {
};
},{"../dispatcher/Dispatcher.coffee":8,"../persistence/TreePersistence.coffee":13}],2:[function(require,module,exports){
var TreeActions, TreeStore, a, div, recl, ref;
},{"../dispatcher/Dispatcher.coffee":"/Users/galen/src/urbit-dev/urb/zod/base/pub/tree/src/js/dispatcher/Dispatcher.coffee","../persistence/TreePersistence.coffee":"/Users/galen/src/urbit-dev/urb/zod/base/pub/tree/src/js/persistence/TreePersistence.coffee"}],"/Users/galen/src/urbit-dev/urb/zod/base/pub/tree/src/js/components/AnchorComponent.coffee":[function(require,module,exports){
var BodyComponent, TreeActions, TreeStore, a, div, recl, ref;
BodyComponent = require('./BodyComponent.coffee');
TreeStore = require('../stores/TreeStore.coffee');
@ -120,10 +123,20 @@ module.exports = recl({
return dt = this.ts - Number(Date.now());
},
setPath: function(href, hist) {
var next, rend;
if (hist !== false) {
history.pushState({}, "", window.tree.basepath(href));
}
return TreeActions.setCurr(href.split("#")[0]);
next = href.split("#")[0];
rend = false;
if (next !== this.state.curr) {
React.unmountComponentAtNode($('#cont')[0]);
rend = true;
}
TreeActions.setCurr(next);
if (rend === true) {
return React.render(BodyComponent({}, ""), $('#cont')[0]);
}
},
goTo: function(path) {
var frag;
@ -293,7 +306,8 @@ module.exports = recl({
});
},{"../actions/TreeActions.coffee":1,"../stores/TreeStore.coffee":14}],3:[function(require,module,exports){
},{"../actions/TreeActions.coffee":"/Users/galen/src/urbit-dev/urb/zod/base/pub/tree/src/js/actions/TreeActions.coffee","../stores/TreeStore.coffee":"/Users/galen/src/urbit-dev/urb/zod/base/pub/tree/src/js/stores/TreeStore.coffee","./BodyComponent.coffee":"/Users/galen/src/urbit-dev/urb/zod/base/pub/tree/src/js/components/BodyComponent.coffee"}],"/Users/galen/src/urbit-dev/urb/zod/base/pub/tree/src/js/components/BodyComponent.coffee":[function(require,module,exports){
var TreeActions, TreeStore, div, input, load, recl, ref, textarea;
TreeStore = require('../stores/TreeStore.coffee');
@ -318,6 +332,9 @@ module.exports = recl({
componentDidMount: function() {
return TreeStore.addChangeListener(this._onChangeStore);
},
componentWillUnmount: function() {
return TreeStore.removeChangeListener(this._onChangeStore);
},
componentDidUpdate: function(_props, _state) {
if (_state.curr !== this.state.curr) {
return setTimeout(((function(_this) {
@ -357,7 +374,8 @@ module.exports = recl({
});
},{"../actions/TreeActions.coffee":1,"../stores/TreeStore.coffee":14,"./LoadComponent.coffee":7}],4:[function(require,module,exports){
},{"../actions/TreeActions.coffee":"/Users/galen/src/urbit-dev/urb/zod/base/pub/tree/src/js/actions/TreeActions.coffee","../stores/TreeStore.coffee":"/Users/galen/src/urbit-dev/urb/zod/base/pub/tree/src/js/stores/TreeStore.coffee","./LoadComponent.coffee":"/Users/galen/src/urbit-dev/urb/zod/base/pub/tree/src/js/components/LoadComponent.coffee"}],"/Users/galen/src/urbit-dev/urb/zod/base/pub/tree/src/js/components/CodeMirror.coffee":[function(require,module,exports){
var div, recl, ref, textarea;
recl = React.createClass;
@ -380,7 +398,8 @@ module.exports = recl({
});
},{}],5:[function(require,module,exports){
},{}],"/Users/galen/src/urbit-dev/urb/zod/base/pub/tree/src/js/components/KidsComponent.coffee":[function(require,module,exports){
var TreeActions, TreeStore, a, div, hr, li, recl, ref, ul;
TreeStore = require('../stores/TreeStore.coffee');
@ -446,7 +465,8 @@ module.exports = recl({
});
},{"../actions/TreeActions.coffee":1,"../stores/TreeStore.coffee":14}],6:[function(require,module,exports){
},{"../actions/TreeActions.coffee":"/Users/galen/src/urbit-dev/urb/zod/base/pub/tree/src/js/actions/TreeActions.coffee","../stores/TreeStore.coffee":"/Users/galen/src/urbit-dev/urb/zod/base/pub/tree/src/js/stores/TreeStore.coffee"}],"/Users/galen/src/urbit-dev/urb/zod/base/pub/tree/src/js/components/ListComponent.coffee":[function(require,module,exports){
var TreeActions, TreeStore, a, div, h1, li, load, recl, ref, ul;
TreeStore = require('../stores/TreeStore.coffee');
@ -502,7 +522,7 @@ module.exports = recl({
}
},
render: function() {
var _list, doc, ref1;
var _list, doc, k, ref1;
doc = (ref1 = this.state.tree) != null ? ref1 : [];
if (!this.getCont()) {
_list = div({
@ -533,15 +553,20 @@ module.exports = recl({
};
})(this));
}
k = "list";
if (this.props['data-source'] === 'default') {
k += " default";
}
return ul({
className: "list",
className: k,
key: "list-" + this.state.path
}, _list);
}
});
},{"../actions/TreeActions.coffee":1,"../stores/TreeStore.coffee":14,"./LoadComponent.coffee":7}],7:[function(require,module,exports){
},{"../actions/TreeActions.coffee":"/Users/galen/src/urbit-dev/urb/zod/base/pub/tree/src/js/actions/TreeActions.coffee","../stores/TreeStore.coffee":"/Users/galen/src/urbit-dev/urb/zod/base/pub/tree/src/js/stores/TreeStore.coffee","./LoadComponent.coffee":"/Users/galen/src/urbit-dev/urb/zod/base/pub/tree/src/js/components/LoadComponent.coffee"}],"/Users/galen/src/urbit-dev/urb/zod/base/pub/tree/src/js/components/LoadComponent.coffee":[function(require,module,exports){
var div, input, recl, ref, textarea;
recl = React.createClass;
@ -578,7 +603,8 @@ module.exports = recl({
});
},{}],8:[function(require,module,exports){
},{}],"/Users/galen/src/urbit-dev/urb/zod/base/pub/tree/src/js/dispatcher/Dispatcher.coffee":[function(require,module,exports){
var Dispatcher;
Dispatcher = require('flux').Dispatcher;
@ -599,7 +625,8 @@ module.exports = _.extend(new Dispatcher(), {
});
},{"flux":10}],9:[function(require,module,exports){
},{"flux":"/Users/galen/src/urbit-dev/urb/zod/base/pub/tree/src/js/node_modules/flux/index.js"}],"/Users/galen/src/urbit-dev/urb/zod/base/pub/tree/src/js/main.coffee":[function(require,module,exports){
var rend;
rend = React.render;
@ -758,7 +785,8 @@ $(function() {
});
},{"./actions/TreeActions.coffee":1,"./components/AnchorComponent.coffee":2,"./components/BodyComponent.coffee":3,"./components/CodeMirror.coffee":4,"./components/KidsComponent.coffee":5,"./components/ListComponent.coffee":6,"./persistence/TreePersistence.coffee":13}],10:[function(require,module,exports){
},{"./actions/TreeActions.coffee":"/Users/galen/src/urbit-dev/urb/zod/base/pub/tree/src/js/actions/TreeActions.coffee","./components/AnchorComponent.coffee":"/Users/galen/src/urbit-dev/urb/zod/base/pub/tree/src/js/components/AnchorComponent.coffee","./components/BodyComponent.coffee":"/Users/galen/src/urbit-dev/urb/zod/base/pub/tree/src/js/components/BodyComponent.coffee","./components/CodeMirror.coffee":"/Users/galen/src/urbit-dev/urb/zod/base/pub/tree/src/js/components/CodeMirror.coffee","./components/KidsComponent.coffee":"/Users/galen/src/urbit-dev/urb/zod/base/pub/tree/src/js/components/KidsComponent.coffee","./components/ListComponent.coffee":"/Users/galen/src/urbit-dev/urb/zod/base/pub/tree/src/js/components/ListComponent.coffee","./persistence/TreePersistence.coffee":"/Users/galen/src/urbit-dev/urb/zod/base/pub/tree/src/js/persistence/TreePersistence.coffee"}],"/Users/galen/src/urbit-dev/urb/zod/base/pub/tree/src/js/node_modules/flux/index.js":[function(require,module,exports){
/**
* Copyright (c) 2014-2015, Facebook, Inc.
* All rights reserved.
@ -770,7 +798,7 @@ $(function() {
module.exports.Dispatcher = require('./lib/Dispatcher')
},{"./lib/Dispatcher":11}],11:[function(require,module,exports){
},{"./lib/Dispatcher":"/Users/galen/src/urbit-dev/urb/zod/base/pub/tree/src/js/node_modules/flux/lib/Dispatcher.js"}],"/Users/galen/src/urbit-dev/urb/zod/base/pub/tree/src/js/node_modules/flux/lib/Dispatcher.js":[function(require,module,exports){
/*
* Copyright (c) 2014, Facebook, Inc.
* All rights reserved.
@ -1022,7 +1050,7 @@ var _prefix = 'ID_';
module.exports = Dispatcher;
},{"./invariant":12}],12:[function(require,module,exports){
},{"./invariant":"/Users/galen/src/urbit-dev/urb/zod/base/pub/tree/src/js/node_modules/flux/lib/invariant.js"}],"/Users/galen/src/urbit-dev/urb/zod/base/pub/tree/src/js/node_modules/flux/lib/invariant.js":[function(require,module,exports){
/**
* Copyright (c) 2014, Facebook, Inc.
* All rights reserved.
@ -1077,7 +1105,7 @@ var invariant = function(condition, format, a, b, c, d, e, f) {
module.exports = invariant;
},{}],13:[function(require,module,exports){
},{}],"/Users/galen/src/urbit-dev/urb/zod/base/pub/tree/src/js/persistence/TreePersistence.coffee":[function(require,module,exports){
var TreeActions;
TreeActions = require('../actions/TreeActions.coffee');
@ -1098,7 +1126,8 @@ module.exports = {
};
},{"../actions/TreeActions.coffee":1}],14:[function(require,module,exports){
},{"../actions/TreeActions.coffee":"/Users/galen/src/urbit-dev/urb/zod/base/pub/tree/src/js/actions/TreeActions.coffee"}],"/Users/galen/src/urbit-dev/urb/zod/base/pub/tree/src/js/stores/TreeStore.coffee":[function(require,module,exports){
var EventEmitter, MessageDispatcher, TreeStore, _cont, _curr, _load, _snip, _tree;
EventEmitter = require('events').EventEmitter;
@ -1194,7 +1223,7 @@ TreeStore = _.extend(EventEmitter.prototype, {
}
return results;
} else {
return _cont[path] = window.tree.reactify("React.createElement ('div', {}, [ React.createElement('h1', {}, 'Error: Empty path'), React.createElement('div', {}, [ React.createElement('pre', {}, '" + (this.getCurr()) + "'), React.createElement('span', {}, 'is either empty or does not exist.') ]) ])");
return _cont[path] = window.tree.reactify("React.createElement ('div', {}, [ React.createElement('h1', {className:'error'}, 'Error: Empty path'), React.createElement('div', {}, [ React.createElement('pre', {}, '" + (this.getCurr()) + "'), React.createElement('span', {}, 'is either empty or does not exist.') ]) ])");
}
},
loadKids: function(path, kids) {
@ -1315,7 +1344,8 @@ TreeStore.dispatchToken = MessageDispatcher.register(function(payload) {
module.exports = TreeStore;
},{"../dispatcher/Dispatcher.coffee":8,"events":15}],15:[function(require,module,exports){
},{"../dispatcher/Dispatcher.coffee":"/Users/galen/src/urbit-dev/urb/zod/base/pub/tree/src/js/dispatcher/Dispatcher.coffee","events":"/usr/local/lib/node_modules/watchify/node_modules/browserify/node_modules/events/events.js"}],"/usr/local/lib/node_modules/watchify/node_modules/browserify/node_modules/events/events.js":[function(require,module,exports){
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
@ -1375,8 +1405,10 @@ EventEmitter.prototype.emit = function(type) {
er = arguments[1];
if (er instanceof Error) {
throw er; // Unhandled 'error' event
} else {
throw TypeError('Uncaught, unspecified "error" event.');
}
throw TypeError('Uncaught, unspecified "error" event.');
return false;
}
}
@ -1618,4 +1650,4 @@ function isUndefined(arg) {
return arg === void 0;
}
},{}]},{},[9]);
},{}]},{},["/Users/galen/src/urbit-dev/urb/zod/base/pub/tree/src/js/main.coffee"]);

View File

@ -61,7 +61,7 @@ TreeStore = _.extend EventEmitter.prototype, {
body: window.tree.reactify v.body.body
else
_cont[path] = window.tree.reactify "React.createElement ('div', {}, [
React.createElement('h1', {}, 'Error: Empty path'),
React.createElement('h1', {className:'error'}, 'Error: Empty path'),
React.createElement('div', {}, [
React.createElement('pre', {}, '#{@getCurr()}'),
React.createElement('span', {}, 'is either empty or does not exist.')