<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[40060] trunk: Media: debounce the media grid search, avoiding duplicate requests.</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/40060">40060</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/40060","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>adamsilverstein</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2017-02-15 17:28:54 +0000 (Wed, 15 Feb 2017)</dd>
</dl>

<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Media: debounce the media grid search, avoiding duplicate requests.

Add a debounce wrapper to the media grid search handler. The search callback is now fired after a 300 ms typing pause.

Remove redundant handlers for 'search' and 'change', preventing multiple/duplicate search callbacks.

Props certainstrings, joemcgill, Kelderic, batmoo.
Fixes <a href="https://core.trac.wordpress.org/ticket/38911">#38911</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpincludesjsmediaviewssearchjs">trunk/src/wp-includes/js/media/views/search.js</a></li>
<li><a href="#trunksrcwpincludesjsmediaviewsjs">trunk/src/wp-includes/js/media-views.js</a></li>
<li><a href="#trunktestsqunitfixtureswpapigeneratedjs">trunk/tests/qunit/fixtures/wp-api-generated.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpincludesjsmediaviewssearchjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/js/media/views/search.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/js/media/views/search.js    2017-02-14 18:41:25 UTC (rev 40059)
+++ trunk/src/wp-includes/js/media/views/search.js      2017-02-15 17:28:54 UTC (rev 40060)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -21,9 +21,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        events: {
</span><span class="cx" style="display: block; padding: 0 10px">                'input':  'search',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                'keyup':  'search',
-               'change': 'search',
-               'search': 'search'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         'keyup':  'search'
</ins><span class="cx" style="display: block; padding: 0 10px">         },
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -34,13 +32,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">                return this;
</span><span class="cx" style="display: block; padding: 0 10px">        },
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        search: function( event ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ search: _.debounce( function( event ) {
</ins><span class="cx" style="display: block; padding: 0 10px">                 if ( event.target.value ) {
</span><span class="cx" style="display: block; padding: 0 10px">                        this.model.set( 'search', event.target.value );
</span><span class="cx" style="display: block; padding: 0 10px">                } else {
</span><span class="cx" style="display: block; padding: 0 10px">                        this.model.unset('search');
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }, 300 )
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> module.exports = Search;
</span></span></pre></div>
<a id="trunksrcwpincludesjsmediaviewsjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/js/media-views.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/js/media-views.js   2017-02-14 18:41:25 UTC (rev 40059)
+++ trunk/src/wp-includes/js/media-views.js     2017-02-15 17:28:54 UTC (rev 40060)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7085,9 +7085,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        events: {
</span><span class="cx" style="display: block; padding: 0 10px">                'input':  'search',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                'keyup':  'search',
-               'change': 'search',
-               'search': 'search'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         'keyup':  'search'
</ins><span class="cx" style="display: block; padding: 0 10px">         },
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7098,13 +7096,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">                return this;
</span><span class="cx" style="display: block; padding: 0 10px">        },
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        search: function( event ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ search: _.debounce( function( event ) {
</ins><span class="cx" style="display: block; padding: 0 10px">                 if ( event.target.value ) {
</span><span class="cx" style="display: block; padding: 0 10px">                        this.model.set( 'search', event.target.value );
</span><span class="cx" style="display: block; padding: 0 10px">                } else {
</span><span class="cx" style="display: block; padding: 0 10px">                        this.model.unset('search');
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }, 300 )
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> module.exports = Search;
</span></span></pre></div>
<a id="trunktestsqunitfixtureswpapigeneratedjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/qunit/fixtures/wp-api-generated.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/qunit/fixtures/wp-api-generated.js    2017-02-14 18:41:25 UTC (rev 40059)
+++ trunk/tests/qunit/fixtures/wp-api-generated.js      2017-02-15 17:28:54 UTC (rev 40060)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -12,25 +12,25 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> mockedApiResponse.oembeds = {"code":"rest_missing_callback_param","message":"Missing parameter(s): url","data":{"status":400,"params":["url"]}};
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-mockedApiResponse.PostsCollection = [{"id":1368,"date":"2017-02-14T04:05:35","date_gmt":"2017-02-14T04:05:35","guid":{"rendered":"http:\/\/example.org\/?p=1368"},"modified":"2017-02-14T04:05:35","modified_gmt":"2017-02-14T04:05:35","slug":"post-title-6208","type":"post","link":"http:\/\/example.org\/?p=1368","title":{"rendered":"Post title 6208"},"content":{"rendered":"<p>Updated content.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Post excerpt 6208<\/p>\n","protected":false},"author":354,"featured_media":0,"comment_status":"open",
 "ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"test_single":"","test_multi":[],"test_bad_auth":"","test_bad_auth_multi":[],"test_custom_schema":0,"test_custom_schema_multi":[],"new_name":"","new_name_multi":[],"test_string":"","test_number":0,"test_bool":false,"my_meta_key":[]},"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/posts\/1368"}],"collection":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href&
 quot;:"http:\/\/example.org\/?rest_route=\/wp\/v2\/users\/354"}],"replies":[{"embeddable":true,"href":"http:\/\/example.org\/?rest_route=%2Fwp%2Fv2%2Fcomments&post=1368"}],"version-history":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/posts\/1368\/revisions"}],"wp:attachment":[{"href":"http:\/\/example.org\/?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1368"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/example.org\/?rest_route=%2Fwp%2Fv2%2Fcategories&post=1368"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/example.org\/?rest_route=%2Fwp%2Fv2%2Ftags&post=1368"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+mockedApiResponse.PostsCollection = [{"id":3,"date":"2017-02-15T17:26:28","date_gmt":"2017-02-15T17:26:28","guid":{"rendered":"http:\/\/example.org\/?p=3"},"modified":"2017-02-15T17:26:28","modified_gmt":"2017-02-15T17:26:28","slug":"post-title-19","type":"post","link":"http:\/\/example.org\/?p=3","title":{"rendered":"Post title 19"},"content":{"rendered":"<p>Updated content.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Post excerpt 19<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status&
 quot;:"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/posts\/3"}],"collection":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/example.org\/?rest_route=%2Fwp%2Fv2%2Fcomments&post=3"}],"version-history":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/posts\/3\/revisions"}],"wp:attachment":[{"href":"http:\/\/exampl
 e.org\/?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/example.org\/?rest_route=%2Fwp%2Fv2%2Fcategories&post=3"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/example.org\/?rest_route=%2Fwp%2Fv2%2Ftags&post=3"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}];
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-mockedApiResponse.PostModel = {"id":1368,"date":"2017-02-14T04:05:35","date_gmt":"2017-02-14T04:05:35","guid":{"rendered":"http:\/\/example.org\/?p=1368"},"modified":"2017-02-14T04:05:35","modified_gmt":"2017-02-14T04:05:35","slug":"post-title-6208","type":"post","link":"http:\/\/example.org\/?p=1368","title":{"rendered":"Post title 6208"},"content":{"rendered":"<p>Updated content.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Post excerpt 6208<\/p>\n","protected":false},"author":354,"featured_media":0,"comment_status":"open","p
 ing_status":"open","sticky":false,"template":"","format":"standard","meta":{"test_single":"","test_multi":[],"test_bad_auth":"","test_bad_auth_multi":[],"test_custom_schema":0,"test_custom_schema_multi":[],"new_name":"","new_name_multi":[],"test_string":"","test_number":0,"test_bool":false,"my_meta_key":[]},"categories":[1],"tags":[]};
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+mockedApiResponse.PostModel = {"id":3,"date":"2017-02-15T17:26:28","date_gmt":"2017-02-15T17:26:28","guid":{"rendered":"http:\/\/example.org\/?p=3"},"modified":"2017-02-15T17:26:28","modified_gmt":"2017-02-15T17:26:28","slug":"post-title-19","type":"post","link":"http:\/\/example.org\/?p=3","title":{"rendered":"Post title 19"},"content":{"rendered":"<p>Updated content.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Post excerpt 19<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":&
 quot;open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[]};
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-mockedApiResponse.postRevisions = [{"author":"354","date":"2017-02-14T04:05:35","date_gmt":"2017-02-14T04:05:35","id":1371,"modified":"2017-02-14T04:05:35","modified_gmt":"2017-02-14T04:05:35","parent":1368,"slug":"1368-revision-v1","guid":{"rendered":"http:\/\/example.org\/?p=1371"},"title":{"rendered":"Post title 6208"},"content":{"rendered":"<p>Updated content.<\/p>\n"},"excerpt":{"rendered":"<p>Post excerpt 6208<\/p>\n"},"_links":{"parent":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/posts\/1368"}]}}];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+mockedApiResponse.postRevisions = [{"author":"2","date":"2017-02-15T17:26:28","date_gmt":"2017-02-15T17:26:28","id":6,"modified":"2017-02-15T17:26:28","modified_gmt":"2017-02-15T17:26:28","parent":3,"slug":"3-revision-v1","guid":{"rendered":"http:\/\/example.org\/?p=6"},"title":{"rendered":"Post title 19"},"content":{"rendered":"<p>Updated content.<\/p>\n"},"excerpt":{"rendered":"<p>Post excerpt 19<\/p>\n"},"_links":{"parent":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/posts\/3"}]}}];
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> mockedApiResponse.revision = {"code":"rest_post_invalid_id","message":"Invalid revision ID.","data":{"status":404}};
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-mockedApiResponse.PagesCollection = [{"id":1369,"date":"2017-02-14T04:05:35","date_gmt":"2017-02-14T04:05:35","guid":{"rendered":"http:\/\/example.org\/?page_id=1369"},"modified":"2017-02-14T04:05:35","modified_gmt":"2017-02-14T04:05:35","slug":"post-title-6209","type":"page","link":"http:\/\/example.org\/?page_id=1369","title":{"rendered":"Post title 6209"},"content":{"rendered":"<p>Updated content.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Post excerpt 6209<\/p>\n","protected":false},"author":354,"featured_media":0,"parent":0,"menu_
 order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"test_single":"","test_multi":[],"test_bad_auth":"","test_bad_auth_multi":[],"test_custom_schema":0,"test_custom_schema_multi":[],"new_name":"","new_name_multi":[],"test_string":"","test_number":0,"test_bool":false,"my_meta_key":[]},"_links":{"self":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/pages\/1369"}],"collection":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/example.org\/?rest_route=\/wp
 \/v2\/users\/354"}],"replies":[{"embeddable":true,"href":"http:\/\/example.org\/?rest_route=%2Fwp%2Fv2%2Fcomments&post=1369"}],"version-history":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/pages\/1369\/revisions"}],"wp:attachment":[{"href":"http:\/\/example.org\/?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1369"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+mockedApiResponse.PagesCollection = [{"id":4,"date":"2017-02-15T17:26:28","date_gmt":"2017-02-15T17:26:28","guid":{"rendered":"http:\/\/example.org\/?page_id=4"},"modified":"2017-02-15T17:26:28","modified_gmt":"2017-02-15T17:26:28","slug":"post-title-20","type":"page","link":"http:\/\/example.org\/?page_id=4","title":{"rendered":"Post title 20"},"content":{"rendered":"<p>Updated content.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Post excerpt 20<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,&quo
 t;comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/pages\/4"}],"collection":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/example.org\/?rest_route=%2Fwp%2Fv2%2Fcomments&post=4"}],"version-history":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/pages\/4\/revisions"}],"wp:attachment":[{"href":"http:\/\/example.org\/?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4
 "}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}];
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-mockedApiResponse.PageModel = {"id":1369,"date":"2017-02-14T04:05:35","date_gmt":"2017-02-14T04:05:35","guid":{"rendered":"http:\/\/example.org\/?page_id=1369"},"modified":"2017-02-14T04:05:35","modified_gmt":"2017-02-14T04:05:35","slug":"post-title-6209","type":"page","link":"http:\/\/example.org\/?page_id=1369","title":{"rendered":"Post title 6209"},"content":{"rendered":"<p>Updated content.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Post excerpt 6209<\/p>\n","protected":false},"author":354,"featured_media":0,"parent":0,"menu_order&q
 uot;:0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"test_single":"","test_multi":[],"test_bad_auth":"","test_bad_auth_multi":[],"test_custom_schema":0,"test_custom_schema_multi":[],"new_name":"","new_name_multi":[],"test_string":"","test_number":0,"test_bool":false,"my_meta_key":[]}};
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+mockedApiResponse.PageModel = {"id":4,"date":"2017-02-15T17:26:28","date_gmt":"2017-02-15T17:26:28","guid":{"rendered":"http:\/\/example.org\/?page_id=4"},"modified":"2017-02-15T17:26:28","modified_gmt":"2017-02-15T17:26:28","slug":"post-title-20","type":"page","link":"http:\/\/example.org\/?page_id=4","title":{"rendered":"Post title 20"},"content":{"rendered":"<p>Updated content.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Post excerpt 20<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comme
 nt_status":"closed","ping_status":"closed","template":"","meta":[]};
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-mockedApiResponse.pageRevisions = [{"author":"354","date":"2017-02-14T04:05:35","date_gmt":"2017-02-14T04:05:35","id":1372,"modified":"2017-02-14T04:05:35","modified_gmt":"2017-02-14T04:05:35","parent":1369,"slug":"1369-revision-v1","guid":{"rendered":"http:\/\/example.org\/?p=1372"},"title":{"rendered":"Post title 6209"},"content":{"rendered":"<p>Updated content.<\/p>\n"},"excerpt":{"rendered":"<p>Post excerpt 6209<\/p>\n"},"_links":{"parent":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/pages\/1369"}]}}];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+mockedApiResponse.pageRevisions = [{"author":"2","date":"2017-02-15T17:26:28","date_gmt":"2017-02-15T17:26:28","id":7,"modified":"2017-02-15T17:26:28","modified_gmt":"2017-02-15T17:26:28","parent":4,"slug":"4-revision-v1","guid":{"rendered":"http:\/\/example.org\/?p=7"},"title":{"rendered":"Post title 20"},"content":{"rendered":"<p>Updated content.<\/p>\n"},"excerpt":{"rendered":"<p>Post excerpt 20<\/p>\n"},"_links":{"parent":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/pages\/4"}]}}];
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> mockedApiResponse.pageRevision = {"code":"rest_post_invalid_id","message":"Invalid revision ID.","data":{"status":404}};
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-mockedApiResponse.MediaCollection = [{"id":1370,"date":"2017-02-14T04:05:35","date_gmt":"2017-02-14T04:05:35","guid":{"rendered":"http:\/\/example.org\/?attachment_id=1370"},"modified":"2017-02-14T04:05:35","modified_gmt":"2017-02-14T04:05:35","slug":"1370","type":"attachment","link":"http:\/\/example.org\/?attachment_id=1370","title":{"rendered":""},"author":354,"comment_status":"open","ping_status":"closed","template":"","meta":{"test_single":"","test_multi":[],"test_bad_auth":"","test_bad_auth_multi":[],"test_custom_schema":0,&quot
 ;test_custom_schema_multi":[],"new_name":"","new_name_multi":[],"test_string":"","test_number":0,"test_bool":false,"my_meta_key":[]},"description":{"rendered":"<p class=\"attachment\"><a href='http:\/\/example.org\/wp-content\/uploads\/\/tmp\/canola.jpg'><img width=\"1\" height=\"1\" src=\"http:\/\/example.org\/wp-content\/uploads\/\/tmp\/canola.jpg\" class=\"attachment-medium size-medium\" alt=\"\" \/><\/a><\/p>\n"},"caption":{"rendered":"<p>A sample caption<\/p>\n"},"alt_text":"","media_type":"image","mime_type":"image\/jpeg","media_details":{},"post":null,"source_url":"http:\/\/example.org\/wp-content\/uploads\/\/tmp\/canola.jpg","_li
 nks":{"self":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/media\/1370"}],"collection":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/media"}],"about":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/types\/attachment"}],"author":[{"embeddable":true,"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/users\/354"}],"replies":[{"embeddable":true,"href":"http:\/\/example.org\/?rest_route=%2Fwp%2Fv2%2Fcomments&post=1370"}]}}];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+mockedApiResponse.MediaCollection = [{"id":5,"date":"2017-02-15T17:26:28","date_gmt":"2017-02-15T17:26:28","guid":{"rendered":"http:\/\/example.org\/?attachment_id=5"},"modified":"2017-02-15T17:26:28","modified_gmt":"2017-02-15T17:26:28","slug":"5","type":"attachment","link":"http:\/\/example.org\/?attachment_id=5","title":{"rendered":""},"author":2,"comment_status":"open","ping_status":"closed","template":"","meta":[],"description":{"rendered":"<p class=\"attachment\"><a href='http:\/\/example.org\/wp-content\/uploads\/\/tmp\/canola.jpg'><img width=\&quo
 t;1\" height=\"1\" src=\"http:\/\/example.org\/wp-content\/uploads\/\/tmp\/canola.jpg\" class=\"attachment-medium size-medium\" alt=\"\" \/><\/a><\/p>\n"},"caption":{"rendered":"<p>A sample caption<\/p>\n"},"alt_text":"","media_type":"image","mime_type":"image\/jpeg","media_details":{},"post":null,"source_url":"http:\/\/example.org\/wp-content\/uploads\/\/tmp\/canola.jpg","_links":{"self":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/media\/5"}],"collection":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/media"}],"about":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/types\/attachment"}],"author":[{"embeddable":true,"href":"h
 ttp:\/\/example.org\/?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/example.org\/?rest_route=%2Fwp%2Fv2%2Fcomments&post=5"}]}}];
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-mockedApiResponse.MediaModel = {"id":1370,"date":"2017-02-14T04:05:35","date_gmt":"2017-02-14T04:05:35","guid":{"rendered":"http:\/\/example.org\/?attachment_id=1370"},"modified":"2017-02-14T04:05:35","modified_gmt":"2017-02-14T04:05:35","slug":"1370","type":"attachment","link":"http:\/\/example.org\/?attachment_id=1370","title":{"rendered":""},"author":354,"comment_status":"open","ping_status":"closed","template":"","meta":{"test_single":"","test_multi":[],"test_bad_auth":"","test_bad_auth_multi":[],"test_custom_schema":0,"test_
 custom_schema_multi":[],"new_name":"","new_name_multi":[],"test_string":"","test_number":0,"test_bool":false,"my_meta_key":[]},"description":{"rendered":"<p class=\"attachment\"><a href='http:\/\/example.org\/wp-content\/uploads\/\/tmp\/canola.jpg'><img width=\"1\" height=\"1\" src=\"http:\/\/example.org\/wp-content\/uploads\/\/tmp\/canola.jpg\" class=\"attachment-medium size-medium\" alt=\"\" \/><\/a><\/p>\n"},"caption":{"rendered":"<p>A sample caption<\/p>\n"},"alt_text":"","media_type":"image","mime_type":"image\/jpeg","media_details":{},"post":null,"source_url":"http:\/\/example.org\/wp-content\/uploads\/\/tmp\/canola.jpg"};
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+mockedApiResponse.MediaModel = {"id":5,"date":"2017-02-15T17:26:28","date_gmt":"2017-02-15T17:26:28","guid":{"rendered":"http:\/\/example.org\/?attachment_id=5"},"modified":"2017-02-15T17:26:28","modified_gmt":"2017-02-15T17:26:28","slug":"5","type":"attachment","link":"http:\/\/example.org\/?attachment_id=5","title":{"rendered":""},"author":2,"comment_status":"open","ping_status":"closed","template":"","meta":[],"description":{"rendered":"<p class=\"attachment\"><a href='http:\/\/example.org\/wp-content\/uploads\/\/tmp\/canola.jpg'><img width=\"1\&q
 uot; height=\"1\" src=\"http:\/\/example.org\/wp-content\/uploads\/\/tmp\/canola.jpg\" class=\"attachment-medium size-medium\" alt=\"\" \/><\/a><\/p>\n"},"caption":{"rendered":"<p>A sample caption<\/p>\n"},"alt_text":"","media_type":"image","mime_type":"image\/jpeg","media_details":{},"post":null,"source_url":"http:\/\/example.org\/wp-content\/uploads\/\/tmp\/canola.jpg"};
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> mockedApiResponse.TypesCollection = {"post":{"description":"","hierarchical":false,"name":"Posts","slug":"post","taxonomies":["category","post_tag"],"rest_base":"posts","_links":{"collection":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/types"}],"wp:items":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/posts"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}},"page":{"description":"","hierarchical":true,"name":"Pages","slug":"page","taxonomies":[],"rest_base":"pages","_links":{"collection":[
 {"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/types"}],"wp:items":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/pages"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}},"attachment":{"description":"","hierarchical":false,"name":"Media","slug":"attachment","taxonomies":[],"rest_base":"media","_links":{"collection":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/types"}],"wp:items":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/media"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}};
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -48,17 +48,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> mockedApiResponse.CategoryModel = {"id":1,"count":1,"description":"","link":"http:\/\/example.org\/?cat=1","name":"Uncategorized","slug":"uncategorized","taxonomy":"category","parent":0,"meta":[]};
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-mockedApiResponse.TagsCollection = [{"id":685,"count":0,"description":"Term description 6210","link":"http:\/\/example.org\/?tag=test","name":"test","slug":"test","taxonomy":"post_tag","meta":[],"_links":{"self":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/tags\/685"}],"collection":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/tags"}],"about":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/taxonomies\/post_tag"}],"wp:post_type":[{"href":"http:\/\/example.org\/?rest_route=%2Fwp%2Fv2%2Fposts&tags=685"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}&quo
 t;,"templated":true}]}}];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+mockedApiResponse.TagsCollection = [{"id":2,"count":0,"description":"Term description 21","link":"http:\/\/example.org\/?tag=test","name":"test","slug":"test","taxonomy":"post_tag","meta":[],"_links":{"self":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/tags\/2"}],"collection":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/tags"}],"about":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/taxonomies\/post_tag"}],"wp:post_type":[{"href":"http:\/\/example.org\/?rest_route=%2Fwp%2Fv2%2Fposts&tags=2"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","
 templated":true}]}}];
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-mockedApiResponse.TagModel = {"id":685,"count":0,"description":"Term description 6210","link":"http:\/\/example.org\/?tag=test","name":"test","slug":"test","taxonomy":"post_tag","meta":[]};
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+mockedApiResponse.TagModel = {"id":2,"count":0,"description":"Term description 21","link":"http:\/\/example.org\/?tag=test","name":"test","slug":"test","taxonomy":"post_tag","meta":[]};
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-mockedApiResponse.UsersCollection = [{"id":1,"name":"admin","url":"","description":"","link":"http:\/\/example.org\/?author=1","slug":"admin","avatar_urls":{"24":"http:\/\/0.gravatar.com\/avatar\/96614ec98aa0c0d2ee75796dced6df54?s=24&d=mm&r=g","48":"http:\/\/0.gravatar.com\/avatar\/96614ec98aa0c0d2ee75796dced6df54?s=48&d=mm&r=g","96":"http:\/\/0.gravatar.com\/avatar\/96614ec98aa0c0d2ee75796dced6df54?s=96&d=mm&r=g"},"meta":[],"_links":{"self":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/users\/1"}],"collection":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/users"}]}},{"id":354,"
 name":"User 6207","url":"","description":"","link":"http:\/\/example.org\/?author=354","slug":"user-6207","avatar_urls":{"24":"http:\/\/0.gravatar.com\/avatar\/3d42d2573c72bce413cf299f434ccf19?s=24&d=mm&r=g","48":"http:\/\/0.gravatar.com\/avatar\/3d42d2573c72bce413cf299f434ccf19?s=48&d=mm&r=g","96":"http:\/\/0.gravatar.com\/avatar\/3d42d2573c72bce413cf299f434ccf19?s=96&d=mm&r=g"},"meta":[],"_links":{"self":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/users\/354"}],"collection":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/users"}]}}];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+mockedApiResponse.UsersCollection = [{"id":1,"name":"admin","url":"","description":"","link":"http:\/\/example.org\/?author=1","slug":"admin","avatar_urls":{"24":"http:\/\/0.gravatar.com\/avatar\/96614ec98aa0c0d2ee75796dced6df54?s=24&d=mm&r=g","48":"http:\/\/0.gravatar.com\/avatar\/96614ec98aa0c0d2ee75796dced6df54?s=48&d=mm&r=g","96":"http:\/\/0.gravatar.com\/avatar\/96614ec98aa0c0d2ee75796dced6df54?s=96&d=mm&r=g"},"meta":[],"_links":{"self":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/users\/1"}],"collection":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/users"}]}},{"id":2,"nam
 e":"User 18","url":"","description":"","link":"http:\/\/example.org\/?author=2","slug":"user-18","avatar_urls":{"24":"http:\/\/0.gravatar.com\/avatar\/cd631944deab1f0589fedb77b3735377?s=24&d=mm&r=g","48":"http:\/\/0.gravatar.com\/avatar\/cd631944deab1f0589fedb77b3735377?s=48&d=mm&r=g","96":"http:\/\/0.gravatar.com\/avatar\/cd631944deab1f0589fedb77b3735377?s=96&d=mm&r=g"},"meta":[],"_links":{"self":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/users\/2"}],"collection":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/users"}]}}];
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> mockedApiResponse.UserModel = {"id":1,"name":"admin","url":"","description":"","link":"http:\/\/example.org\/?author=1","slug":"admin","avatar_urls":{"24":"http:\/\/0.gravatar.com\/avatar\/96614ec98aa0c0d2ee75796dced6df54?s=24&d=mm&r=g","48":"http:\/\/0.gravatar.com\/avatar\/96614ec98aa0c0d2ee75796dced6df54?s=48&d=mm&r=g","96":"http:\/\/0.gravatar.com\/avatar\/96614ec98aa0c0d2ee75796dced6df54?s=96&d=mm&r=g"},"meta":[]};
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-mockedApiResponse.me = {"id":354,"name":"User 6207","url":"","description":"","link":"http:\/\/example.org\/?author=354","slug":"user-6207","avatar_urls":{"24":"http:\/\/0.gravatar.com\/avatar\/3d42d2573c72bce413cf299f434ccf19?s=24&d=mm&r=g","48":"http:\/\/0.gravatar.com\/avatar\/3d42d2573c72bce413cf299f434ccf19?s=48&d=mm&r=g","96":"http:\/\/0.gravatar.com\/avatar\/3d42d2573c72bce413cf299f434ccf19?s=96&d=mm&r=g"},"meta":[]};
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+mockedApiResponse.me = {"id":2,"name":"User 18","url":"","description":"","link":"http:\/\/example.org\/?author=2","slug":"user-18","avatar_urls":{"24":"http:\/\/0.gravatar.com\/avatar\/cd631944deab1f0589fedb77b3735377?s=24&d=mm&r=g","48":"http:\/\/0.gravatar.com\/avatar\/cd631944deab1f0589fedb77b3735377?s=48&d=mm&r=g","96":"http:\/\/0.gravatar.com\/avatar\/cd631944deab1f0589fedb77b3735377?s=96&d=mm&r=g"},"meta":[]};
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-mockedApiResponse.CommentsCollection = [{"id":1103,"post":1368,"parent":0,"author":0,"author_name":"Commenter 6211","author_url":"http:\/\/example.com\/6211\/","date":"2017-02-14T04:05:35","date_gmt":"2017-02-14T04:05:35","content":{"rendered":"<p>This is a comment<\/p>\n"},"link":"http:\/\/example.org\/?p=1368#comment-1103","status":"approved","type":"comment","author_avatar_urls":{"24":"http:\/\/1.gravatar.com\/avatar\/?s=24&d=mm&r=g","48":"http:\/\/0.gravatar.com\/avatar\/?s=48&d=mm&r=g","96":"http:\/\/1.gravatar.com\/avatar\/?s=96&d=mm&r=g"},"meta":[],"_links
 ":{"self":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/comments\/1103"}],"collection":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/comments"}],"up":[{"embeddable":true,"post_type":"post","href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/posts\/1368"}]}}];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+mockedApiResponse.CommentsCollection = [{"id":2,"post":3,"parent":0,"author":0,"author_name":"Commenter 22","author_url":"http:\/\/example.com\/22\/","date":"2017-02-15T17:26:28","date_gmt":"2017-02-15T17:26:28","content":{"rendered":"<p>This is a comment<\/p>\n"},"link":"http:\/\/example.org\/?p=3#comment-2","status":"approved","type":"comment","author_avatar_urls":{"24":"http:\/\/0.gravatar.com\/avatar\/?s=24&d=mm&r=g","48":"http:\/\/1.gravatar.com\/avatar\/?s=48&d=mm&r=g","96":"http:\/\/2.gravatar.com\/avatar\/?s=96&d=mm&r=g"},"meta":[],"_links":{"sel
 f":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/comments\/2"}],"collection":[{"href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/comments"}],"up":[{"embeddable":true,"post_type":"post","href":"http:\/\/example.org\/?rest_route=\/wp\/v2\/posts\/3"}]}}];
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> mockedApiResponse.CommentModel = {"code":"rest_comment_invalid_id","message":"Invalid comment ID.","data":{"status":404}};
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span></span></pre>
</div>
</div>

</body>
</html>