-
Notifications
You must be signed in to change notification settings - Fork 10
Link to Open Fixture Library #128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 6 commits
c248a97
8610528
065aabd
44672a2
9fb1d19
c9c2bd7
123d415
2495fff
70685f0
5d67555
ab59937
c9a3e28
5d6108e
6691d41
06006ff
436e8a0
f40c907
61a3515
6872b28
9cb9b2f
b6d625f
60a8664
051d284
8ca247e
dbf8743
b38bd14
a5f5897
49840d9
a089d43
af0e3de
5f76a1d
387be32
42dc9f2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
#!/bin/sh | ||
|
||
trunk/closure/bin/build/closurebuilder.py --root=trunk/ --root=js_src \ | ||
--namespace="app.setup" --output_mode=compiled --compiler_jar=compiler.jar \ | ||
--compiler_flags="--compilation_level=ADVANCED_OPTIMIZATIONS" \ | ||
> static/js/app.js | ||
java \ | ||
-jar node_modules/google-closure-compiler/compiler.jar \ | ||
--js 'js_src/**.js' \ | ||
--js 'node_modules/google-closure-library/closure/**.js' \ | ||
--js 'node_modules/google-closure-library/third_party/**.js' \ | ||
--js '!**_test.js' \ | ||
--entry_point 'app.setup' \ | ||
--js_output_file static/js/app.js \ | ||
--dependency_mode STRICT \ | ||
--compilation_level ADVANCED_OPTIMIZATIONS |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,14 +21,14 @@ goog.require('goog.dom'); | |
goog.require('goog.events'); | ||
goog.require('goog.ui.Component'); | ||
goog.require('goog.ui.TableSorter'); | ||
goog.require('app.MessageStructure'); | ||
goog.require('app.pid'); | ||
|
||
goog.provide('app.setup'); | ||
|
||
var app = app || {} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It doesn't look like app is being defined anywhere now. Although I understand why you've gone down this route. See my suggestion here about pulling some stuff out into another file to avoid the circular dependencies: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Regardless where I put |
||
|
||
// Empty list, this is populated in the page | ||
app.SOFTWARE_VERSIONS = [] | ||
// These are populated in the page | ||
app.MANUFACTURER_ID = null; | ||
app.MODEL_ID = null; | ||
app.SOFTWARE_VERSIONS = []; | ||
|
||
/** | ||
* Sort hex values | ||
|
@@ -112,6 +112,15 @@ app.makeModelTable = function(table_id) { | |
goog.exportSymbol('app.makeModelTable', app.makeModelTable); | ||
|
||
|
||
/** | ||
* Set manufacturer and model ID | ||
*/ | ||
app.setIds = function(manufacturer_id, model_id) { | ||
app.MANUFACTURER_ID = manufacturer_id; | ||
app.MODEL_ID = model_id; | ||
}; | ||
goog.exportSymbol('app.setIds', app.setIds); | ||
|
||
/** | ||
* Set the software versions | ||
*/ | ||
|
@@ -143,6 +152,8 @@ app.changeSoftwareVersion = function(element) { | |
goog.dom.removeChildren(tbody); | ||
for (var i = 0; i < personalities.length; ++i) { | ||
var personality = personalities[i]; | ||
var oflLink = 'https://open-fixture-library.herokuapp.com/rdm?manufacturerId=' + app.MANUFACTURER_ID + '&modelId=' + app.MODEL_ID + '&personalityIndex=' + personality['index'] + '&source=olp'; | ||
|
||
var tr = goog.dom.createDom('tr'); | ||
// add the cells | ||
goog.dom.appendChild(tr, app.newTD(personality['index'])); | ||
|
@@ -152,6 +163,7 @@ app.changeSoftwareVersion = function(element) { | |
goog.dom.appendChild(tr, app.newTD('Unknown')); | ||
} | ||
goog.dom.appendChild(tr, app.newTD(personality['description'])); | ||
goog.dom.appendChild(tr, app.newTD('<a href="' + oflLink + '">View in Open Fixture Library</a>')); | ||
goog.dom.appendChild(tbody, tr); | ||
} | ||
app.showBlock(personality_fieldset); | ||
|
@@ -257,7 +269,7 @@ goog.exportSymbol('app.makePIDTable', app.makePIDTable); | |
* Display a pid command | ||
*/ | ||
app.displayCommand = function(json, element_id) { | ||
var msg_structure = new app.MessageStructure(); | ||
var msg_structure = new app.pid.MessageStructure(); | ||
msg_structure.decorate(goog.dom.$(element_id)); | ||
msg_structure.update(json['items']); | ||
}; | ||
|
Uh oh!
There was an error while loading. Please reload this page.