Skip to content

Commit

Permalink
fix hotkeys replication problem
Browse files Browse the repository at this point in the history
  • Loading branch information
weih committed Mar 18, 2012
1 parent dfc0682 commit a6a3db6
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 10 deletions.
Binary file modified .DS_Store
Binary file not shown.
Binary file modified app/.DS_Store
Binary file not shown.
Binary file modified app/assets/.DS_Store
Binary file not shown.
Binary file modified app/assets/images/.DS_Store
Binary file not shown.
7 changes: 6 additions & 1 deletion app/assets/javascripts/application.js
Expand Up @@ -27,6 +27,9 @@ jQuery.fn.submitWithAjax = function() {
};

$(document).ready(function() {
$('#done_btn').click(function() {
$('#done_btn').val('Adding...');
});
$('#new_geekdoor').submitWithAjax();
$('.delete_door').click(function(){
$.get(this.href, null, null, "script");
Expand Down Expand Up @@ -62,7 +65,7 @@ $(document).ready(function() {
}
);
$('#done_btn').click(function() {
// $('#new_geekdoor').hide('slow');
//$('#done_btn').text('Adding..');
//$('#add_btn').fadeIn('slow');
//$('#edit_btn').fadeIn('slow');
});
Expand All @@ -77,6 +80,8 @@ $(document).ready(function() {
$('#background_colorSelector').fadeOut('slow');
$('#foreground_colorSelector').fadeOut('slow');
});

$('.default').dropkick();
})

// jQuery.ajaxSetup({
Expand Down
3 changes: 0 additions & 3 deletions app/assets/stylesheets/home.css.scss
Expand Up @@ -55,9 +55,6 @@ ul {
font-family: "Comic Sans MS",Verdana,Helvetica,Arial;
}

#main #three_man {
}

#main h1 {
font-family: "LiHei Pro", Verdana, Helvetica, Arial;
}
Expand Down
5 changes: 4 additions & 1 deletion app/models/geekdoor.rb
Expand Up @@ -30,6 +30,9 @@ def set_key_to_used
end

def set_key_to_unused
self.user.set(:unused_hotkeys, self.user.unused_hotkeys << self.hotkey)
unless self.user.unused_hotkeys.include?(self.hotkey)
self.user.unused_hotkeys << self.hotkey
self.user.set(:unused_hotkeys, self.user.unused_hotkeys)
end
end
end
2 changes: 1 addition & 1 deletion app/views/geekdoors/create.js.erb
@@ -1,7 +1,7 @@
$("#doors").html("<%= escape_javascript(render("home/door")) %>");
$(".avaiable_keys").html("<%= escape_javascript(render("home/unused_hotkeys")) %>");
$('#new_geekdoor')[0].reset();
// $('#add_btn').text('Add a new door');
$('#done_btn').val('Add');
$('.delete_door').click(function(){
$.get(this.href, null, null, "script");
return false;
Expand Down
2 changes: 1 addition & 1 deletion app/views/home/_add.html.erb
@@ -1,6 +1,6 @@
<center>
<% if !@user.has_door? %>
<p>你还没有自己的搜索条呢,点击下面的按钮添加吧!添加规则看<%= link_to "这里", about_path, :target => "_blank" %></p>
<p>新来的同学?点击下面的按钮添加吧!添加规则看<%= link_to "这里", about_path, :target => "_blank" %></p>
<% end %>

<div id="add_btn" class="btn success">
Expand Down
6 changes: 3 additions & 3 deletions app/views/home/index.html.erb
Expand Up @@ -5,9 +5,9 @@
<div id="menu">
<% if current_user %>
<strong>Welcome <%= get_name_from_email(current_user.email) %></strong>
<%= link_to "ChangeColor", '#', :id => "colorSelector" %>
<%= link_to "Background Color", '#', :id => "background_colorSelector", :style => "display:none" %>
<%= link_to "Foreground Color", '#', :id => "foreground_colorSelector", :style => "display:none" %>
<%= link_to "ChangeColor", '#', :id => "colorSelector" %>
<%= link_to "Background Color", '#', :id => "background_colorSelector", :style => "display:none" %>
<%= link_to "Foreground Color", '#', :id => "foreground_colorSelector", :style => "display:none" %>
<% end %>
<%= link_to "Readme", about_path, :target => '_blank' %>
<% if current_user %>
Expand Down
Binary file modified vendor/.DS_Store
Binary file not shown.

0 comments on commit a6a3db6

Please sign in to comment.