diff.jsp revision 1281
0N/ASee LICENSE.txt included in this distribution for the specific
0N/Afile and include the License file at LICENSE.txt.
1281N/A return "<script type=\"text/javascript\">/* <![CDATA[ */ "
1281N/A cfg = PageConfig.get(request);
1281N/A DiffData data = cfg.getDiffData();
1281N/A if (data.errorMsg != null) {
1281N/A <p><%= data.errorMsg %></p>
1281N/A } else if (data.revision.size() == 0) {
1281N/A String rp1 = data.param[0];
1281N/A String rp2 = data.param[1];
1281N/A String reqURI = request.getRequestURI();
1281N/A for (DiffType t : DiffType.values()) {
1281N/A %> <span class="active"><%= t.toString() %><%
1281N/A if (t == DiffType.OLD) {
1281N/A } else if (t == DiffType.NEW) {
1281N/A %>&format=<%= t.getAbbrev() %>&full=<%= full ? '1' : '0'
1281N/A %>"><%= t.toString() %><%
1281N/A if (t == DiffType.OLD) {
1281N/A } else if (t == DiffType.NEW) {
1281N/A %>&format=<%= type.getAbbrev() %>&full=1">full</a></span>
1281N/A %>&format=<%= type.getAbbrev() %>&full=0">compact</a></span><%
1281N/A if (type == DiffType.SIDEBYSIDE) {
1281N/A for (int i=0; i < data.revision.size(); i++) {
1281N/A Delta d = data.revision.getDelta(i);
1281N/A if (type == DiffType.TEXT) {
1281N/A Chunk c1 = d.getOriginal();
1281N/A Chunk c2 = d.getRevised();
1281N/A Util.htmlize(file1[i1], bl1);
1281N/A Util.htmlize(file2[i2], bl2);
1281N/A String[] ss = Util.diffline(bl1, bl2);
1281N/A bl1.setLength(0);
1281N/A bl2.setLength(0);
1281N/A bl1.setLength(0);
1281N/A bl1.append("<span class=\"d\">");
1281N/A Util.htmlize(file1[i1], bl1);
1281N/A file1[i1] = bl1.append("</span>").toString();
1281N/A bl2.setLength(0);
1281N/A bl2.append("<span class=\"a\">");
1281N/A Util.htmlize(file2[i2], bl2);
1281N/A file2[i2] = bl2.append("</span>").toString();
1281N/A if (type == DiffType.UNIFIED) {
1281N/A Util.htmlize(file2[j]) %><br/><%
1281N/A Util.htmlize(file2[j]) %><br/><%
1281N/A %>&format=<%= type.getAbbrev()
1281N/A %><i><%= ++ln2 %></i><%= Util.htmlize(file2[j]) %><br/><%
1281N/A } else if (type == DiffType.SIDEBYSIDE) {
1281N/A Util.htmlize(file1[j]) %><br/><%
1281N/A Util.htmlize(file2[j]) %><br/><%
1281N/A Util.htmlize(file1[j]) %><br/><%
1281N/A %>&format=<%= type.getAbbrev()
1281N/A Util.htmlize(file1[j]) %><br/><%
1281N/A Util.htmlize(file2[j]) %><br/><%
1281N/A %>&format=<%= type.getAbbrev()
1281N/A Util.htmlize(file2[j]) %><br/><%
1281N/A } else if (type == DiffType.OLD) {
1281N/A Util.htmlize(file1[j]) %><br/><%
1281N/A Util.htmlize(file1[j]) %><br/><%
1281N/A %>&format=<%= type.getAbbrev()
1281N/A Util.htmlize(file1[j]) %><br/><%
1281N/A } else if (type == DiffType.NEW) {
1281N/A Util.htmlize(file2[j]) %><br/><%
1281N/A Util.htmlize(file2[j]) %><br/><%
1281N/A %>&format=<%= type.getAbbrev()
1281N/A Util.htmlize(file2[j]) %><br/><%
1281N/A if (file1.length >= ln1) {
1281N/A if (type == DiffType.SIDEBYSIDE) {
1281N/A if (full || file1.length - ln1 < 20) {
1281N/A for (int j = ln1; j < file1.length ; j++) {
1281N/A %><i><%= j+1 %></i><%= Util.htmlize(file1[j]) %><br/><%
1281N/A for (int j = ln2; j < file2.length ; j++) {
1281N/A %><i><%= j+1 %></i><%= Util.htmlize(file2[j]) %><br/><%
1281N/A %><i><%= j+1 %></i><%= Util.htmlize(file1[j]) %><br/><%
1281N/A %><br/> --- <b><%= file1.length - ln1 - 8
1281N/A %><i><%= j+1 %></i><%= Util.htmlize(file2[j]) %><br/><%
1281N/A %><br/>--- <b><%= file1.length - ln1 - 8
1281N/A } else if (type == DiffType.UNIFIED) {
1281N/A if (full || file2.length - ln2 < 20) {
1281N/A for (int j = ln2; j < file2.length ; j++) {
1281N/A %><i><%= j+1 %></i><%= Util.htmlize(file2[j]) %><br/><%
1281N/A %><i><%= j+1 %></i><%= Util.htmlize(file2[j]) %><br/><%
1281N/A %><br/>--- <b><%= file2.length - ln2 - 8
1281N/A } else if (type == DiffType.OLD) {
1281N/A if (full || file1.length - ln1 < 20) {
1281N/A for (int j = ln1; j < file1.length ; j++) {
1281N/A %><i><%= j+1 %></i><%= Util.htmlize(file1[j]) %><br/><%
1281N/A %><i><%= j+1 %></i><%= Util.htmlize(file1[j]) %><br/><%
1281N/A %><br/> --- <b><%= file1.length - ln1 - 8
1281N/A } else if (type == DiffType.NEW) {
1281N/A if (full || file2.length - ln2 < 20) {
1281N/A for (int j = ln2; j < file2.length ; j++) {
1281N/A %><i><%= j+1 %></i><%=Util.htmlize(file2[j])%><br/><%
1281N/A %><i><%= j+1 %></i><%= Util.htmlize(file2[j]) %><br/><%
1281N/A %><br/> --- <b><%= file2.length - ln2 - 8