luca 0.9.1 → 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +9 -0
- data/ROADMAP +15 -3
- data/Rakefile +33 -7
- data/app.rb +0 -1
- data/assets/javascripts/dependencies.coffee +0 -1
- data/assets/javascripts/sandbox/application.coffee +1 -1
- data/assets/javascripts/sandbox/templates/main.luca +52 -34
- data/assets/javascripts/sandbox/templates/sandbox/navigation.luca +3 -1
- data/assets/stylesheets/bootstrap-responsive.min.css +0 -1
- data/assets/stylesheets/bootstrap.min.css +48 -29
- data/assets/stylesheets/sandbox/sandbox.scss +11 -28
- data/lib/luca/rails/version.rb +1 -1
- data/site/assets/dependencies.js +94 -0
- data/site/assets/glyphicons-halflings-white.png +0 -0
- data/site/assets/glyphicons-halflings.png +0 -0
- data/site/assets/luca-ui-bootstrap.css +1313 -0
- data/site/assets/luca-ui-bootstrap.js +9 -0
- data/site/assets/luca-ui-development-tools.css +224 -0
- data/site/assets/luca-ui-development-tools.js +18561 -0
- data/site/assets/sandbox.css +14 -0
- data/site/assets/sandbox.js +131 -0
- data/site/index.html +20 -0
- data/spec/core/collection_spec.coffee +6 -6
- data/spec/core/view_spec.coffee +1 -0
- data/spec/framework_spec.coffee +7 -0
- data/spec/managers/collection_manager_spec.coffee +2 -1
- data/src/components/application.coffee +8 -4
- data/src/components/collection_view.coffee +8 -2
- data/src/components/fields/checkbox_array.coffee +3 -1
- data/src/components/form_view.coffee +46 -21
- data/src/components/grid_view.coffee +2 -4
- data/src/components/nav_bar.coffee +3 -7
- data/src/containers/tab_view.coffee +15 -2
- data/src/containers/viewport.coffee +13 -4
- data/src/core/collection.coffee +68 -53
- data/src/core/core.coffee +7 -2
- data/src/core/panel.coffee +32 -17
- data/src/core/registry.coffee +11 -3
- data/src/core/util.coffee +17 -1
- data/src/core/view.coffee +6 -5
- data/src/framework.coffee +46 -2
- data/src/managers/collection_manager.coffee +22 -81
- data/src/stylesheets/components/checkbox_array.scss +5 -0
- data/src/templates/components/form_alert +0 -0
- data/src/templates/components/form_alert.luca +3 -0
- data/src/templates/containers/tab_view.luca +1 -1
- data/src/tools/console.coffee +3 -0
- data/vendor/assets/javascripts/luca-ui-base.js +266 -128
- data/vendor/assets/javascripts/luca-ui-development-tools.js +3 -161
- data/vendor/assets/javascripts/luca-ui-development-tools.min.js +15 -0
- data/vendor/assets/javascripts/luca-ui-spec.js +380 -176
- data/vendor/assets/javascripts/luca-ui.js +348 -166
- data/vendor/assets/javascripts/luca-ui.min.js +4 -3
- data/vendor/assets/stylesheets/luca-ui-bootstrap.css +50 -29
- data/vendor/assets/stylesheets/luca-ui-spec.css +2 -0
- data/vendor/assets/stylesheets/luca-ui.css +2 -0
- metadata +16 -4
- data/src/templates/components/form_view.luca +0 -4
- data/src/tools/development_console.coffee +0 -147
@@ -18384,168 +18384,10 @@ if (!CodeMirror.mimeModes.hasOwnProperty("text/css"))
|
|
18384
18384
|
}
|
18385
18385
|
}
|
18386
18386
|
],
|
18387
|
-
|
18388
|
-
|
18389
|
-
|
18390
|
-
initialize: function() {
|
18391
|
-
this._super("initialize", this, arguments);
|
18392
|
-
return _.bindAll(this, "historyUp", "historyDown", "onSuccess", "onError", "runCommand");
|
18393
|
-
},
|
18394
|
-
saveHistory: function(command) {
|
18395
|
-
if ((command != null ? command.length : void 0) > 0) {
|
18396
|
-
this.history.push(command);
|
18397
|
-
}
|
18398
|
-
return this.historyIndex = 0;
|
18399
|
-
},
|
18400
|
-
historyUp: function() {
|
18401
|
-
var currentValue;
|
18402
|
-
this.historyIndex -= 1;
|
18403
|
-
if (this.historyIndex < 0) this.historyIndex = 0;
|
18404
|
-
currentValue = Luca("code_input").getValue();
|
18405
|
-
return Luca("code_input").setValue(this.history[this.historyIndex] || currentValue);
|
18406
|
-
},
|
18407
|
-
historyDown: function() {
|
18408
|
-
var currentValue;
|
18409
|
-
this.historyIndex += 1;
|
18410
|
-
if (this.historyIndex > this.history.length - 1) {
|
18411
|
-
this.historyIndex = this.history.length - 1;
|
18412
|
-
}
|
18413
|
-
currentValue = Luca("code_input").getValue();
|
18414
|
-
return Luca("code_input").setValue(this.history[this.historyIndex] || currentValue);
|
18415
|
-
},
|
18416
|
-
append: function(code, result, skipFormatting) {
|
18417
|
-
var current, output, payload, source;
|
18418
|
-
if (skipFormatting == null) skipFormatting = false;
|
18419
|
-
output = Luca("code_output");
|
18420
|
-
current = output.getValue();
|
18421
|
-
if (code != null) source = "// " + code;
|
18422
|
-
payload = skipFormatting || code.match(/^console\.log/) ? [current, result] : [current, source, result];
|
18423
|
-
output.setValue(_.compact(payload).join("\n"));
|
18424
|
-
return output.getCodeMirror().scrollTo(0, 90000);
|
18425
|
-
},
|
18426
|
-
onSuccess: function(result, js, coffee) {
|
18427
|
-
var dump;
|
18428
|
-
this.saveHistory(coffee);
|
18429
|
-
dump = JSON.stringify(result, null, "\t");
|
18430
|
-
dump || (dump = typeof result.toString === "function" ? result.toString() : void 0);
|
18431
|
-
return this.append(js, dump || "undefined");
|
18432
|
-
},
|
18433
|
-
onError: function(error, js, coffee) {
|
18434
|
-
return this.append(js, "// ERROR: " + error.message);
|
18435
|
-
},
|
18436
|
-
evaluateCode: function(code, raw) {
|
18437
|
-
var dev, evaluator, output, result;
|
18438
|
-
if (!((code != null ? code.length : void 0) > 0)) return;
|
18439
|
-
raw = _.string.strip(raw);
|
18440
|
-
output = Luca("code_output");
|
18441
|
-
dev = this;
|
18442
|
-
evaluator = function() {
|
18443
|
-
var console, log, old_console, result;
|
18444
|
-
old_console = window.console;
|
18445
|
-
console = {
|
18446
|
-
log: function() {
|
18447
|
-
var arg, _i, _len, _results;
|
18448
|
-
_results = [];
|
18449
|
-
for (_i = 0, _len = arguments.length; _i < _len; _i++) {
|
18450
|
-
arg = arguments[_i];
|
18451
|
-
_results.push(dev.append(void 0, arg, true));
|
18452
|
-
}
|
18453
|
-
return _results;
|
18454
|
-
}
|
18455
|
-
};
|
18456
|
-
log = console.log;
|
18457
|
-
try {
|
18458
|
-
result = eval(code);
|
18459
|
-
} catch (error) {
|
18460
|
-
window.console = old_console;
|
18461
|
-
throw error;
|
18462
|
-
}
|
18463
|
-
window.console = old_console;
|
18464
|
-
return result;
|
18465
|
-
};
|
18466
|
-
try {
|
18467
|
-
result = evaluator.call(this.getContext());
|
18468
|
-
if (!raw.match(/^console\.log/)) return this.onSuccess(result, code, raw);
|
18469
|
-
} catch (error) {
|
18470
|
-
return this.onError(error, code, raw);
|
18471
|
-
}
|
18472
|
-
},
|
18473
|
-
runCommand: function() {
|
18474
|
-
var compile, compiled, dev, raw;
|
18475
|
-
dev = this;
|
18476
|
-
compile = _.bind(Luca.tools.CoffeeEditor.prototype.compile, this);
|
18477
|
-
raw = Luca("code_input").getValue();
|
18478
|
-
return compiled = compile(raw, function(compiled) {
|
18479
|
-
return dev.evaluateCode(compiled, raw);
|
18480
|
-
});
|
18481
|
-
}
|
18482
|
-
});
|
18483
|
-
|
18484
|
-
}).call(this);
|
18485
|
-
(function() {
|
18486
|
-
var codeMirrorOptions;
|
18487
|
-
|
18488
|
-
codeMirrorOptions = {
|
18489
|
-
readOnly: true,
|
18490
|
-
autoFocus: false,
|
18491
|
-
theme: "monokai",
|
18492
|
-
mode: "javascript"
|
18493
|
-
};
|
18494
|
-
|
18495
|
-
Luca.define("Luca.tools.Console")["extends"]("Luca.core.Container")["with"]({
|
18496
|
-
className: "luca-ui-console",
|
18497
|
-
name: "console",
|
18498
|
-
history: [],
|
18499
|
-
historyIndex: 0,
|
18500
|
-
componentEvents: {
|
18501
|
-
"code_input key:keyup": "historyUp",
|
18502
|
-
"code_input key:keydown": "historyDown",
|
18503
|
-
"code_input key:enter": "runCommand"
|
18504
|
-
},
|
18505
|
-
compileOptions: {
|
18506
|
-
bare: true
|
18387
|
+
show: function(options) {
|
18388
|
+
if (options == null) options = {};
|
18389
|
+
return this.$el.addClass('modal').modal(options);
|
18507
18390
|
},
|
18508
|
-
components: [
|
18509
|
-
{
|
18510
|
-
ctype: "code_mirror_field",
|
18511
|
-
name: "code_output",
|
18512
|
-
readOnly: true,
|
18513
|
-
lineNumbers: false,
|
18514
|
-
mode: "javascript",
|
18515
|
-
maxHeight: '250px',
|
18516
|
-
height: '250px',
|
18517
|
-
lineWrapping: true,
|
18518
|
-
gutter: false
|
18519
|
-
}, {
|
18520
|
-
ctype: "text_field",
|
18521
|
-
name: "code_input",
|
18522
|
-
lineNumbers: false,
|
18523
|
-
height: '30px',
|
18524
|
-
maxHeight: '30px',
|
18525
|
-
gutter: false,
|
18526
|
-
autoBindEventHandlers: true,
|
18527
|
-
hideLabel: true,
|
18528
|
-
prepend: "Coffee>",
|
18529
|
-
events: {
|
18530
|
-
"keypress input": "onKeyEvent",
|
18531
|
-
"keydown input": "onKeyEvent"
|
18532
|
-
},
|
18533
|
-
onKeyEvent: function(keyEvent) {
|
18534
|
-
if (keyEvent.type === "keypress" && keyEvent.keyCode === Luca.keys.ENTER) {
|
18535
|
-
this.trigger("key:enter", this.getValue());
|
18536
|
-
}
|
18537
|
-
if (keyEvent.type === "keydown" && keyEvent.keyCode === Luca.keys.KEYUP) {
|
18538
|
-
this.trigger("key:keyup");
|
18539
|
-
}
|
18540
|
-
if (keyEvent.type === "keydown" && keyEvent.keyCode === Luca.keys.KEYDOWN) {
|
18541
|
-
return this.trigger("key:keydown");
|
18542
|
-
}
|
18543
|
-
},
|
18544
|
-
afterRender: function() {
|
18545
|
-
return this.$('input').focus();
|
18546
|
-
}
|
18547
|
-
}
|
18548
|
-
],
|
18549
18391
|
getContext: function() {
|
18550
18392
|
return window;
|
18551
18393
|
},
|