mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-28 17:00:04 +02:00
tried to port one more, broke on events instantiation
This commit is contained in:
parent
8d2803e4e4
commit
6327566a63
6 changed files with 2055 additions and 32 deletions
2044
build/bundle.js
2044
build/bundle.js
File diff suppressed because it is too large
Load diff
|
@ -1,5 +1,6 @@
|
||||||
var Commit = require('./git').Commit;
|
var Commit = require('./git').Commit;
|
||||||
var Branch = require('./git').Branch;
|
var Branch = require('./git').Branch;
|
||||||
|
var events = require('./main').events;
|
||||||
|
|
||||||
var CommitCollection = Backbone.Collection.extend({
|
var CommitCollection = Backbone.Collection.extend({
|
||||||
model: Commit
|
model: Commit
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
var animationFactory = new require('./animationFactory').AnimationFactory();
|
var AnimationFactoryModule = require('./animationFactory');
|
||||||
console.log('this is what animatioinf actory is', require('./animationFactory'));
|
var animationFactory = new AnimationFactoryModule.AnimationFactory();
|
||||||
|
|
||||||
// backbone or something uses _.uniqueId, so we make our own here
|
// backbone or something uses _.uniqueId, so we make our own here
|
||||||
var uniqueId = (function() {
|
var uniqueId = (function() {
|
||||||
|
|
|
@ -144,7 +144,7 @@
|
||||||
<!-- vis -->
|
<!-- vis -->
|
||||||
<!-- <script src="collections.js"></script> -->
|
<!-- <script src="collections.js"></script> -->
|
||||||
<!-- <script src="visuals.js"></script> -->
|
<!-- <script src="visuals.js"></script> -->
|
||||||
<script src="tree.js"></script>
|
<!-- <script src="tree.js"></script> -->
|
||||||
<!--<script src="animationFactory.js"></script> -->
|
<!--<script src="animationFactory.js"></script> -->
|
||||||
|
|
||||||
<!-- levels -->
|
<!-- levels -->
|
||||||
|
@ -153,9 +153,6 @@
|
||||||
<!-- on ready -->
|
<!-- on ready -->
|
||||||
<!-- <script src="main.js"></script> -->
|
<!-- <script src="main.js"></script> -->
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
var events = _.clone(Backbone.Events);
|
|
||||||
</script>
|
|
||||||
<!-- build -->
|
<!-- build -->
|
||||||
<script src="../build/bundle.js"></script>
|
<script src="../build/bundle.js"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|
14
src/tree.js
14
src/tree.js
|
@ -1,3 +1,9 @@
|
||||||
|
var randomHueString = function() {
|
||||||
|
var hue = Math.random();
|
||||||
|
var str = 'hsb(' + String(hue) + ',0.7,1)';
|
||||||
|
return str;
|
||||||
|
};
|
||||||
|
|
||||||
var VisBase = Backbone.Model.extend({
|
var VisBase = Backbone.Model.extend({
|
||||||
removeKeys: function(keys) {
|
removeKeys: function(keys) {
|
||||||
_.each(keys, function(key) {
|
_.each(keys, function(key) {
|
||||||
|
@ -949,3 +955,11 @@ var VisEdgeCollection = Backbone.Collection.extend({
|
||||||
var VisBranchCollection = Backbone.Collection.extend({
|
var VisBranchCollection = Backbone.Collection.extend({
|
||||||
model: VisBranch
|
model: VisBranch
|
||||||
});
|
});
|
||||||
|
|
||||||
|
exports.VisEdgeCollection = VisEdgeCollection;
|
||||||
|
exports.VisBranchCollection = VisBranchCollection;
|
||||||
|
exports.VisNode = VisNode;
|
||||||
|
exports.VisEdge = VisEdge;
|
||||||
|
exports.VisBranch = VisBranch;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,16 @@
|
||||||
var CommitCollection = require('./collections').CommitCollection;
|
var Collections = require('./collections');
|
||||||
var BranchCollection = require('./collections').BranchCollection;
|
var CommitCollection = Collections.CommitCollection;
|
||||||
|
var BranchCollection = Collections.BranchCollection;
|
||||||
|
|
||||||
var GitEngine = require('./git').GitEngine;
|
var GitEngine = require('./git').GitEngine;
|
||||||
|
|
||||||
|
var Tree = require('./tree');
|
||||||
|
var VisEdgeCollection = Tree.VisEdgeCollection;
|
||||||
|
var VisBranchCollection = Tree.VisBranchCollection;
|
||||||
|
var VisNode = Tree.VisNode;
|
||||||
|
var VisBranch = Tree.VisBranch;
|
||||||
|
var VisEdge = Tree.VisEdge;
|
||||||
|
|
||||||
var Visualization = Backbone.View.extend({
|
var Visualization = Backbone.View.extend({
|
||||||
initialize: function(options) {
|
initialize: function(options) {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
|
@ -665,11 +674,5 @@ function blendHueStrings(hueStrings) {
|
||||||
return 'hsb(' + String(hue) + ',' + String(totalSat) + ',' + String(totalBright) + ')';
|
return 'hsb(' + String(hue) + ',' + String(totalSat) + ',' + String(totalBright) + ')';
|
||||||
}
|
}
|
||||||
|
|
||||||
function randomHueString() {
|
|
||||||
var hue = Math.random();
|
|
||||||
var str = 'hsb(' + String(hue) + ',0.7,1)';
|
|
||||||
return str;
|
|
||||||
};
|
|
||||||
|
|
||||||
exports.Visualization = Visualization;
|
exports.Visualization = Visualization;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue