diff2html
Advanced tools
Comparing version 2.0.0-beta1 to 2.0.0-beta10
@@ -8,11 +8,11 @@ (function() {(window.nunjucksPrecompiled = window.nunjucksPrecompiled || {})["line-by-line/column-line-number.html"] = (function() { | ||
var parentTemplate = null; | ||
output += "<tr>\n <td class=\"d2h-code-linenumber "; | ||
output += "<tr>\n <td class=\"d2h-code-linenumber "; | ||
output += runtime.suppressValue(runtime.memberLookup((runtime.memberLookup((runtime.contextOrFrameLookup(context, frame, "diffParser")),"LINE_TYPE")),"INFO"), env.opts.autoescape); | ||
output += "\"></td>\n <td class=\""; | ||
output += "\"></td>\n <td class=\""; | ||
output += runtime.suppressValue(runtime.memberLookup((runtime.memberLookup((runtime.contextOrFrameLookup(context, frame, "diffParser")),"LINE_TYPE")),"INFO"), env.opts.autoescape); | ||
output += "\">\n <div class=\"d2h-code-line "; | ||
output += "\">\n <div class=\"d2h-code-line "; | ||
output += runtime.suppressValue(runtime.memberLookup((runtime.memberLookup((runtime.contextOrFrameLookup(context, frame, "diffParser")),"LINE_TYPE")),"INFO"), env.opts.autoescape); | ||
output += "\"> "; | ||
output += runtime.suppressValue((lineno = 3, colno = 73, runtime.callWrap(runtime.memberLookup((runtime.contextOrFrameLookup(context, frame, "utils")),"escape"), "utils[\"escape\"]", context, [runtime.memberLookup((runtime.contextOrFrameLookup(context, frame, "block")),"header")])), env.opts.autoescape); | ||
output += " </div>\n </td>\n</tr>\n"; | ||
output += runtime.suppressValue((lineno = 3, colno = 77, runtime.callWrap(runtime.memberLookup((runtime.contextOrFrameLookup(context, frame, "utils")),"escape"), "utils[\"escape\"]", context, [runtime.memberLookup((runtime.contextOrFrameLookup(context, frame, "block")),"header")])), env.opts.autoescape); | ||
output += "</div>\n </td>\n</tr>\n"; | ||
if(parentTemplate) { | ||
@@ -41,7 +41,7 @@ parentTemplate.rootRenderFunc(env, context, frame, runtime, cb); | ||
var parentTemplate = null; | ||
output += "<tr>\n <td class=\""; | ||
output += "<tr>\n <td class=\""; | ||
output += runtime.suppressValue(runtime.memberLookup((runtime.memberLookup((runtime.contextOrFrameLookup(context, frame, "diffParser")),"LINE_TYPE")),"INFO"), env.opts.autoescape); | ||
output += "\">\n <div class=\"d2h-code-line "; | ||
output += "\">\n <div class=\"d2h-code-line "; | ||
output += runtime.suppressValue(runtime.memberLookup((runtime.memberLookup((runtime.contextOrFrameLookup(context, frame, "diffParser")),"LINE_TYPE")),"INFO"), env.opts.autoescape); | ||
output += "\">\n File without changes\n </div>\n </td>\n</tr>\n"; | ||
output += "\">\n File without changes\n </div>\n </td>\n</tr>\n"; | ||
if(parentTemplate) { | ||
@@ -74,3 +74,3 @@ parentTemplate.rootRenderFunc(env, context, frame, runtime, cb); | ||
output += runtime.suppressValue(runtime.memberLookup((runtime.contextOrFrameLookup(context, frame, "file")),"language"), env.opts.autoescape); | ||
output += "\">\n <div class=\"d2h-file-header\">\n <span class=\"d2h-file-stats\">\n <span class=\"d2h-lines-added\">\n <span>+"; | ||
output += "\">\n <div class=\"d2h-file-header\">\n <span class=\"d2h-file-stats\">\n <span class=\"d2h-lines-added\">\n <span>+"; | ||
output += runtime.suppressValue(runtime.memberLookup((runtime.contextOrFrameLookup(context, frame, "file")),"addedLines"), env.opts.autoescape); | ||
@@ -81,5 +81,5 @@ output += "</span>\n </span>\n <span class=\"d2h-lines-deleted\">\n <span>-"; | ||
output += runtime.suppressValue((lineno = 11, colno = 67, runtime.callWrap(runtime.memberLookup((runtime.contextOrFrameLookup(context, frame, "printerUtils")),"getDiffName"), "printerUtils[\"getDiffNam\"]", context, [runtime.contextOrFrameLookup(context, frame, "file")])), env.opts.autoescape); | ||
output += "</span>\n </span>\n </div>\n <div class=\"d2h-file-diff\">\n <div class=\"d2h-code-wrapper\">\n <table class=\"d2h-diff-table\">\n <tbody class=\"d2h-diff-tbody\">\n "; | ||
output += "</span>\n </span>\n </div>\n <div class=\"d2h-file-diff\">\n <div class=\"d2h-code-wrapper\">\n <table class=\"d2h-diff-table\">\n <tbody class=\"d2h-diff-tbody\">\n "; | ||
output += runtime.suppressValue(env.getFilter("safe").call(context, runtime.contextOrFrameLookup(context, frame, "diffs")), env.opts.autoescape); | ||
output += "\n </tbody>\n </table>\n </div>\n </div>\n</div>\n"; | ||
output += "\n </tbody>\n </table>\n </div>\n </div>\n</div>\n"; | ||
if(parentTemplate) { | ||
@@ -108,27 +108,26 @@ parentTemplate.rootRenderFunc(env, context, frame, runtime, cb); | ||
var parentTemplate = null; | ||
output += "<tr>\n <td class=\"d2h-code-linenumber "; | ||
output += "<tr>\n <td class=\"d2h-code-linenumber "; | ||
output += runtime.suppressValue(runtime.contextOrFrameLookup(context, frame, "type"), env.opts.autoescape); | ||
output += "\">\n <div class=\"line-num1\">"; | ||
output += runtime.suppressValue(env.getFilter("safe").call(context, (lineno = 2, colno = 46, runtime.callWrap(runtime.memberLookup((runtime.contextOrFrameLookup(context, frame, "utils")),"valueOrEmpty"), "utils[\"valueOrEmp\"]", context, [runtime.contextOrFrameLookup(context, frame, "oldNumber")]))), env.opts.autoescape); | ||
output += "</div>\n <div class=\"line-num2\">"; | ||
output += runtime.suppressValue(env.getFilter("safe").call(context, (lineno = 3, colno = 46, runtime.callWrap(runtime.memberLookup((runtime.contextOrFrameLookup(context, frame, "utils")),"valueOrEmpty"), "utils[\"valueOrEmp\"]", context, [runtime.contextOrFrameLookup(context, frame, "newNumber")]))), env.opts.autoescape); | ||
output += "</div>\n </td>\n <td class=\""; | ||
output += "\">\n <div class=\"line-num1\">"; | ||
output += runtime.suppressValue(env.getFilter("safe").call(context, (lineno = 2, colno = 50, runtime.callWrap(runtime.memberLookup((runtime.contextOrFrameLookup(context, frame, "utils")),"valueOrEmpty"), "utils[\"valueOrEmp\"]", context, [runtime.contextOrFrameLookup(context, frame, "oldNumber")]))), env.opts.autoescape); | ||
output += "</div>\n <div class=\"line-num2\">"; | ||
output += runtime.suppressValue(env.getFilter("safe").call(context, (lineno = 3, colno = 50, runtime.callWrap(runtime.memberLookup((runtime.contextOrFrameLookup(context, frame, "utils")),"valueOrEmpty"), "utils[\"valueOrEmp\"]", context, [runtime.contextOrFrameLookup(context, frame, "newNumber")]))), env.opts.autoescape); | ||
output += "</div>\n </td>\n <td class=\""; | ||
output += runtime.suppressValue(runtime.contextOrFrameLookup(context, frame, "type"), env.opts.autoescape); | ||
output += "\">\n <div class=\"d2h-code-line "; | ||
output += "\">\n <div class=\"d2h-code-line "; | ||
output += runtime.suppressValue(runtime.contextOrFrameLookup(context, frame, "type"), env.opts.autoescape); | ||
output += "\">\n"; | ||
output += "\">"; | ||
if(runtime.contextOrFrameLookup(context, frame, "prefix")) { | ||
output += "\n <span class=\"d2h-code-line-prefix\">"; | ||
output += runtime.suppressValue(env.getFilter("safe").call(context, (lineno = 8, colno = 83, runtime.callWrap(runtime.memberLookup((runtime.contextOrFrameLookup(context, frame, "utils")),"convertWhiteSpaceToNonBreakingSpace"), "utils[\"convertWhi\"]", context, [runtime.contextOrFrameLookup(context, frame, "prefix")]))), env.opts.autoescape); | ||
output += "</span>\n"; | ||
output += "\n <span class=\"d2h-code-line-prefix\">"; | ||
output += runtime.suppressValue(env.getFilter("safe").call(context, (lineno = 8, colno = 89, runtime.callWrap(runtime.memberLookup((runtime.contextOrFrameLookup(context, frame, "utils")),"convertWhiteSpaceToNonBreakingSpace"), "utils[\"convertWhi\"]", context, [runtime.contextOrFrameLookup(context, frame, "prefix")]))), env.opts.autoescape); | ||
output += "</span>\n "; | ||
; | ||
} | ||
output += "\n"; | ||
if(runtime.contextOrFrameLookup(context, frame, "content")) { | ||
output += "\n <span class=\"d2h-code-line-ctn\">"; | ||
output += runtime.suppressValue(env.getFilter("safe").call(context, (lineno = 11, colno = 80, runtime.callWrap(runtime.memberLookup((runtime.contextOrFrameLookup(context, frame, "utils")),"convertWhiteSpaceToNonBreakingSpace"), "utils[\"convertWhi\"]", context, [runtime.contextOrFrameLookup(context, frame, "content")]))), env.opts.autoescape); | ||
output += "</span>\n"; | ||
output += "<span class=\"d2h-code-line-ctn\">"; | ||
output += runtime.suppressValue(env.getFilter("safe").call(context, (lineno = 11, colno = 86, runtime.callWrap(runtime.memberLookup((runtime.contextOrFrameLookup(context, frame, "utils")),"convertWhiteSpaceToNonBreakingSpace"), "utils[\"convertWhi\"]", context, [runtime.contextOrFrameLookup(context, frame, "content")]))), env.opts.autoescape); | ||
output += "</span>"; | ||
; | ||
} | ||
output += "\n </div>\n </td>\n</tr>\n"; | ||
output += "\n </div>\n </td>\n</tr>\n"; | ||
if(parentTemplate) { | ||
@@ -157,3 +156,3 @@ parentTemplate.rootRenderFunc(env, context, frame, runtime, cb); | ||
var parentTemplate = null; | ||
output += "<div class=\"d2h-wrapper\">\n "; | ||
output += "<div class=\"d2h-wrapper\">\n "; | ||
output += runtime.suppressValue(runtime.contextOrFrameLookup(context, frame, "content"), env.opts.autoescape); | ||
@@ -160,0 +159,0 @@ output += "\n</div>\n"; |
@@ -1,1 +0,1 @@ | ||
!function(){(window.nunjucksPrecompiled=window.nunjucksPrecompiled||{})["line-by-line/column-line-number.html"]=function(){function root(env,context,frame,runtime,cb){var lineno=null,colno=null,output="";try{var parentTemplate=null;output+='<tr>\n <td class="d2h-code-linenumber ',output+=runtime.suppressValue(runtime.memberLookup(runtime.memberLookup(runtime.contextOrFrameLookup(context,frame,"diffParser"),"LINE_TYPE"),"INFO"),env.opts.autoescape),output+='"></td>\n <td class="',output+=runtime.suppressValue(runtime.memberLookup(runtime.memberLookup(runtime.contextOrFrameLookup(context,frame,"diffParser"),"LINE_TYPE"),"INFO"),env.opts.autoescape),output+='">\n <div class="d2h-code-line ',output+=runtime.suppressValue(runtime.memberLookup(runtime.memberLookup(runtime.contextOrFrameLookup(context,frame,"diffParser"),"LINE_TYPE"),"INFO"),env.opts.autoescape),output+='"> ',output+=runtime.suppressValue((lineno=3,colno=73,runtime.callWrap(runtime.memberLookup(runtime.contextOrFrameLookup(context,frame,"utils"),"escape"),'utils["escape"]',context,[runtime.memberLookup(runtime.contextOrFrameLookup(context,frame,"block"),"header")])),env.opts.autoescape),output+=" </div>\n </td>\n</tr>\n",parentTemplate?parentTemplate.rootRenderFunc(env,context,frame,runtime,cb):cb(null,output)}catch(e){cb(runtime.handleError(e,lineno,colno))}}return{root:root}}()}(),function(){(window.nunjucksPrecompiled=window.nunjucksPrecompiled||{})["line-by-line/empty-diff.html"]=function(){function root(env,context,frame,runtime,cb){var lineno=null,colno=null,output="";try{var parentTemplate=null;output+='<tr>\n <td class="',output+=runtime.suppressValue(runtime.memberLookup(runtime.memberLookup(runtime.contextOrFrameLookup(context,frame,"diffParser"),"LINE_TYPE"),"INFO"),env.opts.autoescape),output+='">\n <div class="d2h-code-line ',output+=runtime.suppressValue(runtime.memberLookup(runtime.memberLookup(runtime.contextOrFrameLookup(context,frame,"diffParser"),"LINE_TYPE"),"INFO"),env.opts.autoescape),output+='">\n File without changes\n </div>\n </td>\n</tr>\n',parentTemplate?parentTemplate.rootRenderFunc(env,context,frame,runtime,cb):cb(null,output)}catch(e){cb(runtime.handleError(e,lineno,colno))}}return{root:root}}()}(),function(){(window.nunjucksPrecompiled=window.nunjucksPrecompiled||{})["line-by-line/file-diff.html"]=function(){function root(env,context,frame,runtime,cb){var lineno=null,colno=null,output="";try{var parentTemplate=null;output+='<div id="',output+=runtime.suppressValue((lineno=0,colno=32,runtime.callWrap(runtime.memberLookup(runtime.contextOrFrameLookup(context,frame,"printerUtils"),"getHtmlId"),'printerUtils["getHtmlId"]',context,[runtime.contextOrFrameLookup(context,frame,"file")])),env.opts.autoescape),output+='" class="d2h-file-wrapper" data-lang="',output+=runtime.suppressValue(runtime.memberLookup(runtime.contextOrFrameLookup(context,frame,"file"),"language"),env.opts.autoescape),output+='">\n <div class="d2h-file-header">\n <span class="d2h-file-stats">\n <span class="d2h-lines-added">\n <span>+',output+=runtime.suppressValue(runtime.memberLookup(runtime.contextOrFrameLookup(context,frame,"file"),"addedLines"),env.opts.autoescape),output+='</span>\n </span>\n <span class="d2h-lines-deleted">\n <span>-',output+=runtime.suppressValue(runtime.memberLookup(runtime.contextOrFrameLookup(context,frame,"file"),"deletedLines"),env.opts.autoescape),output+='</span>\n </span>\n </span>\n <span class="d2h-file-name-wrapper">\n <span class="d2h-file-name"> ',output+=runtime.suppressValue((lineno=11,colno=67,runtime.callWrap(runtime.memberLookup(runtime.contextOrFrameLookup(context,frame,"printerUtils"),"getDiffName"),'printerUtils["getDiffNam"]',context,[runtime.contextOrFrameLookup(context,frame,"file")])),env.opts.autoescape),output+='</span>\n </span>\n </div>\n <div class="d2h-file-diff">\n <div class="d2h-code-wrapper">\n <table class="d2h-diff-table">\n <tbody class="d2h-diff-tbody">\n ',output+=runtime.suppressValue(env.getFilter("safe").call(context,runtime.contextOrFrameLookup(context,frame,"diffs")),env.opts.autoescape),output+="\n </tbody>\n </table>\n </div>\n </div>\n</div>\n",parentTemplate?parentTemplate.rootRenderFunc(env,context,frame,runtime,cb):cb(null,output)}catch(e){cb(runtime.handleError(e,lineno,colno))}}return{root:root}}()}(),function(){(window.nunjucksPrecompiled=window.nunjucksPrecompiled||{})["line-by-line/line.html"]=function(){function root(env,context,frame,runtime,cb){var lineno=null,colno=null,output="";try{var parentTemplate=null;output+='<tr>\n <td class="d2h-code-linenumber ',output+=runtime.suppressValue(runtime.contextOrFrameLookup(context,frame,"type"),env.opts.autoescape),output+='">\n <div class="line-num1">',output+=runtime.suppressValue(env.getFilter("safe").call(context,(lineno=2,colno=46,runtime.callWrap(runtime.memberLookup(runtime.contextOrFrameLookup(context,frame,"utils"),"valueOrEmpty"),'utils["valueOrEmp"]',context,[runtime.contextOrFrameLookup(context,frame,"oldNumber")]))),env.opts.autoescape),output+='</div>\n <div class="line-num2">',output+=runtime.suppressValue(env.getFilter("safe").call(context,(lineno=3,colno=46,runtime.callWrap(runtime.memberLookup(runtime.contextOrFrameLookup(context,frame,"utils"),"valueOrEmpty"),'utils["valueOrEmp"]',context,[runtime.contextOrFrameLookup(context,frame,"newNumber")]))),env.opts.autoescape),output+='</div>\n </td>\n <td class="',output+=runtime.suppressValue(runtime.contextOrFrameLookup(context,frame,"type"),env.opts.autoescape),output+='">\n <div class="d2h-code-line ',output+=runtime.suppressValue(runtime.contextOrFrameLookup(context,frame,"type"),env.opts.autoescape),output+='">\n',runtime.contextOrFrameLookup(context,frame,"prefix")&&(output+='\n <span class="d2h-code-line-prefix">',output+=runtime.suppressValue(env.getFilter("safe").call(context,(lineno=8,colno=83,runtime.callWrap(runtime.memberLookup(runtime.contextOrFrameLookup(context,frame,"utils"),"convertWhiteSpaceToNonBreakingSpace"),'utils["convertWhi"]',context,[runtime.contextOrFrameLookup(context,frame,"prefix")]))),env.opts.autoescape),output+="</span>\n"),output+="\n",runtime.contextOrFrameLookup(context,frame,"content")&&(output+='\n <span class="d2h-code-line-ctn">',output+=runtime.suppressValue(env.getFilter("safe").call(context,(lineno=11,colno=80,runtime.callWrap(runtime.memberLookup(runtime.contextOrFrameLookup(context,frame,"utils"),"convertWhiteSpaceToNonBreakingSpace"),'utils["convertWhi"]',context,[runtime.contextOrFrameLookup(context,frame,"content")]))),env.opts.autoescape),output+="</span>\n"),output+="\n </div>\n </td>\n</tr>\n",parentTemplate?parentTemplate.rootRenderFunc(env,context,frame,runtime,cb):cb(null,output)}catch(e){cb(runtime.handleError(e,lineno,colno))}}return{root:root}}()}(),function(){(window.nunjucksPrecompiled=window.nunjucksPrecompiled||{})["line-by-line/wrapper.html"]=function(){function root(env,context,frame,runtime,cb){var lineno=null,colno=null,output="";try{var parentTemplate=null;output+='<div class="d2h-wrapper">\n ',output+=runtime.suppressValue(runtime.contextOrFrameLookup(context,frame,"content"),env.opts.autoescape),output+="\n</div>\n",parentTemplate?parentTemplate.rootRenderFunc(env,context,frame,runtime,cb):cb(null,output)}catch(e){cb(runtime.handleError(e,lineno,colno))}}return{root:root}}()}(); | ||
!function(){(window.nunjucksPrecompiled=window.nunjucksPrecompiled||{})["line-by-line/column-line-number.html"]=function(){function root(env,context,frame,runtime,cb){var lineno=null,colno=null,output="";try{var parentTemplate=null;output+='<tr>\n <td class="d2h-code-linenumber ',output+=runtime.suppressValue(runtime.memberLookup(runtime.memberLookup(runtime.contextOrFrameLookup(context,frame,"diffParser"),"LINE_TYPE"),"INFO"),env.opts.autoescape),output+='"></td>\n <td class="',output+=runtime.suppressValue(runtime.memberLookup(runtime.memberLookup(runtime.contextOrFrameLookup(context,frame,"diffParser"),"LINE_TYPE"),"INFO"),env.opts.autoescape),output+='">\n <div class="d2h-code-line ',output+=runtime.suppressValue(runtime.memberLookup(runtime.memberLookup(runtime.contextOrFrameLookup(context,frame,"diffParser"),"LINE_TYPE"),"INFO"),env.opts.autoescape),output+='"> ',output+=runtime.suppressValue((lineno=3,colno=77,runtime.callWrap(runtime.memberLookup(runtime.contextOrFrameLookup(context,frame,"utils"),"escape"),'utils["escape"]',context,[runtime.memberLookup(runtime.contextOrFrameLookup(context,frame,"block"),"header")])),env.opts.autoescape),output+="</div>\n </td>\n</tr>\n",parentTemplate?parentTemplate.rootRenderFunc(env,context,frame,runtime,cb):cb(null,output)}catch(e){cb(runtime.handleError(e,lineno,colno))}}return{root:root}}()}(),function(){(window.nunjucksPrecompiled=window.nunjucksPrecompiled||{})["line-by-line/empty-diff.html"]=function(){function root(env,context,frame,runtime,cb){var lineno=null,colno=null,output="";try{var parentTemplate=null;output+='<tr>\n <td class="',output+=runtime.suppressValue(runtime.memberLookup(runtime.memberLookup(runtime.contextOrFrameLookup(context,frame,"diffParser"),"LINE_TYPE"),"INFO"),env.opts.autoescape),output+='">\n <div class="d2h-code-line ',output+=runtime.suppressValue(runtime.memberLookup(runtime.memberLookup(runtime.contextOrFrameLookup(context,frame,"diffParser"),"LINE_TYPE"),"INFO"),env.opts.autoescape),output+='">\n File without changes\n </div>\n </td>\n</tr>\n',parentTemplate?parentTemplate.rootRenderFunc(env,context,frame,runtime,cb):cb(null,output)}catch(e){cb(runtime.handleError(e,lineno,colno))}}return{root:root}}()}(),function(){(window.nunjucksPrecompiled=window.nunjucksPrecompiled||{})["line-by-line/file-diff.html"]=function(){function root(env,context,frame,runtime,cb){var lineno=null,colno=null,output="";try{var parentTemplate=null;output+='<div id="',output+=runtime.suppressValue((lineno=0,colno=32,runtime.callWrap(runtime.memberLookup(runtime.contextOrFrameLookup(context,frame,"printerUtils"),"getHtmlId"),'printerUtils["getHtmlId"]',context,[runtime.contextOrFrameLookup(context,frame,"file")])),env.opts.autoescape),output+='" class="d2h-file-wrapper" data-lang="',output+=runtime.suppressValue(runtime.memberLookup(runtime.contextOrFrameLookup(context,frame,"file"),"language"),env.opts.autoescape),output+='">\n <div class="d2h-file-header">\n <span class="d2h-file-stats">\n <span class="d2h-lines-added">\n <span>+',output+=runtime.suppressValue(runtime.memberLookup(runtime.contextOrFrameLookup(context,frame,"file"),"addedLines"),env.opts.autoescape),output+='</span>\n </span>\n <span class="d2h-lines-deleted">\n <span>-',output+=runtime.suppressValue(runtime.memberLookup(runtime.contextOrFrameLookup(context,frame,"file"),"deletedLines"),env.opts.autoescape),output+='</span>\n </span>\n </span>\n <span class="d2h-file-name-wrapper">\n <span class="d2h-file-name"> ',output+=runtime.suppressValue((lineno=11,colno=67,runtime.callWrap(runtime.memberLookup(runtime.contextOrFrameLookup(context,frame,"printerUtils"),"getDiffName"),'printerUtils["getDiffNam"]',context,[runtime.contextOrFrameLookup(context,frame,"file")])),env.opts.autoescape),output+='</span>\n </span>\n </div>\n <div class="d2h-file-diff">\n <div class="d2h-code-wrapper">\n <table class="d2h-diff-table">\n <tbody class="d2h-diff-tbody">\n ',output+=runtime.suppressValue(env.getFilter("safe").call(context,runtime.contextOrFrameLookup(context,frame,"diffs")),env.opts.autoescape),output+="\n </tbody>\n </table>\n </div>\n </div>\n</div>\n",parentTemplate?parentTemplate.rootRenderFunc(env,context,frame,runtime,cb):cb(null,output)}catch(e){cb(runtime.handleError(e,lineno,colno))}}return{root:root}}()}(),function(){(window.nunjucksPrecompiled=window.nunjucksPrecompiled||{})["line-by-line/line.html"]=function(){function root(env,context,frame,runtime,cb){var lineno=null,colno=null,output="";try{var parentTemplate=null;output+='<tr>\n <td class="d2h-code-linenumber ',output+=runtime.suppressValue(runtime.contextOrFrameLookup(context,frame,"type"),env.opts.autoescape),output+='">\n <div class="line-num1">',output+=runtime.suppressValue(env.getFilter("safe").call(context,(lineno=2,colno=50,runtime.callWrap(runtime.memberLookup(runtime.contextOrFrameLookup(context,frame,"utils"),"valueOrEmpty"),'utils["valueOrEmp"]',context,[runtime.contextOrFrameLookup(context,frame,"oldNumber")]))),env.opts.autoescape),output+='</div>\n <div class="line-num2">',output+=runtime.suppressValue(env.getFilter("safe").call(context,(lineno=3,colno=50,runtime.callWrap(runtime.memberLookup(runtime.contextOrFrameLookup(context,frame,"utils"),"valueOrEmpty"),'utils["valueOrEmp"]',context,[runtime.contextOrFrameLookup(context,frame,"newNumber")]))),env.opts.autoescape),output+='</div>\n </td>\n <td class="',output+=runtime.suppressValue(runtime.contextOrFrameLookup(context,frame,"type"),env.opts.autoescape),output+='">\n <div class="d2h-code-line ',output+=runtime.suppressValue(runtime.contextOrFrameLookup(context,frame,"type"),env.opts.autoescape),output+='">',runtime.contextOrFrameLookup(context,frame,"prefix")&&(output+='\n <span class="d2h-code-line-prefix">',output+=runtime.suppressValue(env.getFilter("safe").call(context,(lineno=8,colno=89,runtime.callWrap(runtime.memberLookup(runtime.contextOrFrameLookup(context,frame,"utils"),"convertWhiteSpaceToNonBreakingSpace"),'utils["convertWhi"]',context,[runtime.contextOrFrameLookup(context,frame,"prefix")]))),env.opts.autoescape),output+="</span>\n "),runtime.contextOrFrameLookup(context,frame,"content")&&(output+='<span class="d2h-code-line-ctn">',output+=runtime.suppressValue(env.getFilter("safe").call(context,(lineno=11,colno=86,runtime.callWrap(runtime.memberLookup(runtime.contextOrFrameLookup(context,frame,"utils"),"convertWhiteSpaceToNonBreakingSpace"),'utils["convertWhi"]',context,[runtime.contextOrFrameLookup(context,frame,"content")]))),env.opts.autoescape),output+="</span>"),output+="\n </div>\n </td>\n</tr>\n",parentTemplate?parentTemplate.rootRenderFunc(env,context,frame,runtime,cb):cb(null,output)}catch(e){cb(runtime.handleError(e,lineno,colno))}}return{root:root}}()}(),function(){(window.nunjucksPrecompiled=window.nunjucksPrecompiled||{})["line-by-line/wrapper.html"]=function(){function root(env,context,frame,runtime,cb){var lineno=null,colno=null,output="";try{var parentTemplate=null;output+='<div class="d2h-wrapper">\n ',output+=runtime.suppressValue(runtime.contextOrFrameLookup(context,frame,"content"),env.opts.autoescape),output+="\n</div>\n",parentTemplate?parentTemplate.rootRenderFunc(env,context,frame,runtime,cb):cb(null,output)}catch(e){cb(runtime.handleError(e,lineno,colno))}}return{root:root}}()}(); |
@@ -129,5 +129,10 @@ /******/ (function(modules) { // webpackBootstrap | ||
var $target; | ||
if (targetId) { | ||
if (typeof(targetId) === 'object' && targetId instanceof jQuery) { | ||
$target = targetId; | ||
} else if (typeof(targetId) === 'string') { | ||
$target = $(targetId); | ||
} else { | ||
console.error("Wrong target provided! Falling back to default value 'body'."); | ||
console.log("Please provide a jQuery object or a valid DOM query string."); | ||
$target = $(defaultTarget); | ||
@@ -134,0 +139,0 @@ } |
@@ -1,1 +0,1 @@ | ||
!function(modules){function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId]={exports:{},id:moduleId,loaded:!1};return modules[moduleId].call(module.exports,module,module.exports,__webpack_require__),module.loaded=!0,module.exports}var installedModules={};return __webpack_require__.m=modules,__webpack_require__.c=installedModules,__webpack_require__.p="",__webpack_require__(0)}([function(module,exports){(function(global){!function(){function Diff2HtmlUI(config){var cfg=config||{};cfg.diff?diffJson=Diff2Html.getJsonFromDiff(cfg.diff):cfg.json&&(diffJson=cfg.json)}var diffJson=null,defaultTarget="body";Diff2HtmlUI.prototype.draw=function(targetId,config){var cfg=config||{},$target=this._getTarget(targetId);$target.html(Diff2Html.getPrettyHtml(diffJson,cfg))},Diff2HtmlUI.prototype.fileListCloseable=function(targetId,startVisible){function show(){$showBtn.hide(),$hideBtn.show(),$fileList.show()}function hide(){$hideBtn.hide(),$showBtn.show(),$fileList.hide()}var $target=this._getTarget(targetId),hashTag=this._getHashTag(),$showBtn=$target.find(".d2h-show"),$hideBtn=$target.find(".d2h-hide"),$fileList=$target.find(".d2h-file-list");"files-summary-show"===hashTag?show():"files-summary-hide"===hashTag?hide():startVisible?show():hide(),$showBtn.click(show),$hideBtn.click(hide)},Diff2HtmlUI.prototype.highlightCode=function(targetId){var that=this,$target=that._getTarget(targetId),languages=that._getLanguages($target);hljs.configure({languages:languages});var $codeLines=$target.find(".d2h-code-line-ctn");$codeLines.map(function(i,line){hljs.highlightBlock(line)})},Diff2HtmlUI.prototype._getTarget=function(targetId){var $target;return $target=$(targetId?targetId:defaultTarget)},Diff2HtmlUI.prototype._getLanguages=function($target){var allFileLanguages=[];return diffJson?allFileLanguages=diffJson.map(function(line){return line.language}):$target.find(".d2h-file-wrapper").map(function(i,file){allFileLanguages.push($(file).data("lang"))}),this._distinct(allFileLanguages)},Diff2HtmlUI.prototype._getHashTag=function(){var docUrl=document.URL,hashTagIndex=docUrl.indexOf("#"),hashTag=null;return-1!==hashTagIndex&&(hashTag=docUrl.substr(hashTagIndex+1)),hashTag},Diff2HtmlUI.prototype._distinct=function(collection){return collection.filter(function(v,i){return collection.indexOf(v)===i})},module.exports.Diff2HtmlUI=Diff2HtmlUI,global.Diff2HtmlUI=Diff2HtmlUI}()}).call(exports,function(){return this}())}]); | ||
!function(modules){function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId]={exports:{},id:moduleId,loaded:!1};return modules[moduleId].call(module.exports,module,module.exports,__webpack_require__),module.loaded=!0,module.exports}var installedModules={};return __webpack_require__.m=modules,__webpack_require__.c=installedModules,__webpack_require__.p="",__webpack_require__(0)}([function(module,exports){(function(global){!function(){function Diff2HtmlUI(config){var cfg=config||{};cfg.diff?diffJson=Diff2Html.getJsonFromDiff(cfg.diff):cfg.json&&(diffJson=cfg.json)}var diffJson=null,defaultTarget="body";Diff2HtmlUI.prototype.draw=function(targetId,config){var cfg=config||{},$target=this._getTarget(targetId);$target.html(Diff2Html.getPrettyHtml(diffJson,cfg))},Diff2HtmlUI.prototype.fileListCloseable=function(targetId,startVisible){function show(){$showBtn.hide(),$hideBtn.show(),$fileList.show()}function hide(){$hideBtn.hide(),$showBtn.show(),$fileList.hide()}var $target=this._getTarget(targetId),hashTag=this._getHashTag(),$showBtn=$target.find(".d2h-show"),$hideBtn=$target.find(".d2h-hide"),$fileList=$target.find(".d2h-file-list");"files-summary-show"===hashTag?show():"files-summary-hide"===hashTag?hide():startVisible?show():hide(),$showBtn.click(show),$hideBtn.click(hide)},Diff2HtmlUI.prototype.highlightCode=function(targetId){var that=this,$target=that._getTarget(targetId),languages=that._getLanguages($target);hljs.configure({languages:languages});var $codeLines=$target.find(".d2h-code-line-ctn");$codeLines.map(function(i,line){hljs.highlightBlock(line)})},Diff2HtmlUI.prototype._getTarget=function(targetId){var $target;return"object"==typeof targetId&&targetId instanceof jQuery?$target=targetId:"string"==typeof targetId?$target=$(targetId):(console.error("Wrong target provided! Falling back to default value 'body'."),console.log("Please provide a jQuery object or a valid DOM query string."),$target=$(defaultTarget)),$target},Diff2HtmlUI.prototype._getLanguages=function($target){var allFileLanguages=[];return diffJson?allFileLanguages=diffJson.map(function(line){return line.language}):$target.find(".d2h-file-wrapper").map(function(i,file){allFileLanguages.push($(file).data("lang"))}),this._distinct(allFileLanguages)},Diff2HtmlUI.prototype._getHashTag=function(){var docUrl=document.URL,hashTagIndex=docUrl.indexOf("#"),hashTag=null;return-1!==hashTagIndex&&(hashTag=docUrl.substr(hashTagIndex+1)),hashTag},Diff2HtmlUI.prototype._distinct=function(collection){return collection.filter(function(v,i){return collection.indexOf(v)===i})},module.exports.Diff2HtmlUI=Diff2HtmlUI,global.Diff2HtmlUI=Diff2HtmlUI}()}).call(exports,function(){return this}())}]); |
{ | ||
"name": "diff2html", | ||
"version": "2.0.0-beta1", | ||
"version": "2.0.0-beta10", | ||
"homepage": "http://rtfpessoa.github.io/diff2html/", | ||
@@ -37,3 +37,3 @@ "description": "Fast Diff to colorized HTML", | ||
}, | ||
"preferGlobal": "true", | ||
"preferGlobal": true, | ||
"scripts": { | ||
@@ -47,14 +47,14 @@ "release": "bash release.sh", | ||
"dependencies": { | ||
"diff": "^2.2.1", | ||
"nunjucks": "^2.3.0" | ||
"diff": "^2.2.2", | ||
"nunjucks": "^2.4.1" | ||
}, | ||
"devDependencies": { | ||
"clean-css": "^3.4.9", | ||
"clean-css": "^3.4.10", | ||
"codacy-coverage": "^1.1.3", | ||
"fast-html-parser": "^1.0.1", | ||
"istanbul": "^0.4.2", | ||
"jscs": "^2.10.1", | ||
"jscs": "^2.11.0", | ||
"mocha": "^2.4.5", | ||
"uglifyjs": "^2.4.10", | ||
"webpack": "^1.12.13" | ||
"webpack": "^1.12.14" | ||
}, | ||
@@ -61,0 +61,0 @@ "license": "MIT", |
@@ -70,2 +70,3 @@ # diff2html | ||
- `matchWordsThreshold`: similarity threshold for word matching, default is 0.25 | ||
- `matchingMaxComparisons`: perform at most this much comparisons for line matching a block of changes, default is `2500` | ||
@@ -72,0 +73,0 @@ ## Diff2HtmlUI Helper |
@@ -26,3 +26,3 @@ /* | ||
DiffParser.prototype.generateDiffJson = function(diffInput) { | ||
DiffParser.prototype.generateDiffJson = function(diffInput, config) { | ||
var files = []; | ||
@@ -137,7 +137,7 @@ var currentFile = null; | ||
var copyFrom = /^copy from (.+)/; | ||
var copyTo = /^copy to (.+)/; | ||
var copyFrom = /^copy from "?(.+?)"?/; | ||
var copyTo = /^copy to "?(.+?)"?/; | ||
var renameFrom = /^rename from (.+)/; | ||
var renameTo = /^rename to (.+)/; | ||
var renameFrom = /^rename from "?(.+?)"?/; | ||
var renameTo = /^rename to "?(.+?)"?/; | ||
@@ -165,7 +165,7 @@ var similarityIndex = /^similarity index (\d+)%/; | ||
startFile(); | ||
} else if (currentFile && !currentFile.oldName && (values = /^--- [aiwco]\/(.+)$/.exec(line))) { | ||
currentFile.oldName = values[1]; | ||
} else if (currentFile && !currentFile.oldName && (values = getSrcFilename(line, config))) { | ||
currentFile.oldName = values; | ||
currentFile.language = getExtension(currentFile.oldName, currentFile.language); | ||
} else if (currentFile && !currentFile.newName && (values = /^\+\+\+ [biwco]?\/(.+)$/.exec(line))) { | ||
currentFile.newName = values[1]; | ||
} else if (currentFile && !currentFile.newName && (values = getDstFilename(line, config))) { | ||
currentFile.newName = values; | ||
currentFile.language = getExtension(currentFile.newName, currentFile.language); | ||
@@ -232,4 +232,37 @@ } else if (currentFile && utils.startsWith(line, '@@')) { | ||
function getSrcFilename(line, cfg) { | ||
var prefixes = ["a/", "i/", "w/", "c/", "o/"]; | ||
if (cfg.srcPrefix) prefixes.push(cfg.srcPrefix); | ||
return _getFilename('---', line, prefixes); | ||
} | ||
function getDstFilename(line, cfg) { | ||
var prefixes = ["b/", "i/", "w/", "c/", "o/"]; | ||
if (cfg.dstPrefix) prefixes.push(cfg.dstPrefix); | ||
return _getFilename('\\+\\+\\+', line, prefixes); | ||
} | ||
function _getFilename(linePrefix, line, prefixes) { | ||
var FilenameRegExp = new RegExp('^' + linePrefix + ' "?(.+?)"?$'); | ||
var filename; | ||
var values = FilenameRegExp.exec(line); | ||
if (values && values[1]) { | ||
filename = values[1]; | ||
var matchingPrefixes = prefixes.filter(function(p) { | ||
return filename.indexOf(p) === 0; | ||
}); | ||
if (matchingPrefixes[0]) filename = filename.slice(matchingPrefixes[0].length); // remove prefix if exists | ||
} | ||
return filename; | ||
} | ||
module.exports.DiffParser = new DiffParser(); | ||
})(); |
@@ -29,4 +29,5 @@ /* | ||
*/ | ||
Diff2Html.prototype.getJsonFromDiff = function(diffInput) { | ||
return diffParser.generateDiffJson(diffInput); | ||
Diff2Html.prototype.getJsonFromDiff = function(diffInput, config) { | ||
var configOrEmpty = config || {}; | ||
return diffParser.generateDiffJson(diffInput, configOrEmpty); | ||
}; | ||
@@ -42,3 +43,3 @@ | ||
if (!configOrEmpty.inputFormat || configOrEmpty.inputFormat === 'diff') { | ||
diffJson = diffParser.generateDiffJson(diffInput); | ||
diffJson = diffParser.generateDiffJson(diffInput, configOrEmpty); | ||
} | ||
@@ -45,0 +46,0 @@ |
@@ -69,3 +69,6 @@ /* | ||
var doMatching = that.config.matching === 'lines' || that.config.matching === 'words'; | ||
var comparisons = oldLines.length * newLines.length; | ||
var maxComparisons = that.config.matchingMaxComparisons || 2500; | ||
var doMatching = comparisons < maxComparisons && (that.config.matching === 'lines' || | ||
that.config.matching === 'words'); | ||
@@ -72,0 +75,0 @@ if (doMatching) { |
@@ -42,5 +42,6 @@ /* | ||
if (oldFilename && newFilename && oldFilename !== newFilename && !isDeletedName(newFilename)) { | ||
if (oldFilename && newFilename && oldFilename !== newFilename | ||
&& !isDevNullName(oldFilename) && !isDevNullName(newFilename)) { | ||
return oldFilename + ' -> ' + newFilename; | ||
} else if (newFilename && !isDeletedName(newFilename)) { | ||
} else if (newFilename && !isDevNullName(newFilename)) { | ||
return newFilename; | ||
@@ -136,4 +137,4 @@ } else if (oldFilename) { | ||
function isDeletedName(name) { | ||
return name === 'dev/null'; | ||
function isDevNullName(name) { | ||
return name.indexOf('dev/null') !== -1; | ||
} | ||
@@ -140,0 +141,0 @@ |
@@ -108,4 +108,8 @@ /* | ||
var deleteType; | ||
var doMatching = that.config.matching === 'lines' || that.config.matching === 'words'; | ||
var comparisons = oldLines.length * newLines.length; | ||
var maxComparisons = that.config.matchingMaxComparisons || 2500; | ||
var doMatching = comparisons < maxComparisons && (that.config.matching === 'lines' || | ||
that.config.matching === 'words'); | ||
if (doMatching) { | ||
@@ -112,0 +116,0 @@ matches = matcher(oldLines, newLines); |
@@ -83,5 +83,10 @@ /* | ||
var $target; | ||
if (targetId) { | ||
if (typeof(targetId) === 'object' && targetId instanceof jQuery) { | ||
$target = targetId; | ||
} else if (typeof(targetId) === 'string') { | ||
$target = $(targetId); | ||
} else { | ||
console.error("Wrong target provided! Falling back to default value 'body'."); | ||
console.log("Please provide a jQuery object or a valid DOM query string."); | ||
$target = $(defaultTarget); | ||
@@ -88,0 +93,0 @@ } |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
415557
7040
166
Updateddiff@^2.2.2
Updatednunjucks@^2.4.1