Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
spring_raining committed Jun 19, 2014
1 parent dc4392c commit f858801
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 19 deletions.
14 changes: 9 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="glyphicon glyphicon-cog"></span></a>
<ul class="dropdown-menu">
<li class="dropdown-header">Giraf v1.1</li>
<li class="dropdown-header">Giraf v1.11</li>
<li><a href="" data-toggle="modal" data-target="#modal_updateinfo">アップデート情報</a></li>
<li><a href="" data-toggle="modal" data-target="#modal_acknowledgement">謝辞</a></li>
<li class="divider"></li>
Expand Down Expand Up @@ -263,7 +263,7 @@ <h4 class="modal-title" id="modal_crop_label">画像を切り抜き</h4>

<!-- 謝辞 -->
<div class="modal fade" id="modal_acknowledgement" tabindex="-1" role="dialog" aria-labelledby="modal_acknowledgement_label" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
Expand All @@ -288,13 +288,17 @@ <h4 class="modal-title" id="modal_acknowledgement_label">謝辞</h4>

<!-- アップデート情報 -->
<div class="modal fade" id="modal_updateinfo" tabindex="-1" role="dialog" aria-labelledby="modal_updateinfo_label" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title" id="modal_updateinfo_label">アップデート情報</h4>
</div>
<div class="modal-body">
<p>
v1.11 (2014/6/19)
<ul><li>gif作成時にエラーを起こして停止する問題を修正</li></ul>
</p>
<p>
v1.1 (2014/3/5)
<ul><li>キャプチャ機能追加</li></ul>
Expand All @@ -311,8 +315,8 @@ <h4 class="modal-title" id="modal_updateinfo_label">アップデート情報</h4
</div>
</div>

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/jquery.Jcrop.js"></script>
<script src="js/gif.js"></script>
Expand Down
17 changes: 12 additions & 5 deletions js/main.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,12 @@ $ ->
$("#refresh").click ->
renderThumbnail()

makeFinalize = =>
finalize = =>
$video.get(0).controls = true
rendering = false
settings.disable false
timelines.updateMakeButton()
$("#capture").removeClass "disabled"

$("#make").click ->
video = $video.get(0)
Expand Down Expand Up @@ -174,11 +175,12 @@ $ ->
$("#result_status").text "Rendering finished : Filesize " +
if (blob.size >= 1000000) then "#{ (blob.size / 1000000).toFixed 2 }MB"
else "#{ (blob.size / 1000).toFixed 2 }KB"
makeFinalize()
finalize()

video.controls = false
video.pause()
$("#make").addClass "disabled"
$("#capture").addClass "disabled"

canvas = $("<canvas>").get(0)
context = canvas.getContext("2d")
Expand All @@ -191,11 +193,12 @@ $ ->

arr = timelines.getFrameList settings
frameNumber = arr.length
firstTime = arr[0]
$("#progress_1").css "width", "0"
$("#progress_2").css "width", "0"

if frameNumber < 2
makeFinalize()
finalize()
return

deferred = $.Deferred()
Expand Down Expand Up @@ -227,8 +230,12 @@ $ ->
gif.addFrame canvas,
copy: true
delay: 1000.0 / settings.getCaptureFrame() / settings.getGifSpeed()
arr.shift()
video.currentTime = arr[0]
if arr.length is 1
arr.shift()
video.currentTime = firstTime
else
arr.shift()
video.currentTime = arr[0]
video.currentTime = arr[0]

deferred.resolve()
Expand Down
24 changes: 16 additions & 8 deletions js/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f858801

Please sign in to comment.