Extends the Chrome Developer Tools, adding a new Network Panel in the Developer Tools window with better searching and response previews. https://leviolson.com/posts/chrome-ext-better-network-panel
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

94 lines
281 KiB

4 years ago
  1. /*prettydiff.com api.topcoms: true, api.insize: 4, api.inchar: " ", api.vertical: true */
  2. /*global pd, ace, exports, define */
  3. /*jslint for: true*/
  4. /*
  5. Execute in a NodeJS app:
  6. npm install prettydiff (local install)
  7. var prettydiff = require("prettydiff"),
  8. args = {
  9. source: "asdf",
  10. diff : "asdd",
  11. lang : "text"
  12. },
  13. output = prettydiff.api(args);
  14. Execute on command line with NodeJS:
  15. npm install prettydiff -g (global install)
  16. prettydiff source:"c:\mydirectory\myfile.js" readmethod:"file" diff:"c:\myotherfile.js"
  17. Execute with WSH:
  18. cscript prettydiff.wsf /source:"myFile.xml" /mode:"beautify"
  19. Execute from JavaScript:
  20. var args = {
  21. source: "asdf",
  22. diff : "asdd",
  23. lang : "text"
  24. },
  25. output = prettydiff(args);
  26. ******* license start *******
  27. @source: http://prettydiff.com/prettydiff.js
  28. @documentation - English: http://prettydiff.com/documentation.php
  29. @licstart The following is the entire license notice for Pretty Diff.
  30. This code may not be used or redistributed unless the following
  31. conditions are met:
  32. * Prettydiff created by Austin Cheney originally on 3 Mar 2009.
  33. http://prettydiff.com/
  34. * The use of diffview.js and prettydiff.js must contain the following
  35. copyright:
  36. Copyright (c) 2007, Snowtide Informatics Systems, Inc.
  37. All rights reserved.
  38. - Redistributions of source code must retain the above copyright
  39. notice, this list of conditions and the following disclaimer.
  40. - Redistributions in binary form must reproduce the above copyright
  41. notice, this list of conditions and the following disclaimer in the
  42. documentation and/or other materials provided with the
  43. distribution.
  44. - Neither the name of the Snowtide Informatics Systems nor the
  45. names of its contributors may be used to endorse or promote products
  46. derived from this software without specific prior written
  47. permission.
  48. - used as diffview function
  49. http://prettydiff.com/lib/diffview.js
  50. * The code mentioned above has significantly expanded documentation in
  51. each of the respective function's external JS file as linked from the
  52. documentation page:
  53. http://prettydiff.com/documentation.php
  54. * In addition to the previously stated requirements any use of any
  55. component, aside from directly using the full files in their entirety,
  56. must restate the license mentioned at the top of each concerned file.
  57. If each and all these conditions are met use, extension, alteration,
  58. and redistribution of Pretty Diff and its required assets is unlimited
  59. and free without author permission.
  60. @licend The above is the entire license notice for Pretty Diff.
  61. ******* license end *******
  62. Join the Pretty Diff mailing list at:
  63. https://groups.google.com/d/forum/pretty-diff
  64. Special thanks to:
  65. * Harry Whitfield for the numerous test cases provided against
  66. JSPretty. http://g6auc.me.uk/
  67. * Andreas Greuel for contributing samples to test diffview.js
  68. https://plus.google.com/105958105635636993368/posts
  69. */
  70. var prettydiff=function prettydiff(api){"use strict";var startTime=Date.now(),jsxstatus=false,summary="",charDecoder=function init_charDecoder(){return},csspretty=function init_csspretty(){return},csvbeauty=function init_csvbeauty(){return},csvmin=function init_csvmin(){return},diffview=function init_diffview(){return},jspretty=function init_jspretty(){return},markuppretty=function init_markuppretty(){return},safeSort=function safeSort(array,operation,recursive){var arTest=function safeSort_arTest(item){if(typeof item!=="object"||item.length===undefined||item.length<2){return false}return true},normal=function safeSort__normal(item){var done=[item[0]],storeb=item,child=function safeSort__normal_child(){var a=0,len=storeb.length;for(a=0;a<len;a+=1){if(arTest(storeb[a])===true){storeb[a]=safeSort__normal(storeb[a])}}},recurse=function safeSort__normal_recurse(x){var a=0,storea=[],len=storeb.length;for(a=0;a<len;a+=1){if(storeb[a]!==x){storea.push(storeb[a])}}storeb=storea;if(storea.length>0){done.push(storea[0]);safeSort__normal_recurse(storea[0])}else{if(recursive===true){child()}item=storeb}};recurse(array[0])},descend=function safeSort__descend(item){var c=0,storeb=item,len=item.length,child=function safeSort__descend_child(){var a=0,lenc=storeb.length;for(a=0;a<lenc;a+=1){if(arTest(storeb[a])===true){storeb[a]=safeSort__descend(storeb[a])}}},recurse=function safeSort__descend_recurse(){var a=0,b=0,d=0,e=0,ind=[],key=storeb[c],tstore="",tkey=typeof key;for(a=c;a<len;a+=1){tstore=typeof storeb[a];if(storeb[a]>key||(tstore>tkey)){key=storeb[a];ind=[a]}else if(storeb[a]===key){ind.push(a)}}d=ind.length;b=d+c;for(a=c;a<b;a+=1){storeb[ind[e]]=storeb[a];storeb[a]=key;e+=1}c+=d;if(c<len){safeSort__descend_recurse()}else{if(recursive===true){child()}item=storeb}};recurse();return item},ascend=function safeSort__ascend(item){var c=0,storeb=item,len=item.length,child=function safeSort__ascend_child(){var a=0,lenc=storeb.length;for(a=0;a<lenc;a+=1){if(arTest(storeb[a])===true){storeb[a]=safeSort__ascend(storeb[a])}}},recurse=function safeSort__ascend_recurse(){var a=0,b=0,d=0,e=0,ind=[],key=storeb[c],tstore="",tkey=typeof key;for(a=c;a<len;a+=1){tstore=typeof storeb[a];if(storeb[a]<key||tstore<tkey){key=storeb[a];ind=[a]}else if(storeb[a]===key){ind.push(a)}}d=ind.length;b=d+c;for(a=c;a<b;a+=1){storeb[ind[e]]=storeb[a];storeb[a]=key;e+=1}c+=d;if(c<len){safeSort__ascend_recurse()}else{if(recursive===true){child()}item=storeb}};recurse();return item};if(arTest(array)===false){return array}if(recursive==="true"){recursive=true}else if(recursive!==true){recursive=false}if(operation==="normal"){return normal(array)}if(operation==="descend"){return descend(array)}return ascend(array)},core=function core(api){var spacetest=(/^\s+$/g),apioutput="",apidiffout="",builder={},setlangmode=function core__langkey_setlangmode(input){if(input==="css"||input==="less"||input==="scss"){return "css"}if(input.indexOf("html")>-1||input==="html"||input==="ejs"||input==="html_ruby"||input==="handlebars"||input==="swig"||input==="twig"||input==="php"||input==="dustjs"){return "html"}if(input==="markup"||input==="jsp"||input==="xml"||input==="xhtml"){return "markup"}if(input==="javascript"||input==="json"||input==="jsx"){return "javascript"}if(input==="text"){return "text"}if(input==="csv"){return "csv"}if(input==="tss"||input==="titanium"){return "tss"}return "javascript"},nameproper=function core__langkey_nameproper(input){if(input==="javascript"){return "JavaScript"}if(input==="text"){return "Plain Text"}if(input==="jsx"){return "React JSX"}if(input==="scss"){return "SCSS (Sass)"}if(input==="ejs"){return "EJS Template"}if(input==="handlebars"){return "Handlebars Template"}if(input==="html_ruby"){return "ERB (Ruby) Template"}if(input==="tss"||input==="titanium"){return "Titanium Stylesheets"}if(input==="typescript"){return "TypeScript (not supported yet)"}if(input==="twig"){return "HTML TWIG Template"}if(input==="jsp"){return "JSTL (JSP)"}if(input==="java"){return "Java (not supported yet)"}return input.toUpperCase()},options={accessibility:(api.accessib