diff options
| author | hukl <contact@smyck.org> | 2009-03-15 14:07:04 +0100 |
|---|---|---|
| committer | hukl <contact@smyck.org> | 2009-03-15 14:07:04 +0100 |
| commit | a936993a5a7bbe7bb4f679d3adc059929cd0d7c5 (patch) | |
| tree | 4913c2909cf698a2bf0e1b5fc552f6c2454d882c /app/views/revisions/diff.html.erb | |
| parent | c9fa047402fdc009319dca7b05455e8ce73eaee7 (diff) | |
first revision and diff interface
Diffstat (limited to 'app/views/revisions/diff.html.erb')
| -rw-r--r-- | app/views/revisions/diff.html.erb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/app/views/revisions/diff.html.erb b/app/views/revisions/diff.html.erb new file mode 100644 index 0000000..bcbf560 --- /dev/null +++ b/app/views/revisions/diff.html.erb | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | <h1>Revisions#diff</h1> | ||
| 2 | |||
| 3 | <% form_tag url_for(:action => :diff), :method => :get do %> | ||
| 4 | <%= select_tag :start, options_for_select(@node.pages.map{|x| x.revision}, params[:start].to_i) %> | ||
| 5 | <%= select_tag :end, options_for_select(@node.pages.map{|x| x.revision}, params[:end].to_i) %> | ||
| 6 | <%= submit_tag 'Diff' %> | ||
| 7 | <% end %> | ||
| 8 | |||
| 9 | <div id="start_text" style="display: none;"> | ||
| 10 | <%= (@start.body) %> | ||
| 11 | </div> | ||
| 12 | |||
| 13 | <div id="end_text" style="display: none;"> | ||
| 14 | <%= (@end.body) %> | ||
| 15 | </div> | ||
| 16 | |||
| 17 | |||
| 18 | <%= javascript_include_tag 'cacycle_diff' %> | ||
| 19 | <script type="text/javascript" charset="utf-8"> | ||
| 20 | window.onload = function() { | ||
| 21 | text1 = document.getElementById('start_text').innerHTML; | ||
| 22 | text2 = document.getElementById('end_text').innerHTML; | ||
| 23 | document.getElementById('diffview').innerHTML = WDiffString(text1, text2); | ||
| 24 | } | ||
| 25 | </script> | ||
| 26 | |||
| 27 | <div id="diffview"></div> \ No newline at end of file | ||
