no min, new tree

This commit is contained in:
Galen Wolfe-Pauly 2016-05-05 17:23:47 -07:00
parent 05c95159fe
commit 286122ce88
3 changed files with 94 additions and 48 deletions

View File

@ -6103,6 +6103,10 @@ pre {
background-color: #f7f7f7;
}
pre {
padding: .6rem;
}
p code {
padding: .2rem .1rem;
}

File diff suppressed because one or more lines are too long

View File

@ -13,6 +13,13 @@ module.exports = {
type: "loadPath"
});
},
loadSein: function(path, data) {
return TreeDispatcher.handleServerAction({
path: path,
data: data,
type: "loadSein"
});
},
clearData: function() {
TreePersistence.refresh();
return TreeDispatcher.handleServerAction({
@ -101,7 +108,7 @@ module.exports = {
};
},{"../dispatcher/Dispatcher.coffee":22,"../persistence/TreePersistence.coffee":24}],2:[function(require,module,exports){
},{"../dispatcher/Dispatcher.coffee":23,"../persistence/TreePersistence.coffee":25}],2:[function(require,module,exports){
var TreeActions, TreeStore, _load, code, div, fragsrc, recl, ref, span, util;
util = require('../utils/util.coffee');
@ -274,7 +281,7 @@ module.exports = function(queries, Child, load) {
};
},{"../actions/TreeActions.coffee":1,"../stores/TreeStore.coffee":25,"../utils/util.coffee":27,"./LoadComponent.coffee":11}],3:[function(require,module,exports){
},{"../actions/TreeActions.coffee":1,"../stores/TreeStore.coffee":26,"../utils/util.coffee":28,"./LoadComponent.coffee":12}],3:[function(require,module,exports){
var Comments, TreeActions, TreeStore, a, clas, div, extras, h1, h3, img, input, load, p, query, reactify, recl, ref, rele, util;
clas = require('classnames');
@ -533,7 +540,7 @@ module.exports = query({
}));
},{"../actions/TreeActions.coffee":1,"../stores/TreeStore.coffee":25,"../utils/util.coffee":27,"./Async.coffee":2,"./CommentsComponent.coffee":5,"./LoadComponent.coffee":11,"./Reactify.coffee":16,"classnames":28}],4:[function(require,module,exports){
},{"../actions/TreeActions.coffee":1,"../stores/TreeStore.coffee":26,"../utils/util.coffee":28,"./Async.coffee":2,"./CommentsComponent.coffee":5,"./LoadComponent.coffee":12,"./Reactify.coffee":17,"classnames":29}],4:[function(require,module,exports){
var div, recl, ref, textarea;
recl = React.createClass;
@ -649,7 +656,7 @@ module.exports = query({
}));
},{"../actions/TreeActions.coffee":1,"../utils/util.coffee":27,"./Async.coffee":2,"./LoadComponent.coffee":11,"./Reactify.coffee":16,"classnames":28}],6:[function(require,module,exports){
},{"../actions/TreeActions.coffee":1,"../utils/util.coffee":28,"./Async.coffee":2,"./LoadComponent.coffee":12,"./Reactify.coffee":17,"classnames":29}],6:[function(require,module,exports){
var div, recl;
recl = React.createClass;
@ -667,6 +674,7 @@ module.exports = {
script: require('./ScriptComponent.coffee'),
plan: require('./PlanComponent.coffee'),
panel: require('./PanelComponent.coffee'),
imagepanel: require('./ImagepanelComponent.coffee'),
lost: recl({
render: function() {
return div({}, "<lost(", this.props.children, ")>");
@ -675,7 +683,7 @@ module.exports = {
};
},{"./CodeMirror.coffee":4,"./EmailComponent.coffee":8,"./KidsComponent.coffee":9,"./ListComponent.coffee":10,"./ModuleComponent.coffee":12,"./PanelComponent.coffee":14,"./PlanComponent.coffee":15,"./ScriptComponent.coffee":17,"./SearchComponent.coffee":18,"./TocComponent.coffee":20}],7:[function(require,module,exports){
},{"./CodeMirror.coffee":4,"./EmailComponent.coffee":8,"./ImagepanelComponent.coffee":9,"./KidsComponent.coffee":10,"./ListComponent.coffee":11,"./ModuleComponent.coffee":13,"./PanelComponent.coffee":15,"./PlanComponent.coffee":16,"./ScriptComponent.coffee":18,"./SearchComponent.coffee":19,"./TocComponent.coffee":21}],7:[function(require,module,exports){
var a, div, recl, ref, util;
util = require('../utils/util.coffee');
@ -733,7 +741,7 @@ module.exports = recl({
});
},{"../utils/util.coffee":27}],8:[function(require,module,exports){
},{"../utils/util.coffee":28}],8:[function(require,module,exports){
var button, div, input, p, reactify, recl, ref;
reactify = require('./Reactify.coffee');
@ -819,7 +827,27 @@ module.exports = recl({
});
},{"./Reactify.coffee":16}],9:[function(require,module,exports){
},{"./Reactify.coffee":17}],9:[function(require,module,exports){
var div, recl;
recl = React.createClass;
div = React.DOM.div;
module.exports = recl({
displayName: "ImagePanel",
render: function() {
return div({
className: "image-container",
style: {
backgroundImage: "url('" + this.props.src + "')"
}
});
}
});
},{}],10:[function(require,module,exports){
var a, clas, div, hr, li, query, reactify, recl, ref, ul;
clas = require('classnames');
@ -911,7 +939,7 @@ module.exports = query({
}));
},{"./Async.coffee":2,"./Reactify.coffee":16,"classnames":28}],10:[function(require,module,exports){
},{"./Async.coffee":2,"./Reactify.coffee":17,"classnames":29}],11:[function(require,module,exports){
var a, clas, div, h1, li, pre, query, reactify, recl, ref, span, ul, util;
clas = require('classnames');
@ -1133,7 +1161,7 @@ module.exports = query({
}));
},{"../utils/util.coffee":27,"./Async.coffee":2,"./Reactify.coffee":16,"classnames":28}],11:[function(require,module,exports){
},{"../utils/util.coffee":28,"./Async.coffee":2,"./Reactify.coffee":17,"classnames":29}],12:[function(require,module,exports){
var div, recl, ref, span;
recl = React.createClass;
@ -1171,7 +1199,7 @@ module.exports = recl({
});
},{}],12:[function(require,module,exports){
},{}],13:[function(require,module,exports){
var TreeActions, div, recl;
recl = React.createClass;
@ -1205,7 +1233,7 @@ module.exports = recl({
});
},{"../actions/TreeActions.coffee":1}],13:[function(require,module,exports){
},{"../actions/TreeActions.coffee":1}],14:[function(require,module,exports){
var BodyComponent, Dpad, Nav, Sibs, TreeActions, TreeStore, a, button, clas, div, li, query, reactify, recl, ref, rend, ul, util;
clas = require('classnames');
@ -1430,7 +1458,7 @@ module.exports = query({
$('body').on('click', 'a', function(e) {
var href, url;
href = $(this).attr('href');
if (href[0] === "#") {
if ((href != null ? href[0] : void 0) === "#") {
return true;
}
if (href && !/^https?:\/\//i.test(href)) {
@ -1534,7 +1562,7 @@ module.exports = query({
}));
},{"../actions/TreeActions.coffee":1,"../stores/TreeStore.coffee":25,"../utils/util.coffee":27,"./Async.coffee":2,"./BodyComponent.coffee":3,"./DpadComponent.coffee":7,"./Reactify.coffee":16,"./SibsComponent.coffee":19,"classnames":28}],14:[function(require,module,exports){
},{"../actions/TreeActions.coffee":1,"../stores/TreeStore.coffee":26,"../utils/util.coffee":28,"./Async.coffee":2,"./BodyComponent.coffee":3,"./DpadComponent.coffee":7,"./Reactify.coffee":17,"./SibsComponent.coffee":20,"classnames":29}],15:[function(require,module,exports){
var a, li, nav, recl, ref, rele, ul;
recl = React.createClass;
@ -1590,7 +1618,7 @@ module.exports = recl({
});
},{}],15:[function(require,module,exports){
},{}],16:[function(require,module,exports){
var Grid, TreeActions, a, button, code, div, h6, input, load, query, recl, ref1, ref2, rele, span, table, tbody, td, textarea, tr,
slice = [].slice;
@ -1766,7 +1794,7 @@ module.exports = query({
}));
},{"../actions/TreeActions.coffee":1,"./Async.coffee":2,"./LoadComponent.coffee":11}],16:[function(require,module,exports){
},{"../actions/TreeActions.coffee":1,"./Async.coffee":2,"./LoadComponent.coffee":12}],17:[function(require,module,exports){
var TreeStore, Virtual, div, load, reactify, recl, ref, rele, span, walk;
recl = React.createClass;
@ -1870,7 +1898,7 @@ module.exports = _.extend(reactify, {
});
},{"../stores/TreeStore.coffee":25,"./LoadComponent.coffee":11}],17:[function(require,module,exports){
},{"../stores/TreeStore.coffee":26,"./LoadComponent.coffee":12}],18:[function(require,module,exports){
var appendNext, recl, rele, waitingScripts;
recl = React.createClass;
@ -1917,7 +1945,7 @@ module.exports = recl({
});
},{}],18:[function(require,module,exports){
},{}],19:[function(require,module,exports){
var a, div, input, query, reactify, recl, ref,
slice = [].slice;
@ -2055,7 +2083,7 @@ module.exports = query({
}));
},{"./Async.coffee":2,"./Reactify.coffee":16}],19:[function(require,module,exports){
},{"./Async.coffee":2,"./Reactify.coffee":17}],20:[function(require,module,exports){
var a, clas, li, query, reactify, recl, ref, ul, util;
util = require('../utils/util.coffee');
@ -2073,7 +2101,6 @@ ref = React.DOM, ul = ref.ul, li = ref.li, a = ref.a;
module.exports = query({
path: 't',
kids: {
snip: 'r',
head: 'r',
meta: 'j'
}
@ -2140,7 +2167,7 @@ module.exports = query({
}));
},{"../utils/util.coffee":27,"./Async.coffee":2,"./Reactify.coffee":16,"classnames":28}],20:[function(require,module,exports){
},{"../utils/util.coffee":28,"./Async.coffee":2,"./Reactify.coffee":17,"classnames":29}],21:[function(require,module,exports){
var div, query, reactify, recl,
slice = [].slice;
@ -2277,7 +2304,7 @@ module.exports = query({
}));
},{"./Async.coffee":2,"./Reactify.coffee":16}],21:[function(require,module,exports){
},{"./Async.coffee":2,"./Reactify.coffee":17}],22:[function(require,module,exports){
var body, clas, div, head, query, recf, recl;
query = require('./Async.coffee');
@ -2320,7 +2347,7 @@ module.exports = query({
}));
},{"./Async.coffee":2,"./BodyComponent.coffee":3,"./NavComponent.coffee":13,"classnames":28}],22:[function(require,module,exports){
},{"./Async.coffee":2,"./BodyComponent.coffee":3,"./NavComponent.coffee":14,"classnames":29}],23:[function(require,module,exports){
module.exports = _.extend(new Flux.Dispatcher(), {
handleServerAction: function(action) {
return this.dispatch({
@ -2337,7 +2364,7 @@ module.exports = _.extend(new Flux.Dispatcher(), {
});
},{}],23:[function(require,module,exports){
},{}],24:[function(require,module,exports){
var rend;
rend = ReactDOM.render;
@ -2354,6 +2381,9 @@ $(function() {
frag = util.fragpath(window.location.pathname.replace(/\.[^\/]*$/, ''));
window.tree.actions.setCurr(frag);
window.tree.actions.loadPath(frag, window.tree.data);
if (window.tree.sein != null) {
window.tree.actions.loadSein(frag, window.tree.sein);
}
window.urb.ondataupdate = function(dep) {
var dat;
for (dat in window.urb.datadeps) {
@ -2366,7 +2396,7 @@ $(function() {
});
},{"./actions/TreeActions.coffee":1,"./components/Components.coffee":6,"./components/TreeComponent.coffee":21,"./utils/scroll.coffee":26,"./utils/util.coffee":27}],24:[function(require,module,exports){
},{"./actions/TreeActions.coffee":1,"./components/Components.coffee":6,"./components/TreeComponent.coffee":22,"./utils/scroll.coffee":27,"./utils/util.coffee":28}],25:[function(require,module,exports){
var dedup, pending, util, waspWait;
util = require('../utils/util.coffee');
@ -2452,7 +2482,7 @@ module.exports = {
};
},{"../utils/util.coffee":27}],25:[function(require,module,exports){
},{"../utils/util.coffee":28}],26:[function(require,module,exports){
var EventEmitter, MessageDispatcher, QUERIES, TreeStore, _curr, _data, _nav, _tree, _virt, clog;
EventEmitter = require('events').EventEmitter.EventEmitter;
@ -2516,17 +2546,17 @@ TreeStore = _.extend((new EventEmitter).setMaxListeners(50), {
}
data[k] = have[k];
}
if (query.kids) {
if (have.kids === false) {
data.kids = {};
} else {
for (k in tree) {
sub = tree[k];
if (data.kids == null) {
data.kids = {};
}
data.kids[k] = this.fulfillAt(sub, path + "/" + k, query.kids);
}
if (query.kids) {
if ((have != null ? have.kids : void 0) === false) {
data.kids = {};
} else {
for (k in tree) {
sub = tree[k];
if (data.kids == null) {
data.kids = {};
}
data.kids[k] = this.fulfillAt(sub, path + "/" + k, query.kids);
}
}
}
@ -2574,13 +2604,24 @@ TreeStore = _.extend((new EventEmitter).setMaxListeners(50), {
_data = {};
return _tree = {};
},
loadSein: function(arg) {
var data, path, sein;
path = arg.path, data = arg.data;
sein = this.getPare(path);
if (sein != null) {
return this.loadPath({
path: sein,
data: data
});
}
},
loadPath: function(arg) {
var data, path;
path = arg.path, data = arg.data;
return this.loadValues(this.getTree(path.split('/'), true), path, data);
},
loadValues: function(tree, path, data) {
var k, old, ref, ref1, v;
var _path, k, old, ref, ref1, v;
old = (ref = _data[path]) != null ? ref : {};
for (k in data) {
if (QUERIES[k]) {
@ -2593,7 +2634,11 @@ TreeStore = _.extend((new EventEmitter).setMaxListeners(50), {
if (tree[k] == null) {
tree[k] = {};
}
this.loadValues(tree[k], path + "/" + k, v);
_path = path;
if (_path === "/") {
_path = "";
}
this.loadValues(tree[k], _path + "/" + k, v);
}
if (data.kids && _.isEmpty(data.kids)) {
old.kids = false;
@ -2621,6 +2666,9 @@ TreeStore = _.extend((new EventEmitter).setMaxListeners(50), {
tree = _tree;
for (i = 0, len = _path.length; i < len; i++) {
sub = _path[i];
if (!sub) {
continue;
}
if (tree[sub] == null) {
if (!make) {
return null;
@ -2726,7 +2774,7 @@ TreeStore.dispatchToken = MessageDispatcher.register(function(p) {
module.exports = TreeStore;
},{"../dispatcher/Dispatcher.coffee":22,"events":29}],26:[function(require,module,exports){
},{"../dispatcher/Dispatcher.coffee":23,"events":30}],27:[function(require,module,exports){
var scroll;
scroll = {
@ -2820,7 +2868,7 @@ scroll.init();
module.exports = scroll;
},{}],27:[function(require,module,exports){
},{}],28:[function(require,module,exports){
var _basepath;
_basepath = window.urb.util.basepath("/");
@ -2869,7 +2917,7 @@ module.exports = {
};
},{}],28:[function(require,module,exports){
},{}],29:[function(require,module,exports){
/*!
Copyright (c) 2016 Jed Watson.
Licensed under the MIT License (MIT), see
@ -2919,7 +2967,7 @@ module.exports = {
}
}());
},{}],29:[function(require,module,exports){
},{}],30:[function(require,module,exports){
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
@ -3219,4 +3267,4 @@ function isUndefined(arg) {
return arg === void 0;
}
},{}]},{},[23]);
},{}]},{},[24]);