neerajdotname-javascript_lab 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/javascript_lab +5 -2
- data/public/javascripts/app.js +0 -1
- data/views/index.erb +3 -16
- data/views/layout.erb +2 -1
- data/views/style.sass +6 -1
- metadata +1 -2
- data/public/stylesheets/style.css +0 -16
data/bin/javascript_lab
CHANGED
@@ -3,5 +3,8 @@
|
|
3
3
|
require File.expand_path(File.dirname(__FILE__) + '/../lib/javascript_lab')
|
4
4
|
require 'vegas'
|
5
5
|
|
6
|
-
|
7
|
-
Vegas::Runner.new(JavascriptLab::App, 'javascript_lab')
|
6
|
+
if ARGV.size > 0
|
7
|
+
Vegas::Runner.new(JavascriptLab::App, 'javascript_lab', {:foreground => true})
|
8
|
+
else
|
9
|
+
Vegas::Runner.new(JavascriptLab::App, 'javascript_lab')
|
10
|
+
end
|
data/public/javascripts/app.js
CHANGED
@@ -22,7 +22,6 @@ String.prototype.javascript_lab_trim = function() { return this.replace(/^\s+|\s
|
|
22
22
|
|
23
23
|
var processForm = function(){
|
24
24
|
try {
|
25
|
-
json_data = document.lab.json_data.value.javascript_lab_trim();
|
26
25
|
var javascript_code = document.lab.javascript_code.value.javascript_lab_trim();
|
27
26
|
eval(javascript_code);
|
28
27
|
}catch(e){
|
data/views/index.erb
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
|
2
|
-
|
3
1
|
<div>
|
4
2
|
<div class='lhs'>
|
5
3
|
<form action='#' name='lab'>
|
@@ -34,21 +32,11 @@
|
|
34
32
|
<label class='label'>
|
35
33
|
javascript code
|
36
34
|
</label>
|
37
|
-
<
|
35
|
+
<input class='submit' type='submit' value='Evaluate' onclick='processForm();return false;' />
|
38
36
|
<br />
|
39
|
-
<
|
37
|
+
<span class='light'>Use log('hello world') to show log in the log output</span>
|
38
|
+
<textarea name='javascript_code' rows='30' cols='70'></textarea>
|
40
39
|
</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
40
|
<p>
|
53
41
|
<input class='submit' type='submit' value='Evaluate' onclick='processForm();return false;' />
|
54
42
|
</p>
|
@@ -59,7 +47,6 @@
|
|
59
47
|
<div class='rhs'>
|
60
48
|
<strong>Log output</strong>
|
61
49
|
<a href='#' onclick='clear_log();return false;'>(clear log)</a>
|
62
|
-
|
63
50
|
<div id='log_output'>
|
64
51
|
</div>
|
65
52
|
</div>
|
data/views/layout.erb
CHANGED
@@ -12,7 +12,8 @@
|
|
12
12
|
<div id='container'>
|
13
13
|
<div id='header'>
|
14
14
|
<div class='gem_name'>
|
15
|
-
<a href="/">javascript_lab</a
|
15
|
+
<a href="/">javascript_lab</a><br />
|
16
|
+
<p class='tag_line'>quickly test your javascript code</p>
|
16
17
|
</div>
|
17
18
|
<div class='extra'>
|
18
19
|
<ul class='nav'>
|
data/views/style.sass
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: neerajdotname-javascript_lab
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Neeraj Singh
|
@@ -80,7 +80,6 @@ files:
|
|
80
80
|
- public/javascripts/prototype-1.5.1.js
|
81
81
|
- public/javascripts/prototype-1.5.js
|
82
82
|
- public/javascripts/app.js
|
83
|
-
- public/stylesheets/style.css
|
84
83
|
- views/style.sass
|
85
84
|
- views/index.erb
|
86
85
|
- views/layout.erb
|
@@ -1,16 +0,0 @@
|
|
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; }
|