Skip to content

Commit

Permalink
update 5/9
Browse files Browse the repository at this point in the history
  • Loading branch information
baku89 committed May 8, 2015
1 parent 08e4c15 commit 529ab15
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 58 deletions.
2 changes: 0 additions & 2 deletions public/gsv-generator.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r70/three.min.js"></script>
<script src="js/lib/sisyphus/sisyphus.js"></script>
<script src="js/lib/encoding-indexes.js"></script>
<script src="js/lib/encoding.js"></script>
<script src="js/lib/GSVPano.js"></script>
<script src="js/lib/glsl.min.js"></script>
<script src="js/common.js"></script>
Expand Down
11 changes: 9 additions & 2 deletions public/js/gsv-generator.js

Large diffs are not rendered by default.

37 changes: 16 additions & 21 deletions public/js/panoid-parser.js

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions public/panoid-parser.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r70/three.min.js"></script>
<script src="js/lib/GSVPano.js"></script>
<script src="js/lib/sisyphus/sisyphus.js"></script>
<script src="js/panoid-parser.js"></script>
<link rel="stylesheet" href="css/simple-gui.css"/>
<style>
Expand All @@ -17,20 +18,20 @@
</style>
</head>
<body>
<nav>
<nav id="panoid-parser">
<h1>Pano ID Parser</h1>
<dl>
<dt>load street view</dt>
<dd>
<input type="text" name="url" value="https://www.google.com/maps/@46.83622,9.854884,3a,75y,3.59h,33.55t/data=!3m5!1e1!3m3!1sHfxFYUWRjrFi_z2d-iLXtQ!2e0!3e5?hl=en-US"/>
<input name="url" type="text" value="https://www.google.com/maps/@46.83622,9.854884,3a,75y,3.59h,33.55t/data=!3m5!1e1!3m3!1sHfxFYUWRjrFi_z2d-iLXtQ!2e0!3e5?hl=en-US"/>
</dd>
<dt>add list</dt>
<dd>
<input type="checkbox" name="addlist" checked="checked"/>
<input name="addlist" type="checkbox" checked="checked"/>
</dd>
<dt>auto search</dt>
<dd>
<input type="checkbox" name="autosearch" checked="checked"/>
<input name="autosearch" type="checkbox" checked="checked"/>
</dd>
</dl>
<button id="laod">load</button>
Expand All @@ -46,7 +47,7 @@ <h1>Pano ID Parser</h1>
<dl>
<dt>pano data</dt>
<dd>
<textarea id="json" style="height:300px;"></textarea><br/><a href="gsv-generator.html">GSV Generator</a>
<textarea id="json" name="json" style="height:300px;"></textarea><br/><a href="gsv-generator.html">GSV Generator</a>
</dd>
</dl>
</nav>
Expand Down
7 changes: 6 additions & 1 deletion src/coffee/gsv-generator.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@ storage = localStorage

updateSettings = ->
$('#gsv-generator').find('input, textarea').each ->
settings[this.name] = $(this).val()
type = $(this).attr('type')
console.log type
if type == 'checkbox' || type == 'radio'
settings[this.name] = $(this).is(':checked')
else
settings[this.name] = $(this).val()

#------------------------------------------------------------
# on load
Expand Down
30 changes: 10 additions & 20 deletions src/coffee/panoid-parser.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ list = []
$status = null
$autosearch = null
$addList = null
$form = null

prevId = ''

Expand All @@ -31,34 +32,23 @@ prevDate = null
service = new google.maps.StreetViewService()



#------------------------------------------------------------
# func

restoreSettings = ->
$elm = $('nav')

$('[name=url]').val storage['pip-url']
$('[name=addlist]').prop('checked', storage['pip-addlist'])
$('[name=autosearch').prop('checked', storage['pip-autosearch'])


updateSettings = ->
$elm = $('#nav')

settings.url = $('[name=url]').val()
settings.addlist = $('[name=addlist]').prop('checked')
settings.autosearch = $('[name=autosearch]').prop('checked')

for key, val of settings
storage["#{SUFFIX}-#{key}"] = val

console.log storage
$form.find('input, textarea').each ->
type = $(this).attr('type')
console.log type
if type == 'checkbox' || type == 'radio'
settings[this.name] = $(this).is(':checked')
else
settings[this.name] = $(this).val()

#------------------------------------------------------------
# init

$ ->
$form = $('#panoid-parser')
$status = $('#status')
$autosearch = $('[name=autosearch')
$addList = $('[name=addlist]')
Expand All @@ -68,7 +58,7 @@ $ ->
$('#export').on 'click', exportJson
$('input, textarea').on 'change', updateSettings

restoreSettings()
$form.sisyphus()

options =
zoom: 16
Expand Down
2 changes: 0 additions & 2 deletions src/gsv-generator.jade
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ html
script(src='https://cdnjs.cloudflare.com/ajax/libs/three.js/r70/three.min.js')

script(src='js/lib/sisyphus/sisyphus.js')
script(src='js/lib/encoding-indexes.js')
script(src='js/lib/encoding.js')
script(src='js/lib/GSVPano.js')
script(src='js/lib/glsl.min.js')
script(src='js/common.js')
Expand Down
11 changes: 6 additions & 5 deletions src/panoid-parser.jade
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ html
script(src='https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.2/jquery.min.js')
script(src='https://cdnjs.cloudflare.com/ajax/libs/three.js/r70/three.min.js')
script(src='js/lib/GSVPano.js')
script(src='js/lib/sisyphus/sisyphus.js')
script(src='js/panoid-parser.js')

link(rel='stylesheet', href='css/simple-gui.css')
Expand All @@ -16,21 +17,21 @@ html
}

body
nav
nav#panoid-parser
h1 Pano ID Parser

dl
dt load street view
dd
input(type='text' name='url' value='https://www.google.com/maps/@46.83622,9.854884,3a,75y,3.59h,33.55t/data=!3m5!1e1!3m3!1sHfxFYUWRjrFi_z2d-iLXtQ!2e0!3e5?hl=en-US')
input(name='url' type='text' value='https://www.google.com/maps/@46.83622,9.854884,3a,75y,3.59h,33.55t/data=!3m5!1e1!3m3!1sHfxFYUWRjrFi_z2d-iLXtQ!2e0!3e5?hl=en-US')

dt add list
dd
input(type='checkbox', name='addlist', checked)
input(name='addlist' type='checkbox' checked)

dt auto search
dd
input(type='checkbox' name='autosearch', checked)
input(name='autosearch' type='checkbox' checked)

button#laod load
button#clear clear
Expand All @@ -49,7 +50,7 @@ html
dl
dt pano data
dd
textarea#json(style='height:300px;')
textarea#json(name="json" style='height:300px;')
br
a(href='gsv-generator.html') GSV Generator

Expand Down

0 comments on commit 529ab15

Please sign in to comment.