Showing
13 changed files
with
4 additions
and
519 deletions
1 | -Well, you can tell by the way I use my walk, | ||
2 | -I'm a woman's man: no time to talk. | ||
3 | -Music loud and women warm, I've been kicked around | ||
4 | -Since I was born. | ||
5 | -And now it's all right. it's ok. | ||
6 | -And you may look the other way. | ||
7 | -We can try to understand | ||
8 | -The new york times effect on man. | ||
9 | -Whether you're a brother or whether you're a mother, | ||
10 | -You're stayin alive, stayin alive. | ||
11 | -Feel the city breakin and everybody shakin, | ||
12 | -And were stayin alive, stayin alive. | ||
13 | -Ah, ha, ha, ha, stayin alive, stayin alive. | ||
14 | -Ah, ha, ha, ha, stayin alive. | ||
15 | -Well now, I get low and I get high, | ||
16 | -And if I can't get either, I really try. | ||
17 | -Got the wings of heaven on my shoes. | ||
18 | -I'm a dancin man and I just can't lose. | ||
19 | -You know it's all right.its ok. | ||
20 | -I'll live to see another day. | ||
21 | -We can try to understand | ||
22 | -The new york times effect on man. | ||
23 | -Whether you're a brother or whether you're a mother, | ||
24 | -You're stayin alive, stayin alive. | ||
25 | -Feel the city breakin and everybody shakin, | ||
26 | -And were stayin alive, stayin alive. | ||
27 | -Ah, ha, ha, ha, stayin alive, stayin alive. | ||
28 | -Ah, ha, ha, ha, stayin alive. | ||
29 | -Life goin nowhere.somebody help me. | ||
30 | -Somebody help me, yeah. | ||
31 | -Life goin nowhere.somebody help me. | ||
32 | -Somebody help me, yeah. stayin alive. | ||
33 | -Well, you can tell by the way I use my walk, | ||
34 | -I'm a woman's man: no time to talk. | ||
35 | -Music loud and women warm, | ||
36 | -I've been kicked around since I was born. | ||
37 | -And now it's all right. it's ok. | ||
38 | -And you may look the other way. | ||
39 | -We can try to understand | ||
40 | -The new york times effect on man. | ||
41 | -Whether you're a brother or whether you're a mother, | ||
42 | -You're stayin alive, stayin alive. | ||
43 | -Feel the city breakin and everybody shakin, | ||
44 | -And were stayin alive, stayin alive. | ||
45 | -Ah, ha, ha, ha, stayin alive, stayin alive. | ||
46 | -Ah, ha, ha, ha, stayin alive. | ||
47 | -Life goin nowhere.somebody help me. | ||
48 | -Somebody help me, yeah. | ||
49 | -Life goin nowhere.somebody help me, yeah. | ||
50 | -I'm stayin alive. |
This diff is collapsed. Click to expand it.
... | @@ -3,16 +3,11 @@ | ... | @@ -3,16 +3,11 @@ |
3 | <head> | 3 | <head> |
4 | <link type="text/css" href="r/css/bootstrap-theme.css" rel="stylesheet"/> | 4 | <link type="text/css" href="r/css/bootstrap-theme.css" rel="stylesheet"/> |
5 | <link type="text/css" href="r/css/bootstrap.css" rel="stylesheet"/> | 5 | <link type="text/css" href="r/css/bootstrap.css" rel="stylesheet"/> |
6 | - <link type="text/css" href="r/css/docs.css" rel="stylesheet"/> | 6 | + <script src="r/js/jquery.min.js"></script> |
7 | - <link type="text/css" href="r/simulator.css" rel="stylesheet"/> | 7 | + <script src="r/js/jquery.periodic.js"></script> |
8 | - <link type="text/css" href="r/model.css" rel="stylesheet"/> | ||
9 | - <script src="r/jquery.min.js"></script> | ||
10 | <script src="r/js/bootstrap.min.js"></script> | 8 | <script src="r/js/bootstrap.min.js"></script> |
11 | - <script src="r/jquery.periodic.js"></script> | 9 | + <script src="r/js/d3.min.js"></script> |
12 | - <script src="r/js/bootstrap.file-input.js"></script> | 10 | + <script src="r/js/simulator.js"></script> |
13 | - <script src="r/d3.min.js"></script> | ||
14 | - <script src="r/js/petri.js"></script> | ||
15 | - <script src="r/simulator.js"></script> | ||
16 | <style> | 11 | <style> |
17 | path { stroke: steelblue; | 12 | path { stroke: steelblue; |
18 | stroke-width: 2; | 13 | stroke-width: 2; | ... | ... |
1 | -/* | ||
2 | - Bootstrap - File Input | ||
3 | - ====================== | ||
4 | - | ||
5 | - This is meant to convert all file input tags into a set of elements that displays consistently in all browsers. | ||
6 | - | ||
7 | - Converts all | ||
8 | - <input type="file"> | ||
9 | - into Bootstrap buttons | ||
10 | - <a class="btn">Browse</a> | ||
11 | - | ||
12 | -*/ | ||
13 | -$(function() { | ||
14 | - | ||
15 | -$.fn.bootstrapFileInput = function() { | ||
16 | - | ||
17 | - this.each(function(i,elem){ | ||
18 | - | ||
19 | - var $elem = $(elem); | ||
20 | - | ||
21 | - // Maybe some fields don't need to be standardized. | ||
22 | - if (typeof $elem.attr('data-bfi-disabled') != 'undefined') { | ||
23 | - return; | ||
24 | - } | ||
25 | - | ||
26 | - // Set the word to be displayed on the button | ||
27 | - var buttonWord = 'Browse'; | ||
28 | - | ||
29 | - if (typeof $elem.attr('title') != 'undefined') { | ||
30 | - buttonWord = $elem.attr('title'); | ||
31 | - } | ||
32 | - | ||
33 | - // Start by getting the HTML of the input element. | ||
34 | - // Thanks for the tip http://stackoverflow.com/a/1299069 | ||
35 | - var input = $('<div>').append( $elem.eq(0).clone() ).html(); | ||
36 | - var className = ''; | ||
37 | - | ||
38 | - if (!!$elem.attr('class')) { | ||
39 | - className = ' ' + $elem.attr('class'); | ||
40 | - } | ||
41 | - | ||
42 | - // Now we're going to replace that input field with a Bootstrap button. | ||
43 | - // The input will actually still be there, it will just be float above and transparent (done with the CSS). | ||
44 | - $elem.replaceWith('<a class="file-input-wrapper btn btn-default' + className + '">'+buttonWord+input+'</a>'); | ||
45 | - }) | ||
46 | - | ||
47 | - // After we have found all of the file inputs let's apply a listener for tracking the mouse movement. | ||
48 | - // This is important because the in order to give the illusion that this is a button in FF we actually need to move the button from the file input under the cursor. Ugh. | ||
49 | - .promise().done( function(){ | ||
50 | - | ||
51 | - // As the cursor moves over our new Bootstrap button we need to adjust the position of the invisible file input Browse button to be under the cursor. | ||
52 | - // This gives us the pointer cursor that FF denies us | ||
53 | - $('.file-input-wrapper').mousemove(function(cursor) { | ||
54 | - | ||
55 | - var input, wrapper, | ||
56 | - wrapperX, wrapperY, | ||
57 | - inputWidth, inputHeight, | ||
58 | - cursorX, cursorY; | ||
59 | - | ||
60 | - // This wrapper element (the button surround this file input) | ||
61 | - wrapper = $(this); | ||
62 | - // The invisible file input element | ||
63 | - input = wrapper.find("input"); | ||
64 | - // The left-most position of the wrapper | ||
65 | - wrapperX = wrapper.offset().left; | ||
66 | - // The top-most position of the wrapper | ||
67 | - wrapperY = wrapper.offset().top; | ||
68 | - // The with of the browsers input field | ||
69 | - inputWidth= input.width(); | ||
70 | - // The height of the browsers input field | ||
71 | - inputHeight= input.height(); | ||
72 | - //The position of the cursor in the wrapper | ||
73 | - cursorX = cursor.pageX; | ||
74 | - cursorY = cursor.pageY; | ||
75 | - | ||
76 | - //The positions we are to move the invisible file input | ||
77 | - // The 20 at the end is an arbitrary number of pixels that we can shift the input such that cursor is not pointing at the end of the Browse button but somewhere nearer the middle | ||
78 | - moveInputX = cursorX - wrapperX - inputWidth + 20; | ||
79 | - // Slides the invisible input Browse button to be positioned middle under the cursor | ||
80 | - moveInputY = cursorY- wrapperY - (inputHeight/2); | ||
81 | - | ||
82 | - // Apply the positioning styles to actually move the invisible file input | ||
83 | - input.css({ | ||
84 | - left:moveInputX, | ||
85 | - top:moveInputY | ||
86 | - }); | ||
87 | - }); | ||
88 | - | ||
89 | - $('.file-input-wrapper input[type=file]').change(function(){ | ||
90 | - | ||
91 | - var fileName; | ||
92 | - fileName = $(this).val(); | ||
93 | - | ||
94 | - // Remove any previous file names | ||
95 | - $(this).parent().next('.file-input-name').remove(); | ||
96 | - if (!!$(this).prop('files') && $(this).prop('files').length > 1) { | ||
97 | - fileName = $(this)[0].files.length+' files'; | ||
98 | - //$(this).parent().after('<span class="file-input-name">'+$(this)[0].files.length+' files</span>'); | ||
99 | - } | ||
100 | - else { | ||
101 | - // var fakepath = 'C:\\fakepath\\'; | ||
102 | - // fileName = $(this).val().replace('C:\\fakepath\\',''); | ||
103 | - fileName = fileName.substring(fileName.lastIndexOf('\\')+1,fileName.length); | ||
104 | - } | ||
105 | - | ||
106 | - $(this).parent().after('<span class="file-input-name">'+fileName+'</span>'); | ||
107 | - }); | ||
108 | - | ||
109 | - }); | ||
110 | - | ||
111 | -}; | ||
112 | - | ||
113 | -// Add the styles before the first stylesheet | ||
114 | -// This ensures they can be easily overridden with developer styles | ||
115 | -var cssHtml = '<style>'+ | ||
116 | - '.file-input-wrapper { overflow: hidden; position: relative; cursor: pointer; z-index: 1; }'+ | ||
117 | - '.file-input-wrapper input[type=file], .file-input-wrapper input[type=file]:focus, .file-input-wrapper input[type=file]:hover { position: absolute; top: 0; left: 0; cursor: pointer; opacity: 0; filter: alpha(opacity=0); z-index: 99; outline: 0; }'+ | ||
118 | - '.file-input-name { margin-left: 8px; }'+ | ||
119 | - '</style>'; | ||
120 | -$('link[rel=stylesheet]').eq(0).before(cssHtml); | ||
121 | - | ||
122 | -}); | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
File moved
1 | -$(document).ready(function(){ | ||
2 | - $(".abcd .action, .abcd .instance").each(function(){ | ||
3 | - var objet = this; | ||
4 | - $(".action, .instance").each(function(){ | ||
5 | - if ($(this).attr("data-abcd") == "#" + $(objet).attr("id")){ | ||
6 | - $(this).html($(objet).html()); | ||
7 | - } | ||
8 | - }); | ||
9 | - }); | ||
10 | - | ||
11 | - $(".action, .instance, .buffer, .proto").mouseover(function(){ | ||
12 | - | ||
13 | - $(this).addClass("highlight_simul"); | ||
14 | - $($(this).attr("data-abcd")).addClass("highlight_simul"); | ||
15 | - $($(this).attr("data-tree")).addClass("highlight_simul"); | ||
16 | - $($(this).attr("data-net")).addClass("highlight_simul"); | ||
17 | - | ||
18 | - }).mouseout(function(){ | ||
19 | - | ||
20 | - $(this).removeClass("highlight_simul"); | ||
21 | - $($(this).attr("data-abcd")).removeClass("highlight_simul"); | ||
22 | - $($(this).attr("data-tree")).removeClass("highlight_simul"); | ||
23 | - $($(this).attr("data-net")).removeClass("highlight_simul"); | ||
24 | - | ||
25 | - }); | ||
26 | -}); | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | -/* ABCD source code */ | ||
2 | - | ||
3 | -#model .abcd .comment { | ||
4 | - color: #888; | ||
5 | -} | ||
6 | - | ||
7 | -#model .abcd .ident { | ||
8 | - color: #808; | ||
9 | -} | ||
10 | - | ||
11 | -#model .abcd .string { | ||
12 | - color: #088; | ||
13 | -} | ||
14 | - | ||
15 | -#model .abcd .kw { | ||
16 | - color: #800; | ||
17 | - font-weight: bold; | ||
18 | -} | ||
19 | - | ||
20 | -#model .abcd .flow { | ||
21 | - color: #800; | ||
22 | - font-weight: bold; | ||
23 | -} | ||
24 | - | ||
25 | -#model .abcd .buffer .decl { | ||
26 | - color: #080; | ||
27 | - font-weight: bold; | ||
28 | -} | ||
29 | - | ||
30 | -#model .abcd .net .decl { | ||
31 | - color: #008; | ||
32 | - font-weight: bold; | ||
33 | -} | ||
34 | - | ||
35 | -#model .abcd .instance .name { | ||
36 | - color: #008; | ||
37 | -} | ||
38 | - | ||
39 | -#model .abcd .action .delim { | ||
40 | - font-weight: bold; | ||
41 | -} | ||
42 | - | ||
43 | -#model .abcd .action .name { | ||
44 | - color: #080; | ||
45 | -} | ||
46 | - | ||
47 | -#model .abcd .active { | ||
48 | - background-color: #B6F8AE; | ||
49 | -} | ||
50 | - | ||
51 | -#model .abcd .highlight_simul { | ||
52 | - background-color: yellow; | ||
53 | -} | ||
54 | - | ||
55 | - | ||
56 | -#model .tree .buffer .kw { | ||
57 | - color: #800; | ||
58 | - font-weight: bold; | ||
59 | -} | ||
60 | - | ||
61 | -#model .tree .buffer .name { | ||
62 | - color: #080; | ||
63 | - font-weight: bold; | ||
64 | -} | ||
65 | - | ||
66 | -#model .tree .ident { | ||
67 | - color: #808; | ||
68 | -} | ||
69 | - | ||
70 | -#model .tree .instance .name { | ||
71 | - color: #008; | ||
72 | -} | ||
73 | - | ||
74 | -#model .tree .action .delim { | ||
75 | - font-weight: bold; | ||
76 | -} | ||
77 | - | ||
78 | -#model .tree .action .name { | ||
79 | - color: #080; | ||
80 | -} | ||
81 | - | ||
82 | -#model .tree .string { | ||
83 | - color: #088; | ||
84 | -} | ||
85 | - | ||
86 | -#model .tree .modes li { | ||
87 | - margin: 12px 0px; | ||
88 | -} | ||
89 | - | ||
90 | -#model .tree .modes a { | ||
91 | - background-color: #B6F8AE; | ||
92 | - border: solid 1px #AAA; | ||
93 | - border-radius: 5px; | ||
94 | - padding: 5px 10px; | ||
95 | - text-decoration: none; | ||
96 | - color: #333; | ||
97 | -} | ||
98 | - | ||
99 | -#model .tree .modes a:hover { | ||
100 | - color: #A33; | ||
101 | - background-color: #F8B6AE; | ||
102 | -} | ||
103 | - | ||
104 | -#model .tree .active { | ||
105 | - background-color: #B6F8AE; | ||
106 | -} | ||
107 | - | ||
108 | -#model .tree .highlight_simul { | ||
109 | - background-color: yellow; | ||
110 | -} | ||
111 | - | ||
112 | - |
snakes/utils/andy/resources/model.js
deleted
100644 → 0
1 | -var nodeColor; | ||
2 | - | ||
3 | -function abcdon () { | ||
4 | - obj = $(this); | ||
5 | - if (obj.attr("class") == "node") { | ||
6 | - node = obj.children().children().first(); | ||
7 | - nodeColor = node.attr("fill"); | ||
8 | - node.attr("fill", "yellow"); | ||
9 | - } else { | ||
10 | - obj.addClass("highlight"); | ||
11 | - } | ||
12 | - $(obj.attr("data-abcd")).addClass("highlight"); | ||
13 | -}; | ||
14 | - | ||
15 | -function abcdoff () { | ||
16 | - obj = $(this); | ||
17 | - if (obj.attr("class") == "node") { | ||
18 | - node = obj.children().children().first(); | ||
19 | - node.attr("fill", nodeColor); | ||
20 | - } else { | ||
21 | - obj.removeClass("highlight"); | ||
22 | - } | ||
23 | - $(obj.attr("data-abcd")).removeClass("highlight"); | ||
24 | -}; | ||
25 | - | ||
26 | -function treeon () { | ||
27 | - obj = $(this); | ||
28 | - if (obj.attr("class") != "node") { | ||
29 | - obj.addClass("highlight"); | ||
30 | - } | ||
31 | - $(obj.attr("data-tree")).addClass("highlight"); | ||
32 | -}; | ||
33 | - | ||
34 | -function treeoff () { | ||
35 | - obj = $(this); | ||
36 | - if (obj.attr("class") != "node") { | ||
37 | - obj.removeClass("highlight"); | ||
38 | - } | ||
39 | - $(obj.attr("data-tree")).removeClass("highlight"); | ||
40 | -}; | ||
41 | - | ||
42 | -function neton () { | ||
43 | - obj = $(this); | ||
44 | - $(obj.attr("data-net")).each(function () { | ||
45 | - node = $(this).children().children().first(); | ||
46 | - nodeColor = node.attr("fill"); | ||
47 | - node.attr("fill", "yellow"); | ||
48 | - }); | ||
49 | - obj.addClass("highlight"); | ||
50 | -}; | ||
51 | - | ||
52 | -function netoff () { | ||
53 | - obj = $(this); | ||
54 | - $(obj.attr("data-net")).each(function () { | ||
55 | - node = $(this).children().children().first(); | ||
56 | - node.attr("fill", nodeColor); | ||
57 | - }); | ||
58 | - obj.removeClass("highlight"); | ||
59 | -}; | ||
60 | - | ||
61 | -$(document).ready(function() { | ||
62 | - $("#model [data-abcd]").hover(abcdon, abcdoff); | ||
63 | - $("#model [data-tree]").hover(treeon, treeoff); | ||
64 | - $("#model [data-net]").hover(neton, netoff); | ||
65 | - $(".tree .instance, .tree .action").each(function () { | ||
66 | - obj = $(this); | ||
67 | - obj.html($(obj.attr("data-abcd")).html()); | ||
68 | - }); | ||
69 | -}); |
1 | -body { | ||
2 | - font-family: sans-serif; | ||
3 | -} | ||
4 | - | ||
5 | -#alive { | ||
6 | - border: solid 1px #AAA; | ||
7 | - border-radius: 5px; | ||
8 | - padding: 5px 10px; | ||
9 | - margin: 5px; | ||
10 | - background-color: #DDD; | ||
11 | - overflow:auto; | ||
12 | -} | ||
13 | - | ||
14 | -#alive .ui { | ||
15 | - display: inline; | ||
16 | - list-style: none; | ||
17 | - margin: 0px; | ||
18 | - padding: 0px; | ||
19 | -} | ||
20 | - | ||
21 | -#alive .ui li { | ||
22 | - display: inline; | ||
23 | - border: solid 1px #AAA; | ||
24 | - padding: 5px 10px; | ||
25 | - margin: 0px 3px; | ||
26 | - background-color: #EEE; | ||
27 | -} | ||
28 | - | ||
29 | -#alive .ui a { | ||
30 | - text-decoration: none; | ||
31 | - color: #333; | ||
32 | -} | ||
33 | - | ||
34 | -#alive .ui li:hover { | ||
35 | - background-color: #FFF; | ||
36 | -} | ||
37 | - | ||
38 | -#alive .ui a:hover { | ||
39 | - color: #A33; | ||
40 | -} | ||
41 | - | ||
42 | -#alive .ping { | ||
43 | - color: #DDD; | ||
44 | - float: right; | ||
45 | -} | ||
46 | - | ||
47 | -#model { | ||
48 | - border: solid 1px #AAA; | ||
49 | - border-radius: 5px; | ||
50 | - padding: 5px 10px; | ||
51 | - margin: 5px; | ||
52 | - background-color: #EEE; | ||
53 | - overflow:auto; | ||
54 | -} | ||
55 | - | ||
56 | -#trace { | ||
57 | - border: solid 1px #AAA; | ||
58 | - border-radius: 5px; | ||
59 | - padding: 5px 10px; | ||
60 | - margin: 5px; | ||
61 | - background-color: #EEE; | ||
62 | - overflow:auto; | ||
63 | -} | ||
64 | - | ||
65 | -#about { | ||
66 | - display: none; | ||
67 | -} | ||
68 | - | ||
69 | -#dialog { | ||
70 | - display: none; | ||
71 | - position: fixed; | ||
72 | - z-index: 2; | ||
73 | - top: 10%; | ||
74 | - left: 20%; | ||
75 | - width: 60%; | ||
76 | - border: solid 2px #AAA; | ||
77 | - border-radius: 5px; | ||
78 | - padding: 20px; | ||
79 | - background-color: #FFF; | ||
80 | - overflow:auto; | ||
81 | -} | ||
82 | - | ||
83 | -#dialog-bg { | ||
84 | - display: none; | ||
85 | - position: fixed; | ||
86 | - z-index: 1; | ||
87 | - top: 0px; | ||
88 | - left: 0px; | ||
89 | - width: 100%; | ||
90 | - height: 100%; | ||
91 | - background-color: #000; | ||
92 | - margin: 0px; | ||
93 | -} | ||
94 | - | ||
95 | -#dialog-close { | ||
96 | - /* TODO: fix position when dialog has a horizontal scrollbar */ | ||
97 | - display: block; | ||
98 | - float: right; | ||
99 | - border: solid 1px #AAA; | ||
100 | - padding: 5px 10px; | ||
101 | - margin: 0px 3px; | ||
102 | - background-color: #EEE; | ||
103 | - text-decoration: none; | ||
104 | - color: #333; | ||
105 | -} | ||
106 | - | ||
107 | -#dialog-close:hover { | ||
108 | - background-color: #FFF; | ||
109 | - color: #A33; | ||
110 | -} | ||
111 | - | ||
112 | -.dialog p { | ||
113 | - margin: 10px 20px 0px 20px; | ||
114 | -} | ||
115 | - | ||
116 | -.dialog .title { | ||
117 | - margin: 0px 20px 5px 20px; | ||
118 | - font-weight: bold; | ||
119 | - text-align: center; | ||
120 | -} | ||
121 | - | ||
122 | -.dialog .subtitle { | ||
123 | - margin: 0px 20px 5px 20px; | ||
124 | - text-align: center; | ||
125 | -} | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
-
Please register or login to post a comment