-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #677 from uccser/fsa-light-refactor
Refactor fsa-light interactive.
- Loading branch information
Showing
6 changed files
with
67 additions
and
90 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
24 changes: 0 additions & 24 deletions
24
csfieldguide/static/interactives/fsa-light/config/example-1.json
This file was deleted.
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
This file was deleted.
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
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,60 @@ | ||
{% extends interactive_mode_template %} | ||
|
||
{% load i18n %} | ||
{% load static %} | ||
|
||
{% block html %} | ||
<div class="container"> | ||
<div id="interactive-fsa-light" data-iframe-height> | ||
|
||
<div id="interactive-fsa-light-state-text" class="text-center"> | ||
{% trans 'Current state: <span id="interactive-fsa-light-current-state-text"></span>' %} | ||
</div> | ||
|
||
<div id="interactive-fsa-light-images" class="text-center"> | ||
<img id="interactive-fsa-light-bulb-off" src="{% static 'interactives/fsa-light/img/lightbulb-off.png' %}"> | ||
<img id="interactive-fsa-light-bulb-on" src="{% static 'interactives/fsa-light/img/lightbulb.png' %}"> | ||
</div> | ||
|
||
<div id="interactive-fsa-light-buttons" class="text-center"></div> | ||
|
||
<div class="text-center"> | ||
<button id="interactive-fsa-light-reset" class="btn btn-danger">{% trans "Reset to start state" %}</button> | ||
</div> | ||
</div> | ||
</div> | ||
{% endblock html %} | ||
|
||
{% block css %} | ||
<link rel="stylesheet" href="{% static 'interactives/fsa-light/css/fsa-light.css' %}"> | ||
{% endblock css %} | ||
|
||
{% block js %} | ||
<script type="text/javascript"> | ||
var fsa_light_config = { | ||
"available_buttons": ["a"], | ||
"initial_state": "1", | ||
"states": { | ||
"1": { | ||
"light": "On", | ||
"destinations": { | ||
"a": "2" | ||
} | ||
}, | ||
"2": { | ||
"light": "Off", | ||
"destinations": { | ||
"a": "3" | ||
} | ||
}, | ||
"3": { | ||
"light": "Off", | ||
"destinations": { | ||
"a": "1" | ||
} | ||
} | ||
} | ||
}; | ||
</script> | ||
<script type="text/javascript" src="{% static 'interactives/fsa-light/js/fsa-light.js' %}"></script> | ||
{% endblock js %} |