Created
June 22, 2012 04:49
-
-
Save roundrobin/2970283 to your computer and use it in GitHub Desktop.
just another inlet to tributary
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log('sdf') | |
//Dont change Line below | |
// Parameters | |
var text = $('.CodeMirror-lines div > div pre').html() | |
console.log('Hello',text) | |
var text = $('.CodeMirror-lines div > div pre:first-child') | |
text.append('') | |
g.append('text') | |
.attr('y',200) | |
.attr('x',100) | |
.attr('id','pathWay') | |
.text(text) | |
var callback = function(){ | |
var text = $('.CodeMirror-lines div > div pre:first-child').html('ssdfsd') | |
} | |
var button1 = createButton('Click Me', callback) | |
.attr('transform','translate('+[408,100]+')') | |
var callback2 = function(){ | |
var text = $('.CodeMirror-lines div > div pre:first-child').html(' ') | |
} | |
var button2 = createButton('Click Me', callback2) | |
.attr('transform','translate('+[117,100]+')') | |
function createButton(name,callback){ | |
var buttonGroup = g.append('g') | |
var rect = buttonGroup.append('rect') | |
.attr('width',122) | |
.attr('height',45) | |
.attr('fill',"#922F2F") | |
.on('click',callback) | |
var text = buttonGroup.append('text') | |
.attr('id','pathWay') | |
.attr('dominant-baseline','hanging') | |
.attr('font-size','30') | |
.text(name) | |
.attr('transform','translate('+[10,9]+')') | |
var textLength = text.node().getBBox().width; | |
rect.attr('width',textLength+20) | |
return buttonGroup; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment