neerajdotname-javascript_lab 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,16 @@
1
+ body { font-family: 'Franklin Gothic', 'Franklin Gothic Medium',
2
+ Helvetica, sans-serif; background: #f6efe1; margin: 0px; padding: 0px;
3
+ text-align: left; line-height: 16px; } a:link, a:visited { color:
4
+ #ba2818; text-decoration: none; } a:hover { text-decoration: underline;
5
+ } a img { border: none; } ul.nav li { display: inline; list-style-type:
6
+ none; padding: 0px 4px 0px 4px; } #container { background: #FDF8F4;
7
+ margin: 5px auto; text-align: left; width: 980px; } #main { padding: 5px
8
+ 10px 5px 10px; } #main .lhs { float: left; width: 540px; } #main .rhs {
9
+ float: right; background: #F5DFAC; width: 325px; padding: 5px; margin:
10
+ 80px 0px 0px 0px; } #header { background: #efefef; padding: 21px; }
11
+ .gem_name { font-size: 35px; float: left; } .extra { float: right;
12
+ font-size: 16px; } form p textarea { font-size: 14px; padding: 2px;
13
+ margin: 2px; } form p select { line-height: 50px; width: auto;
14
+ text-align: left; padding: 2px; font-size: 16px; } form p label {
15
+ margin: 2px; } form p span { color: gray; } #log_output div { margin:
16
+ 4px 0px 4px 0px; color: gray; } #log_output div span { color: red; }
data/views/index.erb ADDED
@@ -0,0 +1,68 @@
1
+
2
+
3
+ <div>
4
+ <div class='lhs'>
5
+ <form action='#' name='lab'>
6
+ <p>
7
+ <select name='javascript_library' onchange="location = this.options[this.selectedIndex].value">
8
+ <option value=''>please select </option>
9
+ <option value=''> </option>
10
+ <optgroup label='jQuery'>
11
+ <%=create_option('jquery-1.3.2.min','jQuery 1.3.2')%>
12
+ <%=create_option('jquery-1.3.1.min','jQuery 1.3.1')%>
13
+ <%=create_option('jquery-1.3.min','jQuery 1.3')%>
14
+ <%=create_option('jquery-1.2.6.min','jQuery 1.2.6')%>
15
+ <%=create_option('jquery-1.2.5.min','jQuery 1.2.5')%>
16
+ <%=create_option('jquery-1.2.4.min','jQuery 1.2.4')%>
17
+ <%=create_option('jquery-1.2.3.min','jQuery 1.2.3')%>
18
+ <%=create_option('jquery-1.2.2.min','jQuery 1.2.2')%>
19
+ </optgroup>
20
+ <option value=''> </option>
21
+ <optgroup label='Prototype'>
22
+ <%=create_option('prototype-1.6.0.3','prototype 1.6.0.3')%>
23
+ <%=create_option('prototype-1.6.0.2','prototype 1.6.0.2')%>
24
+ <%=create_option('prototype-1.6','prototype 1.6')%>
25
+ <%=create_option('prototype-1.5.1.2','prototype 1.5.1.2')%>
26
+ <%=create_option('prototype-1.5.1.1','prototype 1.5.1.1')%>
27
+ <%=create_option('prototype-1.5.1','prototype 1.5.1')%>
28
+ <%=create_option('prototype-1.5','prototype 1.5')%>
29
+ </optgroup>
30
+ </select>
31
+ </p>
32
+ <% unless params[:j].nil? %>
33
+ <p>
34
+ <label class='label'>
35
+ javascript code
36
+ </label>
37
+ <span class='light'>Use log('hello world') to show log in the log output</span>
38
+ <br />
39
+ <textarea name='javascript_code' row='5' cols='70'></textarea>
40
+ </p>
41
+ <p>
42
+ <label class='label'>JSON data</label>
43
+ <br />
44
+ <span class='light'> Use this box if you are trying to parse JSON data. The content
45
+ entered in this box will be available to the javascript_code box above as variable
46
+ json_data. Please note that variable json_data is not in JSON format. It is the data
47
+ entered in this box in string format.
48
+ </span>
49
+ <br />
50
+ <textarea name='json_data' row='5' cols='70'></textarea>
51
+ </p>
52
+ <p>
53
+ <input class='submit' type='submit' value='Evaluate' onclick='processForm();return false;' />
54
+ </p>
55
+ <% end %>
56
+ </form>
57
+ </div>
58
+ <% unless params[:j].nil? %>
59
+ <div class='rhs'>
60
+ <strong>Log output</strong>
61
+ <a href='#' onclick='clear_log();return false;'>(clear log)</a>
62
+
63
+ <div id='log_output'>
64
+ </div>
65
+ </div>
66
+ <% end %>
67
+ <div style='clear:both;'></div>
68
+ </div>
data/views/layout.erb ADDED
@@ -0,0 +1,36 @@
1
+ <html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'>
2
+ <head>
3
+ <meta content='text/html; charset=utf-8' http-equiv='Content-Type' />
4
+ <title>javascript_lab - a javascript editor and tester tool</title>
5
+ <link href='/stylesheets/style.css' media='screen' rel='stylesheet' type='text/css' />
6
+ <script src='/javascripts/app.js' type='text/javascript'></script>
7
+ <% if params[:j] %>
8
+ <script src='/javascripts/<%=params[:j]%>.js' type='text/javascript'></script>
9
+ <% end %>
10
+ </head>
11
+ <body>
12
+ <div id='container'>
13
+ <div id='header'>
14
+ <div class='gem_name'>
15
+ <a href="/">javascript_lab</a>
16
+ </div>
17
+ <div class='extra'>
18
+ <ul class='nav'>
19
+ <li><a href="http://neeraj.name">Gem author</a></li>
20
+ <li><a href="http://github.com/neerajdotname/javascript_lab">source code</a></li>
21
+ </ul>
22
+ </div>
23
+ <div style='clear:both;'></div>
24
+ </div>
25
+
26
+ <div id='main'>
27
+ <%= yield %>
28
+ </div>
29
+ </div>
30
+ <!--
31
+ <script type="text/javascript" charset="utf-8">
32
+ jQuery('body').data('sinatra-env', 'development');
33
+ </script>
34
+ -->
35
+ </body>
36
+ </html>
data/views/style.sass ADDED
@@ -0,0 +1,91 @@
1
+ !red = #BA2818
2
+ !light_red = #EB9281
3
+ !dark_red = #871D1A
4
+ !light_grey = #CCCCCC
5
+ !light_grey_bg = #EFEFEF
6
+ !grey = #666
7
+ !highlight = #F4F6E6
8
+ !light_yellow = #F6EFE1
9
+ !fonts = "'Franklin Gothic', 'Franklin Gothic Medium', Helvetica, sans-serif"
10
+ //
11
+
12
+ body
13
+ :font-family = !fonts
14
+ :background = !light_yellow
15
+ :margin 0px
16
+ :padding 0px
17
+ :text-align left
18
+ :line-height 16px
19
+
20
+ a:link,
21
+ a:visited
22
+ :color = !red
23
+ :text-decoration none
24
+ a:hover
25
+ :text-decoration underline
26
+
27
+ a img
28
+ :border none
29
+
30
+ ul.nav
31
+ li
32
+ :display inline
33
+ :list-style-type none
34
+ :padding 0px 4px 0px 4px
35
+
36
+
37
+ #container
38
+ :background #FDF8F4
39
+ :margin 5px auto
40
+ :text-align left
41
+ :width 980px
42
+
43
+ #main
44
+ :padding 5px 10px 5px 10px
45
+ .lhs
46
+ :float left
47
+ :width 540px
48
+ .rhs
49
+ :float right
50
+ :background #F5DFAC
51
+ :width 325px
52
+ :padding 5px
53
+ :margin 80px 0px 0px 0px
54
+
55
+ #header
56
+ :background = !light_grey_bg
57
+ :padding 21px
58
+
59
+ .gem_name
60
+ :font-size 35px
61
+ :float left
62
+
63
+ .extra
64
+ :float right
65
+ :font-size 16px
66
+
67
+
68
+ form
69
+ p
70
+ textarea
71
+ :font-size 14px
72
+ :padding 2px
73
+ :margin 2px
74
+ select
75
+ :line-height 50px
76
+ :width auto
77
+ :text-align left
78
+ :padding 2px
79
+ :font-size 16px
80
+ label
81
+ :margin 2px
82
+ span
83
+ :color gray
84
+
85
+ #log_output
86
+ div
87
+ :margin 4px 0px 4px 0px
88
+ :color gray
89
+ span
90
+ :color red
91
+
metadata ADDED
@@ -0,0 +1,115 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: neerajdotname-javascript_lab
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Neeraj Singh
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-06-15 00:00:00 -07:00
13
+ default_executable: javascript_lab
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: sinatra
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 0.9.2
24
+ version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: vegas
27
+ type: :runtime
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 0.0.1
34
+ version:
35
+ - !ruby/object:Gem::Dependency
36
+ name: hoe
37
+ type: :development
38
+ version_requirement:
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: 1.8.0
44
+ version:
45
+ description: A tool to test javascript code and JSON structure.
46
+ email:
47
+ - neerajdotname@gmail.com
48
+ executables:
49
+ - javascript_lab
50
+ extensions: []
51
+
52
+ extra_rdoc_files:
53
+ - History.txt
54
+ - PostInstall.txt
55
+ - README.markdown
56
+ files:
57
+ - History.txt
58
+ - PostInstall.txt
59
+ - README.markdown
60
+ - Rakefile
61
+ - config.ru
62
+ - bin/javascript_lab
63
+ - lib/javascript_lab.rb
64
+ - lib/javascript_lab/app.rb
65
+ - lib/javascript_lab/view_helpers.rb
66
+ - public/javascripts/jquery-1.3.2.min.js
67
+ - public/javascripts/jquery-1.3.1.min.js
68
+ - public/javascripts/jquery-1.3.min.js
69
+ - public/javascripts/jquery-1.2.6.min.js
70
+ - public/javascripts/jquery-1.2.5.min.js
71
+ - public/javascripts/jquery-1.2.4.min.js
72
+ - public/javascripts/jquery-1.2.3.min.js
73
+ - public/javascripts/jquery-1.2.2.min.js
74
+ - public/javascripts/jquery-1.2.min.js
75
+ - public/javascripts/prototype-1.6.0.3.js
76
+ - public/javascripts/prototype-1.6.0.2.js
77
+ - public/javascripts/prototype-1.6.js
78
+ - public/javascripts/prototype-1.5.1.2.js
79
+ - public/javascripts/prototype-1.5.1.1.js
80
+ - public/javascripts/prototype-1.5.1.js
81
+ - public/javascripts/prototype-1.5.js
82
+ - public/javascripts/app.js
83
+ - public/stylesheets/style.css
84
+ - views/style.sass
85
+ - views/index.erb
86
+ - views/layout.erb
87
+ has_rdoc: false
88
+ homepage: http://github.com/neerajdotname/javascript_lab
89
+ post_install_message: PostInstall.txt
90
+ rdoc_options:
91
+ - --main
92
+ - README.markdown
93
+ require_paths:
94
+ - lib
95
+ required_ruby_version: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - ">="
98
+ - !ruby/object:Gem::Version
99
+ version: "0"
100
+ version:
101
+ required_rubygems_version: !ruby/object:Gem::Requirement
102
+ requirements:
103
+ - - ">="
104
+ - !ruby/object:Gem::Version
105
+ version: "0"
106
+ version:
107
+ requirements: []
108
+
109
+ rubyforge_project: neerajdotname
110
+ rubygems_version: 1.2.0
111
+ signing_key:
112
+ specification_version: 3
113
+ summary: A tool to test javascript and JSON data.
114
+ test_files: []
115
+