mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-27 00:18:56 +02:00
ok with grunt
This commit is contained in:
parent
efc67cbff2
commit
f7e5e5ac71
7 changed files with 27619 additions and 5 deletions
27567
build/bundle.js
Normal file
27567
build/bundle.js
Normal file
File diff suppressed because it is too large
Load diff
|
@ -15924,7 +15924,9 @@ var VisNode = VisBase.extend({
|
|||
remove: function() {
|
||||
this.removeKeys(['circle'], ['text']);
|
||||
// needs a manual removal of text for whatever reason
|
||||
this.get('text').remove();
|
||||
if (this.get('text')) {
|
||||
this.get('text').remove();
|
||||
}
|
||||
|
||||
this.gitVisuals.removeVisNode(this);
|
||||
},
|
|
@ -402,7 +402,7 @@
|
|||
For a much easier time perusing the source, see the individual files at:
|
||||
https://github.com/pcottle/learnGitBranching
|
||||
-->
|
||||
<script src="build/bundle2.js"></script>
|
||||
<script src="build/bundle.js"></script>
|
||||
|
||||
<!-- The advantage of github pages: super-easy, simple, slick static hostic.
|
||||
The downside? No raw logs to parse for analytics, so I have to include
|
||||
|
|
45
src/js/visuals/visBase.js
Normal file
45
src/js/visuals/visBase.js
Normal file
|
@ -0,0 +1,45 @@
|
|||
var _ = require('underscore');
|
||||
var Backbone = require('backbone');
|
||||
|
||||
var VisBase = Backbone.Model.extend({
|
||||
removeKeys: function(keys) {
|
||||
_.each(keys, function(key) {
|
||||
if (this.get(key)) {
|
||||
this.get(key).remove();
|
||||
}
|
||||
}, this);
|
||||
},
|
||||
|
||||
animateAttrKeys: function(keys, attrObj, speed, easing) {
|
||||
// either we animate a specific subset of keys or all
|
||||
// possible things we could animate
|
||||
keys = _.extend(
|
||||
{},
|
||||
{
|
||||
include: ['circle', 'arrow', 'rect', 'path', 'text'],
|
||||
exclude: []
|
||||
},
|
||||
keys || {}
|
||||
);
|
||||
|
||||
var attr = this.getAttributes();
|
||||
|
||||
// safely insert this attribute into all the keys we want
|
||||
_.each(keys.include, function(key) {
|
||||
attr[key] = _.extend(
|
||||
{},
|
||||
attr[key],
|
||||
attrObj
|
||||
);
|
||||
});
|
||||
|
||||
_.each(keys.exclude, function(key) {
|
||||
delete attr[key];
|
||||
});
|
||||
|
||||
this.animateToAttr(attr, speed, easing);
|
||||
}
|
||||
});
|
||||
|
||||
exports.VisBase = VisBase;
|
||||
|
|
@ -2,7 +2,7 @@ var _ = require('underscore');
|
|||
var Backbone = require('backbone');
|
||||
var GRAPHICS = require('../util/constants').GRAPHICS;
|
||||
|
||||
var VisBase = require('../visuals/tree').VisBase;
|
||||
var VisBase = require('../visuals/visBase').VisBase;
|
||||
|
||||
var randomHueString = function() {
|
||||
var hue = Math.random();
|
||||
|
|
|
@ -2,7 +2,7 @@ var _ = require('underscore');
|
|||
var Backbone = require('backbone');
|
||||
var GRAPHICS = require('../util/constants').GRAPHICS;
|
||||
|
||||
var VisBase = require('../visuals/tree').VisBase;
|
||||
var VisBase = require('../visuals/visBase').VisBase;
|
||||
|
||||
var VisEdge = VisBase.extend({
|
||||
defaults: {
|
||||
|
|
|
@ -2,7 +2,7 @@ var _ = require('underscore');
|
|||
var Backbone = require('backbone');
|
||||
var GRAPHICS = require('../util/constants').GRAPHICS;
|
||||
|
||||
var VisBase = require('../visuals/tree').VisBase;
|
||||
var VisBase = require('../visuals/visBase').VisBase;
|
||||
|
||||
var VisNode = VisBase.extend({
|
||||
defaults: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue