<div id="server-page-close-button" class="button" style="width:100px;margin:1em;">ホームへ</div>\r
<%= javascript_tag 'var server_result=' + @server_result.to_json + ';' %>\r
<%= javascript_include_tag "jquery-162min" %>\r
+ <%= javascript_include_tag "libs" %>\r
<%= javascript_include_tag "system" %>\r
- <% if current_user %>\r
\r
- <script type="text/javascript">\r
- current_author = {\r
- id: <%= @author ? @author.id : 0 %>,\r
- name: "<%= @author ? h(@author.name) : '' %>"\r
- }\r
- <% if @artist and @artist.id %>\r
- current_artist = {\r
- id: <%= @artist.id %>,\r
- name: "<%= h(@artist.name) %>"\r
- }\r
- <% end %>\r
- </script>\r
- <% end %>\r
+ <script type="text/javascript">\r
+ <% if current_user %>\r
+ current_author = {\r
+ id: <%= @author ? @author.id : 0 %>,\r
+ name: "<%= @author ? h(@author.name) : '' %>"\r
+ };\r
+ <% if @artist and @artist.id %>\r
+ current_artist = {\r
+ id: <%= @artist.id %>,\r
+ name: "<%= h(@artist.name) %>"\r
+ };\r
+ <% end %>\r
+ gOS.PageApplicationRef = null;\r
+ gOS.PageApplicationClass = function(){\r
+ var app = this;\r
+ this.bgColor = '#FFF';\r
+ this.onOpen = function(){\r
+ var button = document.getElementById( 'server-page-close-button' );\r
+ if( button ){\r
+ app.addEventListener( button, 'click', gOS.PageApplicationRef.shutdown );\r
+ };\r
+ var msg = document.getElementById( 'esc-msg' );\r
+ if( msg ){\r
+ app.addEventListener( msg, 'click', gOS.PageApplicationRef.shutdown );\r
+ };\r
+ app.addKeyEventListener( 'keydown', gOS.PageApplicationRef.shutdown, 27 ); // 27.esc\r
+ };\r
+ };\r
+ <% end %>\r
+ </script>\r
<%= javascript_include_tag "peta-common" %>\r
<%= javascript_include_tag "peta-apps" %>\r
<%= javascript_include_tag "pongame" %>\r