| app/controllers/wikis_controller.rb | |
| 22 | @@ -22,7 +22,7 @@ |
| 22 | |
| 23 | before_filter :login_required, :only => [:create, :edit, :new, :rename, :update] |
| 24 | before_filter :find_project |
| 25 | before_filter :find_wiki_page, :except => [:create, :index, :new] |
| 26 | before_filter :find_wiki_page, :except => [:create, :index, :new, :preview_page] |
| 27 | |
| 28 | before_filter :page_actions |
| 29 | |
| ... | |
| 125 | @@ -125,6 +125,7 @@ |
| 125 | check_project_access(@project, '!guest', true) |
| 126 | |
| 127 | params[:wiki_page][:user_id] = current_user.id |
| 128 | @wiki_page = @project.wiki_pages.find_by_name(params[:id]) |
| 129 | if @wiki_page.nil? |
| 130 | @wiki_page = @project.wiki_pages.new(params[:wiki_page]) |
| 131 | end |
| ... | |
| public/javascripts/application.js | |
| 1 | @@ -1,2 +1,61 @@ |
| 1 | // Place your application-specific JavaScript functions and classes here |
| 2 | // This file is automatically included by javascript_include_tag :defaults |
| 3 | /** |
| 4 | * Function to toggle comments form adding comments to code commits. |
| 5 | */ |
| 6 | function show_comment_form(form_id, path, line_no) |
| 7 | { |
| 8 | /* Get form */ |
| 9 | line = document.getElementById(path + line_no); |
| 10 | form_div = document.getElementById(form_id); |
| 11 | form = document.getElementById(form_id + "_form"); |
| 12 | if (! form_div) { |
| 13 | alert("form area with id " + form_id + " missing in document."); |
| 14 | return; |
| 15 | } |
| 16 | |
| 17 | /* Move form into place. */ |
| 18 | $(line).scrollTo(); |
| 19 | |
| 20 | /* Update form parameters. */ |
| 21 | form.path.value = path; |
| 22 | form.line_no.value = line_no; |
| 23 | |
| 24 | /* Show form. DISABLED FOR NOW */ |
| 25 | form_div.style.display = "none"; |
| 26 | } |
| 27 | |
| 28 | function hide_comment_form(form_id) |
| 29 | { |
| 30 | /* Get form */ |
| 31 | form_div = document.getElementById(form_id); |
| 32 | if (! form_div) { |
| 33 | alert("form area with id " + form_id + " missing in document."); |
| 34 | return; |
| 35 | } |
| 36 | form_div.style.display = "none"; |
| 37 | } |
| 38 | |
| 39 | /** |
| 40 | * Toggle multi-single select. |
| 41 | */ |
| 42 | function toggle_multi_single(select_id, size) |
| 43 | { |
| 44 | select = document.getElementById(select_id); |
| 45 | if (select) { |
| 46 | select.multiple = ! select.multiple; |
| 47 | if (select.multiple) { |
| 48 | select.size = size; |
| 49 | select.remove(0); |
| 50 | select.name = select.name + '[]'; |
| 51 | } else { |
| 52 | select.size = 1; |
| 53 | select.name = select.name.substring(0, select.name.length - 2); |
| 54 | |
| 55 | var empty = document.createElement('option'); |
| 56 | empty.text = ''; |
| 57 | empty.value = ''; |
| 58 | |
| 59 | select.add(empty, select.options[0]); |
| 60 | } |
| 61 | |
| 62 | } |
| 63 | } |
| ... | |
| public/javascripts/septic.js | |
| 0 | @@ -1,61 +0,0 @@ |
| 1 | /** |
| 2 | * Function to toggle comments form adding comments to code commits. |
| 3 | */ |
| 4 | function show_comment_form(form_id, path, line_no) |
| 5 | { |
| 6 | /* Get form */ |
| 7 | line = document.getElementById(path + line_no); |
| 8 | form_div = document.getElementById(form_id); |
| 9 | form = document.getElementById(form_id + "_form"); |
| 10 | if (! form_div) { |
| 11 | alert("form area with id " + form_id + " missing in document."); |
| 12 | return; |
| 13 | } |
| 14 | |
| 15 | /* Move form into place. */ |
| 16 | $(line).scrollTo(); |
| 17 | |
| 18 | /* Update form parameters. */ |
| 19 | form.path.value = path; |
| 20 | form.line_no.value = line_no; |
| 21 | |
| 22 | /* Show form. DISABLED FOR NOW */ |
| 23 | form_div.style.display = "none"; |
| 24 | } |
| 25 | |
| 26 | function hide_comment_form(form_id) |
| 27 | { |
| 28 | /* Get form */ |
| 29 | form_div = document.getElementById(form_id); |
| 30 | if (! form_div) { |
| 31 | alert("form area with id " + form_id + " missing in document."); |
| 32 | return; |
| 33 | } |
| 34 | form_div.style.display = "none"; |
| 35 | } |
| 36 | |
| 37 | /** |
| 38 | * Toggle multi-single select. |
| 39 | */ |
| 40 | function toggle_multi_single(select_id, size) |
| 41 | { |
| 42 | select = document.getElementById(select_id); |
| 43 | if (select) { |
| 44 | select.multiple = ! select.multiple; |
| 45 | if (select.multiple) { |
| 46 | select.size = size; |
| 47 | select.remove(0); |
| 48 | select.name = select.name + '[]'; |
| 49 | } else { |
| 50 | select.size = 1; |
| 51 | select.name = select.name.substring(0, select.name.length - 2); |
| 52 | |
| 53 | var empty = document.createElement('option'); |
| 54 | empty.text = ''; |
| 55 | empty.value = ''; |
| 56 | |
| 57 | select.add(empty, select.options[0]); |
| 58 | } |
| 59 | |
| 60 | } |
| 61 | } |
| app/views/layouts/application.rhtml | |
| 9 | @@ -9,11 +9,7 @@ |
| 9 | <%= stylesheet_link_tag 'septic_base' %> |
| 10 | <%= stylesheet_link_tag 'septic' %> |
| 11 | <%= stylesheet_link_tag 'jquery-ui' %> |
| 12 | <%= javascript_include_tag 'prototype' %> |
| 13 | <%= javascript_include_tag 'effects' %> |
| 14 | <%= javascript_include_tag 'jquery' %> |
| 15 | <%= javascript_include_tag 'jquery-ui' %> |
| 16 | <%= javascript_include_tag 'septic' %> |
| 17 | <%= javascript_include_tag :defaults %> |
| 18 | |
| 19 | <% unless @page_javascript.nil? %> |
| 20 | <script type="text/javascript"> |
| ... | |