Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
deal (in a very hackish way) with bug that prevents zeroclipboard mir…
…ror key visibility when project is initialized
  • Loading branch information
ericpaulbishop committed Sep 18, 2011
1 parent 40bb676 commit 02e4bb6
Showing 1 changed file with 25 additions and 10 deletions.
35 changes: 25 additions & 10 deletions app/views/projects/settings/_repository.rhtml
@@ -1,3 +1,28 @@
<% content_for :header_tags do %>
<%= stylesheet_link_tag('zero_clipboard', :plugin => 'redmine_git_hosting') %>
<%= javascript_include_tag('ZeroClipboard', :plugin => 'redmine_git_hosting') %>
<%= javascript_include_tag('zero_clipboard_setup', :plugin => 'redmine_git_hosting') %>

<script type="text/javascript" >

document.observe("dom:loaded", function() {

ZeroClipboard.setMoviePath('<%= image_path('ZeroClipboard.swf', :plugin => 'redmine_git_hosting') %>');
setZeroClipboardInputSource("mirror_pubkey");


// tab visiblity javascript screws up zeroclipboard, need to reset when we change
// to repo tab where the clipboard is visible
// and, for good measure, just reset it every quarter second (handles visibility during repository creation, which is otherwise weird)
document.getElementById("tab-repository").addEventListener("click", reset_zero_clipboard, false );
setInterval("reset_zero_clipboard();", 250);

});
</script>

<% end %>
<% remote_form_for :repository, @repository, :url => { :controller => 'repositories', :action => 'edit', :id => @project }, :builder => TabularFormBuilder,:lang => current_language do |f| %>
<%= error_messages_for 'repository' %>
Expand Down Expand Up @@ -124,9 +149,6 @@
<%= javascript_include_tag('modalbox/modalbox', :plugin => 'redmine_git_hosting') %>


<%= stylesheet_link_tag('zero_clipboard', :plugin => 'redmine_git_hosting') %>
<%= javascript_include_tag('ZeroClipboard', :plugin => 'redmine_git_hosting') %>
<%= javascript_include_tag('zero_clipboard_setup', :plugin => 'redmine_git_hosting') %>
<script type="text/javascript">

function getWidth() {
Expand All @@ -136,13 +158,6 @@
}
document.observe("dom:loaded", function() {

ZeroClipboard.setMoviePath('<%= image_path('ZeroClipboard.swf', :plugin => 'redmine_git_hosting') %>');
setZeroClipboardInputSource("mirror_pubkey");

// tab visiblity javascript screws up zeroclipboard, need to reset when we change
// to repo tab where the clipboard is visible
document.getElementById("tab-repository").addEventListener("click", reset_zero_clipboard, false );

$$(".add-mirror").each(function(elem) {
Event.observe(elem, 'click', function(event) {
Event.stop(event);
Expand Down

0 comments on commit 02e4bb6

Please sign in to comment.