forked from tanepiper/cloud9-livecoffee-ext
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit bee5e61
Showing
6 changed files
with
216 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.settings.xml | ||
*.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<a:application xmlns:a="http://ajax.org/2005/aml"> | ||
<a:tab id="tabLivecoffee" skin="docktab" visible="false"> | ||
<a:page id="livecoffeeView" caption="Live Coffee"> | ||
<a:codeeditor id="coffeeCode" | ||
flex = "1" | ||
realtime = "true" | ||
border = "0" | ||
model = "{require('ext/settings/settings').model}" | ||
value = "[auto/console/input]" | ||
softtabs = "[{require('ext/settings/settings').model}::editors/code/@softtabs]" | ||
tabsize = "[{require('ext/settings/settings').model}::editors/code/@tabsize]" | ||
scrollspeed = "[{require('ext/settings/settings').model}::editors/code/@scrollspeed]" | ||
theme = "[{require('ext/settings/settings').model}::editors/code/@theme]" | ||
selectstyle = "[{require('ext/settings/settings').model}::editors/code/@selectstyle]" | ||
activeline = "[{require('ext/settings/settings').model}::editors/code/@activeline]" | ||
showinvisibles = "[{require('ext/settings/settings').model}::editors/code/@showinvisibles]" | ||
showprintmargin = "false" | ||
printmargincolumn = "0" /> | ||
|
||
<a:statusbar id="coffeeStatus"> | ||
<a:section id="coffeeStatusOutput"></a:section> | ||
</a:statusbar> | ||
</a:page> | ||
</a:tab> | ||
</a:application> |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
define((require, exports, module) -> | ||
ide = require 'core/ide' | ||
ext = require 'core/ext' | ||
util = require 'core/util' | ||
editors = require 'ext/editors/editors' | ||
|
||
markup = require 'text!ext/livecoffee/livecoffee.xml' | ||
CoffeeScript = require 'ext/livecoffee/coffeescript' | ||
|
||
return ext.register 'ext/livecoffee/livecoffee', | ||
name: 'Live CoffeeScript' | ||
dev: 'Tane Piper' | ||
type: ext.GENERAL | ||
alone: yes | ||
markup: markup | ||
|
||
commands: | ||
"livecoffee": hint: "Compile the current coffeescript document" | ||
|
||
hotitems : {} | ||
|
||
nodes: [] | ||
|
||
compile: () -> | ||
editor = editors.currentEditor | ||
doc = editor.getDocument() | ||
value = doc.getValue() | ||
|
||
compiledJS = '' | ||
try | ||
compiledJS = CoffeeScript.compile value, bare: on | ||
@coffeeCode.setValue compiledJS | ||
return | ||
catch exp | ||
util.alert exp.message | ||
return | ||
|
||
hook: () -> | ||
@nodes.push ide.mnuEdit.appendChild new apf.item | ||
caption: 'View CoffeeScript Output' | ||
onclick: () => | ||
ext.initExtension @ | ||
@coffeeOutput.show() | ||
return | ||
|
||
@hotitems["compile"] = [@nodes[0]] | ||
return | ||
|
||
init: (amlNode) -> | ||
@coffeeStatusOutput = coffeeStatusOutput | ||
@coffeeCode = coffeeCode | ||
@coffeeOutput = coffeeOutput | ||
return | ||
|
||
enable : () -> | ||
@nodes.each (item) -> | ||
item.enable() | ||
return | ||
return | ||
|
||
disable: () -> | ||
@nodes.each (item) -> | ||
item.disable() | ||
return | ||
return | ||
|
||
destroy : () -> | ||
@nodes.each (item) -> | ||
item.destroy true, true | ||
return | ||
|
||
@nodes = []; | ||
@coffeeOutput.destroy true, true | ||
return | ||
) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<a:application xmlns:a="http://ajax.org/2005/aml"> | ||
<a:window | ||
id = "coffeeOutput" | ||
title = "CoffeeScript Output" | ||
center = "true" | ||
modal = "false" | ||
buttons = "close" | ||
kbclose = "true" | ||
width = "800" | ||
height = "500"> | ||
<a:codeeditor | ||
id="coffeeCode" | ||
flex="1" | ||
realtime="true" | ||
border="0" | ||
showprintmargin="false" | ||
printmargincolumn="0" | ||
width="780" | ||
height="400" /> | ||
<a:divider /> | ||
<a:hbox pack="end" padding="5" edge="10 10 5 10"> | ||
<a:button class="ui-btn-green" default="2" caption="View JS" onclick = "require('ext/livecoffee/livecoffee').compile();"/> | ||
<a:button onclick="coffeeOutput.hide()">Done</a:button> | ||
</a:hbox> | ||
<a:divider /> | ||
<a:statusbar id="coffeeStatus"> | ||
<a:section id="coffeeStatusOutput" /> | ||
</a:statusbar> | ||
</a:window> | ||
</a:application> |