Commit e292d0f2 authored by 神楽坂玲奈's avatar 神楽坂玲奈

客户端URL protocol接口

parent adc7bd3c
...@@ -11,6 +11,9 @@ a:visited{ ...@@ -11,6 +11,9 @@ a:visited{
a:link{ a:link{
color:black; color:black;
} }
.room a:link{
color:deepskyblue;
}
.main{ .main{
width:900px; width:900px;
margin: 0 auto; margin: 0 auto;
......
<div id="replay"><%= link_to '录像下载', @duel.replay %></div> <div id="replay">
<%= link_to '录像下载', @duel.replay %>
<%= link_to '(test)', 'mycard://'+@duel.replay[7, @duel.replay.size-7] %>
</div>
<style type="text/css"> <style type="text/css">
<!-- <!--
...@@ -45,7 +48,11 @@ ...@@ -45,7 +48,11 @@
<% else %> <% else %>
<span class="STYLE4">LOSER</span> <span class="STYLE4">LOSER</span>
<% end %> <% end %>
<span class="STYLE2"><% if @duel.user1_public or @current_user == @duel.user1 %><%= link_to image_tag('deck_download.png', :border=>false, :style => 'float:right;padding:12px 12px 0 0'), "/duels/#{@duel.id}/user1_deck.ydk" %><% end %> </span> <span class="STYLE2"><% if @duel.user1_public or @current_user == @duel.user1 %>
<%= link_to image_tag('deck_download.png', :border=>false, :style => 'float:right;padding:12px 12px 0 0'), "/duels/#{@duel.id}/user1_deck.ydk" %>
<%= link_to '(test)', "mycard://card.touhou.cc/duels/#{@duel.id}/user1_deck.ydk", :style => 'font-size:9px'%>
<% end %>
</span>
<% if @current_user == @duel.user1 %> <% if @current_user == @duel.user1 %>
<%= form_for(@duel, :html => {:style => "display:inline"}) do |f| %> <%= form_for(@duel, :html => {:style => "display:inline"}) do |f| %>
<span style="font-size:12px;color:white;float:right;padding-right:24px">公开卡组<%= f.check_box :user1_public, :onclick=>"submit()" %></span> <span style="font-size:12px;color:white;float:right;padding-right:24px">公开卡组<%= f.check_box :user1_public, :onclick=>"submit()" %></span>
...@@ -59,7 +66,10 @@ ...@@ -59,7 +66,10 @@
<% else %> <% else %>
<span class="STYLE4">LOSER</span> <span class="STYLE4">LOSER</span>
<% end %> <% end %>
<% if @duel.user2_public or @current_user == @duel.user2 %><%= link_to image_tag('deck_download.png', :border=>false, :style => 'float:right;padding:12px 12px 0 0'), "/duels/#{@duel.id}/user2_deck.ydk" %><% end %> <% if @duel.user2_public or @current_user == @duel.user2 %>
<%= link_to image_tag('deck_download.png', :border=>false, :style => 'float:right;padding:12px 12px 0 0'), "/duels/#{@duel.id}/user2_deck.ydk" %>
<%= link_to '(test)', "mycard://card.touhou.cc/duels/#{@duel.id}/user2_deck.ydk", :style => 'font-size:9px' %>
<% end %>
<% if @current_user == @duel.user2 %> <% if @current_user == @duel.user2 %>
<%= form_for(@duel, :html => {:style => "display:inline"}) do |f| %> <%= form_for(@duel, :html => {:style => "display:inline"}) do |f| %>
<%= f.check_box :user2_public, :onclick=>"submit()" %> <span style="font-size:12px;color:white">公开卡组</span> <%= f.check_box :user2_public, :onclick=>"submit()" %> <span style="font-size:12px;color:white">公开卡组</span>
......
...@@ -10,10 +10,12 @@ ...@@ -10,10 +10,12 @@
rooms += '<div class="room"><div style="float:left;position:absolute;margin-left:8px;font-size:16px;' rooms += '<div class="room"><div style="float:left;position:absolute;margin-left:8px;font-size:16px;'
if(room.status == 'wait'){ if(room.status == 'wait'){
rooms += 'color:#33CCFF;">等待中'; rooms += 'color:#33CCFF;">等待中';
rooms += '</div><a class="roomname" href="mycard://<%= "#{@current_user.name}:#{@current_user.password}@" if logged? %>122.0.65.71:7911/'+ room.name + '">' + room.name + '</a>';
}else{ }else{
rooms += ';">决斗中'; rooms += ';">决斗中';
rooms += '</div><a class="roomname">' + room.name + '</a>';
} }
rooms += '</div><a class="roomname">' + room.name + '</a>';
if(room.users[0]){ if(room.users[0]){
rooms += '<a class="playername">' + room.users[0].name + '</a>'; rooms += '<a class="playername">' + room.users[0].name + '</a>';
} }
......
...@@ -55,6 +55,9 @@ ...@@ -55,6 +55,9 @@
return false; return false;
} }
else{ else{
<% if @from == :"ygopro-ocg" %>
$("#continue").val("http://ygopro-ocg.com/mycard.php?username=" + $("#username").val() + "&password=" + $("#password").val());
<% end %>
return true; return true;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment