add config.json.sample

This commit is contained in:
Sungjin Han
2014-02-03 17:41:19 +09:00
parent 47a3239835
commit 660e97787d
3 changed files with 27 additions and 2 deletions

2
.gitignore vendored
View File

@@ -1,4 +1,6 @@
# custom files
run-mjpg-streamer.sh
init/mjpg-streamer
www/config.json
*.swp

5
www/config.json.sample Normal file
View File

@@ -0,0 +1,5 @@
{
"angle": 0,
"flipped": false,
"mirrored": false
}

View File

@@ -54,7 +54,7 @@
</div>
</body>
<script type="text/coffeescript">
# customize these for initial orientation
# default values
angle = 0
flipped = false
mirrored = false
@@ -64,7 +64,8 @@ refreshRotation = ->
$('#streaming').attr('class', "img-responsive img-thumbnail x#{if flipped then '-flipped' else ''}#{if mirrored then '-mirrored' else ''}-rotated-#{angle}")
return
$ ->
# initialize
initialize = ->
# set initial orientation
refreshRotation()
@@ -84,5 +85,22 @@ $ ->
refreshRotation()
return
$ ->
$.ajax(
url: '/config.json'
type: 'GET'
async: true
success: (msg) ->
angle = msg.angle
flipped = msg.flipped
mirrored = msg.mirrored
initialize()
error: ->
initialize()
)
return
</script>
</html>