GithubHelp home page GithubHelp logo

Show diff between two revisions about ecogwiki HOT 1 OPEN

akngs avatar akngs commented on June 10, 2024
Show diff between two revisions

from ecogwiki.

Comments (1)

jangxyz avatar jangxyz commented on June 10, 2024

Interesting, you have this issue. Look what I've came up with :)

Try this bookmarklet at following pages:

javascript:(function(){function n(n,t){if(n.indexOf("_type=")===-1){n+=n.indexOf("?")===-1?"?":"&";n+="_type=json"}if(t){n+="&rev="+t}return $.ajax({url:n,dataType:"json",success:function(n,t,a){},error:function(n,t,a){console.error(a)}})}function t(n,t){var a=new diff_match_patch;var r=a.diff_main(n,t);var e=a.patch_make(n,t);return r}function a(n,t){var a=new diff_match_patch;var r=a.diff_linesToChars_(n,t);var e=r["chars1"];var i=r["chars2"];var c=r["lineArray"];var f=a.diff_main(e,i,false);a.diff_charsToLines_(f,c);return f}function r(n){var t={"-":0,"+":0};for(var a=0;a<n.length;a++){var r=n[a];if(r[0]!==0){var e=r[0]===1?"+":"-";t[e]+=r[1].length}}return t}function e(n){var t={"-":0,"+":0};for(var a=0;a<n.length;a++){var r=n[a];if(r[0]!==0){var e=r[0]===1?"+":"-";t[e]+=1}}return t}function i(n){var t="";for(var a=0;a<n.length;a++){if(n[a][0]!==0){t+=n[a][0]===1?"+":"-";t+=n[a][1].replace(/\n$/,"");t+="\n"}}t=t.replace(/\n$/,"");return t}function c(n){var t=0;var a=n.split("\n");for(var r=0;r<a.length;r++){if(a[r].trim().length>0){t+=1}}return t}function f(){var n="https://google-diff-match-patch.googlecode.com/svn/trunk/javascript/diff_match_patch_uncompressed.js";var t=document.createElement("script");t.setAttribute("type","text/javascript");t.setAttribute("src",n);document.getElementsByTagName("head")[0].appendChild(t)}function o(t,a){var r,e;n(t).then(function(a,e,i){r=a;return n(t,a.revision-1)}).then(function(n,t,i){e=n;a(r,e)})}function s(n,f){o(n,function(n,o){var s=o.body,p=n.body;var u=t(s,p);var v=r(u);var h=a(s,p);var l=e(h);var d=i(h);var m=c(p);var _=$("<span class='diff-summary'/>").css({"font-size":"80%"}).append($("<span class='line-count' />").text(m+" lines")).append(", ").append($("<span class='line-summary' />").text((l["+"]?"+"+l["+"]:"")+(l["-"]&&l["+"]?"/":"")+(l["-"]?"-"+l["-"]:"")+(l["-"]||l["+"]?"L":""))).append(", ").append($("<span class='char-summary' />").text((v["+"]?"+"+v["+"]:"")+(v["-"]&&v["+"]?"/":"")+(v["-"]?"-"+v["-"]:"")+(v["-"]||v["+"]?"C":""))).attr("title",d);if(f&&typeof f==="function"){f(_,u,h)}})}function p(n){n=n||location.pathname;s(n,function(n,t,a){n.css({}).html("["+n.html()+"]").appendTo($(".updated_at"))})}function u(){var n=$(".pagelist tbody tr.page");n.each(function(){var n=$(this).find("td:nth-child(2)");var t=n.find("a").attr("href");s(t,function(t,a,r){t.css({position:"absolute",right:"20px"}).appendTo(n)})})}function v(){f()}function h(){f();if(location.pathname==="/sp.changes"||location.search.indexOf("rev=list")!==-1){u()}else{p()}}h()})();

(Copy the bookmarklet, open the page, and run it)

If you understand what's happening underneath, we could start discussing about better data structures - probably some change to models?

from ecogwiki.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.