luca 0.7.6 → 0.7.7
Sign up to get free protection for your applications and to get access to all the features.
- data/assets/javascripts/dependencies/coffee-script.js +12189 -0
- data/assets/javascripts/dependencies/jquery-console.js +649 -0
- data/assets/javascripts/development-console.coffee +2 -0
- data/assets/javascripts/sandbox/views/pages/pages_controller.coffee +4 -0
- data/assets/javascripts/sandbox.coffee +1 -0
- data/lib/luca/rails/version.rb +1 -1
- data/src/components/development_console.coffee +68 -0
- data/src/framework.coffee +1 -1
- data/src/stylesheets/components/development_console.scss +15 -0
- data/vendor/assets/javascripts/coffee-script.js +12189 -0
- data/vendor/assets/javascripts/jquery-console.js +649 -0
- data/vendor/assets/javascripts/luca-ui-base.js +1 -1
- data/vendor/assets/javascripts/luca-ui-development-dependencies.js +12845 -0
- data/vendor/assets/javascripts/luca-ui-spec.js +55 -1
- data/vendor/assets/javascripts/luca-ui.js +55 -1
- data/vendor/assets/javascripts/luca-ui.min.js +3 -3
- data/vendor/assets/stylesheets/luca-ui-bootstrap.css +33 -0
- data/vendor/assets/stylesheets/luca-ui-spec.css +33 -0
- data/vendor/assets/stylesheets/luca-ui.css +33 -0
- metadata +10 -2
@@ -0,0 +1,68 @@
|
|
1
|
+
Luca.components.DevelopmentConsole = Luca.View.extend
|
2
|
+
name: "development_console"
|
3
|
+
|
4
|
+
initialize: (@options={})->
|
5
|
+
Luca.View::initialize.apply @, arguments
|
6
|
+
|
7
|
+
beforeRender: ()->
|
8
|
+
@$el.append @make("div",class:"luca-ui-development-console")
|
9
|
+
|
10
|
+
@console_el = @$('.luca-ui-development-console')
|
11
|
+
|
12
|
+
console.log "Turning into console", @console_el, @$el
|
13
|
+
|
14
|
+
@console = @console_el.console
|
15
|
+
promptLabel: "Coffee> "
|
16
|
+
animateScroll: true
|
17
|
+
promptHistory: true
|
18
|
+
commandValidate: (line)->
|
19
|
+
valid = true
|
20
|
+
|
21
|
+
valid = false if line is ""
|
22
|
+
|
23
|
+
try
|
24
|
+
if CoffeeScript.compile(line)
|
25
|
+
valid = true
|
26
|
+
else
|
27
|
+
valid = false
|
28
|
+
catch error
|
29
|
+
valid = false
|
30
|
+
|
31
|
+
valid
|
32
|
+
|
33
|
+
commandHandle: (line)->
|
34
|
+
line = _( line ).strip()
|
35
|
+
line = "return #{ line }" unless line.match(/^return/)
|
36
|
+
|
37
|
+
compiled = CoffeeScript.compile(line)
|
38
|
+
try
|
39
|
+
ret = eval(compiled)
|
40
|
+
val = if ret? then JSON.stringify( ret ) else true
|
41
|
+
return val
|
42
|
+
catch error
|
43
|
+
if error.message.match /circular structure to JSON/
|
44
|
+
return ret.toString()
|
45
|
+
|
46
|
+
error.toString()
|
47
|
+
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
|
52
|
+
# var controller2 = console2.console({
|
53
|
+
# promptLabel: 'JavaScript> ',
|
54
|
+
# commandValidate:function(line){
|
55
|
+
# if (line == "") return false;
|
56
|
+
# else return true;
|
57
|
+
# },
|
58
|
+
# commandHandle:function(line){
|
59
|
+
# try { var ret = eval(line);
|
60
|
+
# if (typeof ret != 'undefined') return ret.toString();
|
61
|
+
# else return true; }
|
62
|
+
# catch (e) { return e.toString(); }
|
63
|
+
# },
|
64
|
+
# animateScroll:true,
|
65
|
+
# promptHistory:true,
|
66
|
+
# welcomeMessage:'Enter some JavaScript expressions to evaluate.'
|
67
|
+
# });
|
68
|
+
# controller2.promptText('5 * 4');
|
data/src/framework.coffee
CHANGED
@@ -0,0 +1,15 @@
|
|
1
|
+
.luca-ui-development-console { font-size: 14px; margin-top:1em }
|
2
|
+
.luca-ui-development-console div.jquery-console-inner
|
3
|
+
{ width:900px; height:200px; background:#efefef; padding:0.5em;
|
4
|
+
overflow:auto }
|
5
|
+
.luca-ui-development-console div.jquery-console-prompt-box
|
6
|
+
{ color:#444; font-family:monospace; }
|
7
|
+
.luca-ui-development-console div.jquery-console-focus span.jquery-console-cursor
|
8
|
+
{ background:#333; color:#eee; font-weight:bold }
|
9
|
+
.luca-ui-development-console div.jquery-console-message-error
|
10
|
+
{ color:#ef0505; font-family:sans-serif; font-weight:bold;
|
11
|
+
padding:0.1em; }
|
12
|
+
.luca-ui-development-console div.jquery-console-message-success
|
13
|
+
{ color:#187718; font-family:monospace;
|
14
|
+
padding:0.1em; }
|
15
|
+
.luca-ui-development-console span.jquery-console-prompt-label { font-weight:bold }
|