changeset 4062:368589dfbe98

side-by-side diffs: use full power of mergerly whitespace and interactive merge modes
author Marcin Kuzminski <marcin@python-works.com>
date Fri, 28 Jun 2013 22:43:32 +0200
parents 77d8917d1d57
children 3dba79ad5036
files rhodecode/templates/files/diff_2way.html
diffstat 1 files changed, 13 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/rhodecode/templates/files/diff_2way.html	Fri Jun 28 15:49:22 2013 +0200
+++ b/rhodecode/templates/files/diff_2way.html	Fri Jun 28 22:43:32 2013 +0200
@@ -45,8 +45,8 @@
                       <a href="${h.url('files_diff_2way_home',repo_name=c.repo_name,f_path=h.safe_unicode(c.node1.path),diff2=c.cs2.raw_id,diff1=c.cs1.raw_id,diff='diff',fulldiff=1)}" class="tooltip" title="${h.tooltip(_('Show full side-by-side diff for this file'))}"><img class="icon" src="${h.url('/images/icons/application_double.png')}"/></a>
                       <a href="${h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(c.node1.path),diff2=c.cs2.raw_id,diff1=c.cs1.raw_id,diff='raw')}" class="tooltip" title="${h.tooltip(_('Raw diff'))}"><img class="icon" src="${h.url('/images/icons/page_white.png')}"/></a>
                       <a href="${h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(c.node1.path),diff2=c.cs2.raw_id,diff1=c.cs1.raw_id,diff='download')}" class="tooltip" title="${h.tooltip(_('Download diff'))}"><img class="icon" src="${h.url('/images/icons/page_save.png')}"/></a>
-                      ##${c.ignorews_url(request.GET, h.FID(c.cs2,path))}
-                      ##${c.context_url(request.GET, h.FID(c.cs2,path))}
+                      ${h.checkbox('ignorews', label=_('ignore white space'))}
+                      ${h.checkbox('edit_mode', label=_('turn on edit mode'))}
                     </div>
                 </div>
             </div>
@@ -73,6 +73,17 @@
             setValue(orig2);
         },
     });
+    $('#ignorews').change(function(e){
+        var val = e.currentTarget.checked;
+        $('#compare').mergely('options', {ignorews: val});
+        $('#compare').mergely('update');
+    })
+    $('#edit_mode').change(function(e){
+        var val = !e.currentTarget.checked;
+        $('#compare').mergely('cm', 'lhs').setOption('readOnly', val);
+        $('#compare').mergely('cm', 'rhs').setOption('readOnly', val);
+        $('#compare').mergely('update');
+    })
 });
 </script>