{"id":2183,"date":"2012-12-22T09:05:35","date_gmt":"2012-12-22T00:05:35","guid":{"rendered":"https:\/\/gunmagisgeek.com\/wordpress\/?p=2183"},"modified":"2015-08-22T13:41:41","modified_gmt":"2015-08-22T04:41:41","slug":"post-2183","status":"publish","type":"post","link":"https:\/\/gunmagisgeek.com\/blog\/javascript\/2183","title":{"rendered":"Javascript\u3067txt\u30d5\u30a1\u30a4\u30eb\u306e\u6bd4\u8f03\u30fb\u5dee\u5206(diff)\u3092\u8868\u793a\u3059\u308b\u30e9\u30a4\u30d6\u30e9\u30ea\u300cMergely\u300d"},"content":{"rendered":"<p><a href=\"http:\/\/shimz.me\/example\/mergely\/index.html\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/gunmagisgeek.com\/blog\/wp-content\/uploads\/2012\/12\/mergely.jpg\" alt=\"mergely example\" width=\"590\" height=\"183\" class=\"alignnone size-full wp-image-4451 border\" srcset=\"https:\/\/gunmagisgeek.com\/blog\/wp-content\/uploads\/2012\/12\/mergely.jpg 590w, https:\/\/gunmagisgeek.com\/blog\/wp-content\/uploads\/2012\/12\/mergely-300x93.jpg 300w\" sizes=\"auto, (max-width: 590px) 100vw, 590px\" \/><\/a><\/p>\n<p>\u4ee5\u524d\u3001<a href=\"https:\/\/gunmagisgeek.com\/blog\/map\/2135\">\u3053\u3061\u3089<\/a>\u306e\u8a18\u4e8b\u3067\u4f7f\u7528\u3057\u305f\u4e8c\u3064\u306e\u30d5\u30a1\u30a4\u30eb\uff08\u30c6\u30ad\u30b9\u30c8\uff09\u306e\u5dee\u7570(diff)\u3092\u8868\u793a\u3057\u3066\u304f\u308c\u308bWeb\u30b5\u30fc\u30d3\u30b9\u300c<a href=\"http:\/\/www.mergely.com\">Mergely<\/a>\u300d\u3067\u3059\u304c\u3001\u30e9\u30a4\u30d6\u30e9\u30ea\u304c\u516c\u958b\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u81ea\u30b5\u30a4\u30c8\u306bdiff\u306e\u4ed5\u7d44\u307f\u3092\u53d6\u308a\u5165\u308c\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><a href=\"http:\/\/www.mergely.com\/about.php\">Mergely(\u30e9\u30a4\u30d6\u30e9\u30ea)<\/a><\/p>\n<p>\u4f7f\u7528\u65b9\u6cd5\u306f\u975e\u5e38\u306b\u7c21\u5358\u3067\u3059\u3002<\/p>\n<h2>\u30b5\u30f3\u30d7\u30eb<\/h2>\n<pre class=\"lang:xhtml decode:true \" >\r\n&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;meta charset=\"utf-8\" \/&gt;\r\n \r\n&lt;script type=\"text\/javascript\" src=\"\/\/ajax.googleapis.com\/ajax\/libs\/jquery\/1.10.2\/jquery.min.js\"&gt;&lt;\/script&gt;\r\n \r\n&lt;!-- Mergely\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u8aad\u307f\u8fbc\u307f --&gt;\r\n&lt;script  src=\"lib\/codemirror.js\"&gt;&lt;\/script&gt;\r\n&lt;script  src=\"lib\/mergely.js\"&gt;&lt;\/script&gt;\r\n&lt;link type=\"text\/css\" rel=\"stylesheet\" href=\"lib\/codemirror.css\" \/&gt;\r\n&lt;link type=\"text\/css\" rel=\"stylesheet\" href=\"lib\/mergely.css\" \/&gt;\r\n \r\n&lt;\/head&gt;\r\n \r\n \r\n&lt;body&gt;\r\n    &lt;div id=\"compare\" style=\"width:100%\"&gt;&lt;div&gt;\r\n&lt;\/body&gt;\r\n \r\n \r\n&lt;script&gt;\r\n$(document).ready(function () {\r\n\t$('#compare').mergely({\r\n\t\tcmsettings: { \r\n\t\t\treadOnly: false, \/\/\u8aad\u8fbc\u307f\u306e\u307f\r\n\t\t\tlineNumbers: true \/\/\u884c\u756a\u53f7\u306e\u8868\u793a\r\n\t\t},\r\n\t\tlhs: function(setValue) {\r\n\t\t\tsetValue('\u65e5\u672c\u8a9e\u3067\u3082n\u3061\u3083\u3093\u3068diffn\u3067\u304d\u307e\u3059\u304b\uff1fn\u7de8\u96c6\u3082\u3067\u304d\u305f\u308a\u3057\u307e\u3059\u304b\uff1f'); \/\/\u6bd4\u8f03\u5143\u30c6\u30ad\u30b9\u30c8\r\n\t\t},\r\n\t\trhs: function(setValue) {\r\n\t\t\tsetValue('\u65e5\u672c\u8a9e\u3067\u3082n\u3061\u3083\u3093\u3068diffn\u3067\u304d\u308bn\u7de8\u96c6\u3082\u3067\u304d\u308b\u306e\u3067n\u4f55\u304b\u5165\u529b\u3057\u3066\u307f\u3066\u306d\uff01'); \/\/\u6bd4\u8f03\u5148\u30c6\u30ad\u30b9\u30c8\r\n\t\t}\r\n\t});\r\n});\r\n&lt;\/script&gt;\r\n&lt;\/html&gt;<\/pre>\n<p><a href=\"http:\/\/shimz.me\/example\/mergely\/index.html\">example<\/a><\/p>\n<p>\u5916\u90e8\u30d5\u30a1\u30a4\u30eb\u306e\u8aad\u307f\u8fbc\u307f\u306f\u3001jQuery\u306eXHR\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"lang:js decode:true \" >        $(document).ready(function () {\r\n\t\t\t$('#compare').mergely({\r\n\t\t\t\tcmsettings: { readOnly: false, lineWrapping: true }\r\n\t\t\t});\r\n\t\t\t$.ajax({\r\n\t\t\t\ttype: 'GET', async: true, dataType: 'text',\r\n\t\t\t\turl: 'lhs_hoge.txt',\r\n\t\t\t\tsuccess: function (response) {\r\n\t\t\t\t\t$('#compare').mergely('lhs', response);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t$.ajax({\r\n\t\t\t\ttype: 'GET', async: true, dataType: 'text',\r\n\t\t\t\turl: 'rhs_hoge.txt',\r\n\t\t\t\tsuccess: function (response) {\r\n\t\t\t\t\t$('#compare').mergely('rhs', response);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t});<\/pre>\n<p>\u5bfe\u5fdc\u3057\u3066\u3044\u308b\u30d6\u30e9\u30a6\u30b6\u306f\u4ee5\u4e0b\u3002<\/p>\n<ul>\n<li>Firefox 2+<\/li>\n<li>Chrome &#8211; any version<\/li>\n<li>Internet Exporer 9+<\/li>\n<li>Safari 3+<\/li>\n<li>Opera 9+<\/li>\n<\/ul>\n<p>\u306a\u306b\u3052\u306b\u30d5\u30a1\u30a4\u30eb\u306e\u30c9\u30e9\u30c3\u30b0\uff06\u30c9\u30ed\u30c3\u30d7\u306b\u3082\u5bfe\u5fdc\u3057\u3066\u3044\u305f\u308a\u3059\u308b\u306e\u3067\u4fbf\u5229\u3067\u3059\u3002\u305d\u306e\u4ed6\u3001\u8a73\u3057\u3044\u6a5f\u80fd\u306b\u3064\u3044\u3066\u306f\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><a href=\"http:\/\/www.mergely.com\/doc\">Mergely Reference Manual<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4ee5\u524d\u3001\u3053\u3061\u3089\u306e\u8a18\u4e8b\u3067\u4f7f\u7528\u3057\u305f\u4e8c\u3064\u306e\u30d5\u30a1\u30a4\u30eb\uff08\u30c6\u30ad\u30b9&hellip;<\/p>\n","protected":false},"author":1,"featured_media":4451,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-2183","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-javascript","has-post-thumbnail-archive"],"_links":{"self":[{"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/posts\/2183","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/comments?post=2183"}],"version-history":[{"count":11,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/posts\/2183\/revisions"}],"predecessor-version":[{"id":2198,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/posts\/2183\/revisions\/2198"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/media\/4451"}],"wp:attachment":[{"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/media?parent=2183"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/categories?post=2183"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/tags?post=2183"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}