├── fonts ├── fontawesome-webfont.woff └── glyphicons-halflings-regular.woff ├── README.md ├── css ├── jquery.numberedtextarea.css ├── base.css └── font-awesome.min.css ├── js ├── jquery.message.js ├── FileSaver.min.js ├── jquery.numberedtextarea.js ├── jquery.json.js ├── jquery.json2xml.js ├── jquery.xml2json.js ├── clipboard.min.js ├── json2.js ├── jsonlint.js └── bootstrap.min.js └── index.html /fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/speed/json-1/master/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Json 2 | Json在线解析,提供相关的Json解析、验证、格式化、压缩、编辑器以及Json与XML相互转换等服务, 3 | 具体详见:https://blog.cuixx.com/tools/json/index.html 。 -------------------------------------------------------------------------------- /fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/speed/json-1/master/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /css/jquery.numberedtextarea.css: -------------------------------------------------------------------------------- 1 | 2 | div.numberedtextarea-wrapper { position: relative; } 3 | 4 | div.numberedtextarea-wrapper textarea { 5 | display: block; 6 | -webkit-box-sizing: border-box; 7 | -moz-box-sizing: border-box; 8 | box-sizing: border-box; 9 | } 10 | 11 | div.numberedtextarea-line-numbers { 12 | position: absolute; 13 | display: none; 14 | background-color: #fafafa; 15 | top: 0; 16 | left: 0; 17 | right: 0; 18 | bottom: 0; 19 | width: 40px; 20 | border-right: 1px dashed #eee; 21 | border-bottom:solid 1px #ddd; 22 | color: #999; 23 | overflow: hidden; 24 | } 25 | 26 | div.numberedtextarea-number { 27 | padding-right: 6px; 28 | text-align: center; 29 | } 30 | -------------------------------------------------------------------------------- /css/base.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | html{ 3 | height: 100%; 4 | } 5 | html, body { 6 | height: 100%; 7 | } 8 | body{ 9 | font-family:menlo,monospace, Tahoma,"微软雅黑","幼圆"; 10 | color: #4A5560; 11 | font-size: 12px; 12 | height: 100%; 13 | } 14 | /*::-moz-selection { 15 | background: #12c48b; 16 | color: #fff; 17 | text-shadow: none; 18 | } 19 | 20 | ::selection { 21 | background: #12c48b; 22 | color: #fff; 23 | text-shadow: none; 24 | }*/ 25 | 26 | a{ 27 | display: inline-block; 28 | text-decoration: none; 29 | color: #1BAAE4; 30 | font-family: monospace, Tahoma,'微软雅黑'; 31 | } 32 | .green{ 33 | color:#17B272; 34 | } 35 | .red{ 36 | color:#FF585D; 37 | } 38 | .red:hover{ 39 | color: #f98280; 40 | } 41 | .blue{ 42 | color:#1BAAE4; 43 | } 44 | .orange{ 45 | color:#FBC462; 46 | } 47 | input:focus, textarea:focus { 48 | outline: none; 49 | } 50 | a:hover{ 51 | text-decoration: none; 52 | color: #47A7E6; 53 | } 54 | .label-success{ 55 | background-color: #0fd59d; 56 | } 57 | .header{ 58 | border-bottom: solid 1px #E5EBEE; 59 | padding: 0px; 60 | } 61 | .logo{ 62 | text-decoration: none; 63 | font-weight: bold; 64 | font-size: 20px; 65 | font-family: monospace; 66 | color: #0fd59d; 67 | padding: 10px; 68 | } 69 | .logo:hover{ 70 | color: #0fd59d; 71 | } 72 | .navi{ 73 | padding:5px 20px; 74 | font-size:12px; 75 | font-weight:bold; 76 | } 77 | .navi a{ 78 | padding: 0px 20px; 79 | color: #4A5560; 80 | } 81 | .json-src{ 82 | height:100%;min-height:550px; 83 | background-color:#f6f6f6;padding:0 10px 10px 10px; 84 | border:0;border-right:solid 1px #E5EBEE;border-bottom:solid 1px #eee;border-radius:0; 85 | esize: none; outline:none;font-size:10px; 86 | } 87 | .tool{ 88 | padding:10px; 89 | height: 40px; 90 | border-bottom:solid 1px #eee; 91 | background-color:#fff; 92 | width:100%;font-size:12px; 93 | z-index:100; 94 | } 95 | .tool a{ 96 | padding: 0px 20px; 97 | color: #999; 98 | } 99 | .navi a:hover{ 100 | color: #888; 101 | } 102 | -------------------------------------------------------------------------------- /js/jquery.message.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * jQuery Message Plugin (with Transition Definitions) 3 | * Examples and documentation at: http://json.cn/ 4 | * Copyright (c) 2012-2017 Paul.Ren. 5 | * Version: 1.0.2 (19-OCT-2017) 6 | * Dual licensed under the MIT and GPL licenses. 7 | * http://jquery.malsup.com/license.html 8 | * Requires: jQuery v1.3.1 or later 9 | */ 10 | var container=$('#jquery-beauty-msg'); 11 | if(container.length<=0){ 12 | $("body").append('
'); 13 | container=$('#jquery-beauty-msg'); 14 | } 15 | var containerStyle='color:#e1282b;font-family:"微软雅黑";font-weight:bold;font-size:20px;text-shadow:5px 5px 10px #eee;' 16 | +'text-align:center;margin:0;padding-top:15%;width:100%;word-break:break-all;z-index:100000;'; 17 | var closeFlag=false; 18 | var timer=0; 19 | var msgContent=''; 20 | $.msg=function(txt,style,obj,delay){ 21 | msgContent=txt; 22 | 23 | if(obj!="undefined"&&obj!=null){ 24 | containerStyle+='position:relative;top:'+$(obj).attr('top')+';left:'+$(obj).attr('left')+';'; 25 | } 26 | else{ 27 | containerStyle+='position:fixed;top:0;left:0;'; 28 | $(container).attr('style',containerStyle+style); 29 | $(container).html(msgContent); 30 | $(container).fadeIn(300,function(){ 31 | $(container).animate({fontSize:'40px'},'300'); 32 | $(container).delay(1000).fadeOut(); 33 | }); 34 | } 35 | } 36 | function addDot(){ 37 | msgContent=msgContent+"."; 38 | $(container).html(msgContent); 39 | timer=timer+1; 40 | if(!closeFlag&&timer>=5){ 41 | $(container).html("操作超时!"); 42 | window.clearInterval(); 43 | } 44 | } 45 | $.loading=function(txt,action){ 46 | msgContent=txt; 47 | containerStyle+='position:fixed;top:0;left:0;'; 48 | $(container).attr('style',containerStyle+"color:blue;"); 49 | $(container).html(msgContent); 50 | if(action!="close"){ 51 | $(container).fadeIn(300,function(){ 52 | $(container).animate({fontSize:'40px'},'300'); 53 | }); 54 | window.setInterval("addDot",1000); 55 | 56 | }else{ 57 | window.clearInterval(); 58 | closeFlag=true; 59 | $(container).fadeOut(); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /js/FileSaver.min.js: -------------------------------------------------------------------------------- 1 | /*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */ 2 | var saveAs=saveAs||function(e){"use strict";if(typeof e==="undefined"||typeof navigator!=="undefined"&&/MSIE [1-9]\./.test(navigator.userAgent)){return}var t=e.document,n=function(){return e.URL||e.webkitURL||e},r=t.createElementNS("http://www.w3.org/1999/xhtml","a"),o="download"in r,a=function(e){var t=new MouseEvent("click");e.dispatchEvent(t)},i=/constructor/i.test(e.HTMLElement)||e.safari,f=/CriOS\/[\d]+/.test(navigator.userAgent),u=function(t){(e.setImmediate||e.setTimeout)(function(){throw t},0)},s="application/octet-stream",d=1e3*40,c=function(e){var t=function(){if(typeof e==="string"){n().revokeObjectURL(e)}else{e.remove()}};setTimeout(t,d)},l=function(e,t,n){t=[].concat(t);var r=t.length;while(r--){var o=e["on"+t[r]];if(typeof o==="function"){try{o.call(e,n||e)}catch(a){u(a)}}}},p=function(e){if(/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)){return new Blob([String.fromCharCode(65279),e],{type:e.type})}return e},v=function(t,u,d){if(!d){t=p(t)}var v=this,w=t.type,m=w===s,y,h=function(){l(v,"writestart progress write writeend".split(" "))},S=function(){if((f||m&&i)&&e.FileReader){var r=new FileReader;r.onloadend=function(){var t=f?r.result:r.result.replace(/^data:[^;]*;/,"data:attachment/file;");var n=e.open(t,"_blank");if(!n)e.location.href=t;t=undefined;v.readyState=v.DONE;h()};r.readAsDataURL(t);v.readyState=v.INIT;return}if(!y){y=n().createObjectURL(t)}if(m){e.location.href=y}else{var o=e.open(y,"_blank");if(!o){e.location.href=y}}v.readyState=v.DONE;h();c(y)};v.readyState=v.INIT;if(o){y=n().createObjectURL(t);setTimeout(function(){r.href=y;r.download=u;a(r);h();c(y);v.readyState=v.DONE});return}S()},w=v.prototype,m=function(e,t,n){return new v(e,t||e.name||"download",n)};if(typeof navigator!=="undefined"&&navigator.msSaveOrOpenBlob){return function(e,t,n){t=t||e.name||"download";if(!n){e=p(e)}return navigator.msSaveOrOpenBlob(e,t)}}w.abort=function(){};w.readyState=w.INIT=0;w.WRITING=1;w.DONE=2;w.error=w.onwritestart=w.onprogress=w.onwrite=w.onabort=w.onerror=w.onwriteend=null;return m}(typeof self!=="undefined"&&self||typeof window!=="undefined"&&window||this.content);if(typeof module!=="undefined"&&module.exports){module.exports.saveAs=saveAs}else if(typeof define!=="undefined"&&define!==null&&define.amd!==null){define("FileSaver.js",function(){return saveAs})} 3 | -------------------------------------------------------------------------------- /js/jquery.numberedtextarea.js: -------------------------------------------------------------------------------- 1 | /* 2 | * NumberedTextarea - jQuery Plugin 3 | * Textarea with line numbering 4 | * 5 | * Copyright (c) 2015 Dariusz Arciszewski 6 | * 7 | * Requires: jQuery v2.0+ 8 | * 9 | * Licensed under the GPL licenses: 10 | * http://www.gnu.org/licenses/gpl.html 11 | */ 12 | 13 | (function ($) { 14 | 15 | $.fn.numberedtextarea = function(options) { 16 | 17 | var settings = $.extend({ 18 | color: null, // Font color 19 | borderColor: null, // Border color 20 | class: null, // Add class to the 'numberedtextarea-wrapper' 21 | allowTabChar: false, // If true Tab key creates indentation 22 | }, options); 23 | 24 | this.each(function() { 25 | if(this.nodeName.toLowerCase() !== "textarea") { 26 | console.log('This is not a