Skip to content
This repository has been archived by the owner on Jul 1, 2018. It is now read-only.

set default global robot_application on initial load #47

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -152,3 +152,5 @@ nosetests.xml
.pydevproject



run-angel-player.app/run-angel-player
4 changes: 4 additions & 0 deletions angel-player/src/chrome/content/common/global_state.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/* jshint globalstrict: true */
"use strict";

const robot_application = require('tenshi/common/robot_application');

// Nothing is in here by itself; things get shoved into this module to be
// stored across pages.

Expand All @@ -15,3 +17,5 @@ exports.set = function(key, val) {
exports.get = function(key) {
return state[key];
};

exports.set('robot_application', robot_application.CreateEmptyRobotApplication());
1 change: 1 addition & 0 deletions angel-player/src/chrome/content/texteditor/editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
}
</style>
<script src="../vendor-js/ace/ace.js" type="text/javascript" charset="utf-8"></script>
<script src="../vendor-js/ace/mode-lua.js" type="text/javascript"></script>
<script type='application/javascript;version=1.7'
src='resource://gre/modules/commonjs/toolkit/loader.js'></script>
<script src="../common/require_stub.js"></script>
Expand Down
1 change: 1 addition & 0 deletions angel-player/src/chrome/content/texteditor/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ exports.init = function(_window) {
ace = window.ace;

editor = ace.edit("editor");
editor.getSession().setMode('ace/mode/lua');

let robotApp = global_state.get('robot_application');
editor.setValue(robotApp.text_code);
Expand Down