<!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>[2359] sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer: developer.wordpress.org: Add autocomplete to search input field.</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="http://meta.trac.wordpress.org/changeset/2359">2359</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"http://meta.trac.wordpress.org/changeset/2359","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>coffee2code</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2016-01-22 20:36:44 +0000 (Fri, 22 Jan 2016)</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'>developer.wordpress.org: Add autocomplete to search input field.

Props keesiemeijer.
Fixes <a href="http://meta.trac.wordpress.org/ticket/542">#542</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgdeveloperfunctionsphp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/functions.php</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgdeveloperincautocompletephp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/autocomplete.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgdeveloperjsautocompletejs">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/js/autocomplete.js</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgdeveloperjsawesompletejs">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/js/awesomplete.js</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgdeveloperjsawesompleteminjs">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/js/awesomplete.min.js</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgdeveloperstylesheetsautocompletecss">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/stylesheets/autocomplete.css</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgdeveloperstylesheetsawesompletecss">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/stylesheets/awesomplete.css</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgdeveloperfunctionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/functions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/functions.php 2016-01-22 19:02:40 UTC (rev 2358)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/functions.php   2016-01-22 20:36:44 UTC (rev 2359)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -71,6 +71,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> require __DIR__ . '/inc/formatting.php';
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Autocomplete.
+ */
+require __DIR__ . '/inc/autocomplete.php';
+
+/**
</ins><span class="cx" style="display: block; padding: 0 10px">  * Set the content width based on the theme's design and stylesheet.
</span><span class="cx" style="display: block; padding: 0 10px">  */
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! isset( $content_width ) ) {
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgdeveloperincautocompletephp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/autocomplete.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/autocomplete.php                          (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/autocomplete.php    2016-01-22 20:36:44 UTC (rev 2359)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,110 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+/**
+ * Code Reference autocomplete for the search form.
+ *
+ * @package wporg-developer
+ */
+
+/**
+ * Class to handle autocomplete for the search form.
+ */
+class DevHub_Search_Form_Autocomplete {
+
+
+       public function __construct() {
+               $this->init();
+       }
+
+       /**
+        * Initialization
+        *
+        * @access public
+        */
+       public function init() {
+
+               add_action( 'wp_ajax_autocomplete',  array( $this, 'autocomplete_data_update' ) );
+               add_action( "wp_ajax_nopriv_autocomplete",  array( $this, 'autocomplete_data_update' ) );
+
+               // Enqueue scripts and styles.
+               add_action( 'wp_enqueue_scripts', array( $this, 'scripts_and_styles' ), 11 );
+       }
+
+
+       /**
+        * Enqueues scripts and styles.
+        *
+        * @access public
+        */
+       public function scripts_and_styles() {
+
+               wp_enqueue_style( 'awesomplete-css', get_template_directory_uri() . '/stylesheets/awesomplete.css', array(), '20160114' );
+               wp_enqueue_style( 'autocomplete-css', get_template_directory_uri() . '/stylesheets/autocomplete.css', array(), '20160114' );
+
+               wp_register_script( 'awesomplete', get_template_directory_uri() . '/js/awesomplete.min.js', array(), '20160114', true );
+               wp_enqueue_script( 'awesomplete' );
+
+               wp_register_script( 'autocomplete', get_template_directory_uri() . '/js/autocomplete.js', array( 'awesomplete' ), '20160114', true );
+               wp_localize_script( 'autocomplete', 'autocomplete', array(
+                               'ajaxurl' => admin_url( 'admin-ajax.php' ),
+                               'nonce'   => wp_create_nonce( 'autocomplete_nonce' ),
+                       )
+               );
+
+               wp_enqueue_script( 'autocomplete' );
+       }
+
+
+       /**
+        * Handles AJAX updates for the autocomplete list.
+        *
+        * @access public
+        *
+        * @return string JSON data
+        */
+       public function autocomplete_data_update() {
+
+               check_ajax_referer( 'autocomplete_nonce', 'nonce' );
+
+               if ( !( isset( $_POST['data'] ) && $_POST['data'] ) ) {
+                       wp_send_json_error();
+               }
+
+               // Parse the search form fields.
+               wp_parse_str( $_POST['data'], $form_data );
+
+               if ( !isset( $form_data['post_type'] ) || !isset( $form_data['s'] ) ) {
+                       wp_send_json_error();
+               }
+
+               $post_types        = array();
+               $parser_post_types = DevHub\get_parsed_post_types();
+
+               foreach ( $form_data['post_type'] as $post_type ) {
+                       if ( in_array( $post_type , $parser_post_types ) ) {
+                               $post_types[] = $post_type;
+                       }
+               }
+
+               $args = array(
+                       'posts_per_page'       => -1,
+                       'post_type'            => $post_types,
+                       's'                    => $form_data['s'],
+                       'orderby'              => '',
+                       'search_orderby_title' => 1,
+                       'order'                => 'ASC',
+               );
+
+               $search = get_posts( $args );
+
+               $form_data['posts'] = array();
+               if ( !empty( $search ) ) {
+                       $form_data['posts'] = wp_list_pluck( $search, 'post_title' );
+               }
+
+               wp_send_json_success ( $form_data );
+       }
+
+
+}
+
+$autocomplete = new DevHub_Search_Form_Autocomplete();
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/autocomplete.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgdeveloperjsautocompletejs"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/js/autocomplete.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/js/autocomplete.js                            (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/js/autocomplete.js      2016-01-22 20:36:44 UTC (rev 2359)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,114 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/**
+ * Autocomplete JS.
+ *
+ * Uses the Awesomplete widget from Lea Verou.
+ * https://leaverou.github.io/awesomplete/
+ */
+
+( function( $ ) {
+
+       if ( typeof autocomplete === 'undefined' ) {
+               return;
+       }
+
+       var form = $( '.searchform' ),
+               searchfield = $( '#search-field', form ),
+               processing = false,
+               search = '';
+
+       var awesome = new Awesomplete( searchfield.get( 0 ), {
+               maxItems: 9999,
+               filter: function( text, input ) {
+                       // Filter autocomplete matches
+
+                       // Full match
+                       if ( Awesomplete.FILTER_CONTAINS( text, input ) ) {
+                               // mark
+                               return true;
+                       }
+
+                       // Replace - _ and whitespace with a single space
+                       var _text = Awesomplete.$.regExpEscape( text.trim().toLowerCase().replace( /[\_\-\s]+/g, ' ' ) );
+                       var _input = Awesomplete.$.regExpEscape( input.trim().toLowerCase().replace( /[\_\-\s]+/g, ' ' ) );
+
+                       // Matches with with single spaces between words
+                       if ( Awesomplete.FILTER_CONTAINS( _text, _input ) ) {
+                               return true;
+                       }
+
+                       _input = _input.split( " " );
+                       var words = _input.length;
+
+                       if ( 1 >= words ) {
+                               return false;
+                       }
+
+                       // Partial matches
+                       var partials = 0;
+                       for ( i = 0; i < words; i++ ) {
+                               if ( _text.indexOf( _input[ i ].trim() ) !== -1 ) {
+                                       partials++;
+                               }
+                       }
+
+                       if ( partials === words ) {
+                               return true;
+                       }
+
+                       return false;
+               }
+       } );
+
+       // On input event for the search field.
+       searchfield.on( 'input.autocomplete', function( e ) {
+
+               // Update the autocomlete list: 
+               //     if there are more than 2 characters
+               //     and it's not already processing an Ajax request
+               if ( !processing && $( this ).val().length > 2 ) {
+                       search = $( this ).val();
+                       autocomplete_update();
+               }
+       } );
+
+
+       /**
+        * Updates the autocomplete list
+        */
+       function autocomplete_update() {
+
+               processing = true;
+
+               var data = {
+                       action: "autocomplete",
+                       data: form.serialize(),
+                       nonce: autocomplete.nonce,
+               };
+
+               $.post( autocomplete.ajaxurl, data )
+                       .done( function( response ) {
+
+                               if ( typeof response.success === 'undefined' ) {
+                                       return false;
+                               }
+
+                               if ( typeof response.data.posts === 'undefined' ) {
+                                       return false;
+                               }
+
+                               if ( ( response.success === true ) && response.data.posts.length ) {
+                                       // Update the autocomplete list
+                                       awesome.list = response.data.posts;
+                               }
+                       } )
+                       .always( function() {
+                               processing = false;
+
+                               // Check if the search was updated during processing
+                               if ( search !== searchfield.val() ) {
+                                       searchfield.trigger( "input.autocomplete" );
+                               }
+                       } );
+       }
+
+} )( jQuery );
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgdeveloperjsawesompletejs"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/js/awesomplete.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/js/awesomplete.js                             (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/js/awesomplete.js       2016-01-22 20:36:44 UTC (rev 2359)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,394 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/**
+ * Simple, lightweight, usable local autocomplete library for modern browsers
+ * Because there weren’t enough autocomplete scripts in the world? Because I’m completely insane and have NIH syndrome? Probably both. :P
+ * @author Lea Verou http://leaverou.github.io/awesomplete
+ * MIT license
+ */
+
+(function () {
+
+var _ = function (input, o) {
+       var me = this;
+
+       // Setup
+
+       this.input = $(input);
+       this.input.setAttribute("autocomplete", "off");
+       this.input.setAttribute("aria-autocomplete", "list");
+
+       o = o || {};
+
+       configure.call(this, {
+               minChars: 2,
+               maxItems: 10,
+               autoFirst: false,
+               filter: _.FILTER_CONTAINS,
+               sort: _.SORT_BYLENGTH,
+               item: function (text, input) {
+                       var html = input === '' ? text : text.replace(RegExp($.regExpEscape(input.trim()), "gi"), "<mark>$&</mark>");
+                       return $.create("li", {
+                               innerHTML: html,
+                               "aria-selected": "false"
+                       });
+               },
+               replace: function (text) {
+                       this.input.value = text;
+               }
+       }, o);
+
+       this.index = -1;
+
+       // Create necessary elements
+
+       this.container = $.create("div", {
+               className: "awesomplete",
+               around: input
+       });
+
+       this.ul = $.create("ul", {
+               hidden: "hidden",
+               inside: this.container
+       });
+
+       this.status = $.create("span", {
+               className: "visually-hidden",
+               role: "status",
+               "aria-live": "assertive",
+               "aria-relevant": "additions",
+               inside: this.container
+       });
+
+       // Bind events
+
+       $.bind(this.input, {
+               "input": this.evaluate.bind(this),
+               "blur": this.close.bind(this),
+               "keydown": function(evt) {
+                       var c = evt.keyCode;
+
+                       // If the dropdown `ul` is in view, then act on keydown for the following keys:
+                       // Enter / Esc / Up / Down
+                       if(me.opened) {
+                               if (c === 13 && me.selected) { // Enter
+                                       evt.preventDefault();
+                                       me.select();
+                               }
+                               else if (c === 27) { // Esc
+                                       me.close();
+                               }
+                               else if (c === 38 || c === 40) { // Down/Up arrow
+                                       evt.preventDefault();
+                                       me[c === 38? "previous" : "next"]();
+                               }
+                       }
+               }
+       });
+
+       $.bind(this.input.form, {"submit": this.close.bind(this)});
+
+       $.bind(this.ul, {"mousedown": function(evt) {
+               var li = evt.target;
+
+               if (li !== this) {
+
+                       while (li && !/li/i.test(li.nodeName)) {
+                               li = li.parentNode;
+                       }
+
+                       if (li && evt.button === 0) {  // Only select on left click
+                               evt.preventDefault();
+                               me.select(li, evt);
+                       }
+               }
+       }});
+
+       if (this.input.hasAttribute("list")) {
+               this.list = "#" + this.input.getAttribute("list");
+               this.input.removeAttribute("list");
+       }
+       else {
+               this.list = this.input.getAttribute("data-list") || o.list || [];
+       }
+
+       _.all.push(this);
+};
+
+_.prototype = {
+       set list(list) {
+               if (Array.isArray(list)) {
+                       this._list = list;
+               }
+               else if (typeof list === "string" && list.indexOf(",") > -1) {
+                               this._list = list.split(/\s*,\s*/);
+               }
+               else { // Element or CSS selector
+                       list = $(list);
+
+                       if (list && list.children) {
+                               this._list = slice.apply(list.children).map(function (el) {
+                                       return el.textContent.trim();
+                               });
+                       }
+               }
+
+               if (document.activeElement === this.input) {
+                       this.evaluate();
+               }
+       },
+
+       get selected() {
+               return this.index > -1;
+       },
+
+       get opened() {
+               return this.ul && this.ul.getAttribute("hidden") == null;
+       },
+
+       close: function () {
+               this.ul.setAttribute("hidden", "");
+               this.index = -1;
+
+               $.fire(this.input, "awesomplete-close");
+       },
+
+       open: function () {
+               this.ul.removeAttribute("hidden");
+
+               if (this.autoFirst && this.index === -1) {
+                       this.goto(0);
+               }
+
+               $.fire(this.input, "awesomplete-open");
+       },
+
+       next: function () {
+               var count = this.ul.children.length;
+
+               this.goto(this.index < count - 1? this.index + 1 : -1);
+       },
+
+       previous: function () {
+               var count = this.ul.children.length;
+
+               this.goto(this.selected? this.index - 1 : count - 1);
+       },
+
+       // Should not be used, highlights specific item without any checks!
+       goto: function (i) {
+               var lis = this.ul.children;
+
+               if (this.selected) {
+                       lis[this.index].setAttribute("aria-selected", "false");
+               }
+
+               this.index = i;
+
+               if (i > -1 && lis.length > 0) {
+                       lis[i].setAttribute("aria-selected", "true");
+                       this.status.textContent = lis[i].textContent;
+               }
+
+               $.fire(this.input, "awesomplete-highlight");
+       },
+
+       select: function (selected, originalEvent) {
+               selected = selected || this.ul.children[this.index];
+
+               if (selected) {
+                       var prevented;
+
+                       $.fire(this.input, "awesomplete-select", {
+                               text: selected.textContent,
+                               preventDefault: function () {
+                                       prevented = true;
+                               },
+                               originalEvent: originalEvent
+                       });
+
+                       if (!prevented) {
+                               this.replace(selected.textContent);
+                               this.close();
+                               $.fire(this.input, "awesomplete-selectcomplete");
+                       }
+               }
+       },
+
+       evaluate: function() {
+               var me = this;
+               var value = this.input.value;
+
+               if (value.length >= this.minChars && this._list.length > 0) {
+                       this.index = -1;
+                       // Populate list with options that match
+                       this.ul.innerHTML = "";
+
+                       this._list
+                               .filter(function(item) {
+                                       return me.filter(item, value);
+                               })
+                               .sort(this.sort)
+                               .every(function(text, i) {
+                                       me.ul.appendChild(me.item(text, value));
+
+                                       return i < me.maxItems - 1;
+                               });
+
+                       if (this.ul.children.length === 0) {
+                               this.close();
+                       } else {
+                               this.open();
+                       }
+               }
+               else {
+                       this.close();
+               }
+       }
+};
+
+// Static methods/properties
+
+_.all = [];
+
+_.FILTER_CONTAINS = function (text, input) {
+       return RegExp($.regExpEscape(input.trim()), "i").test(text);
+};
+
+_.FILTER_STARTSWITH = function (text, input) {
+       return RegExp("^" + $.regExpEscape(input.trim()), "i").test(text);
+};
+
+_.SORT_BYLENGTH = function (a, b) {
+       if (a.length !== b.length) {
+               return a.length - b.length;
+       }
+
+       return a < b? -1 : 1;
+};
+
+// Private functions
+
+function configure(properties, o) {
+       for (var i in properties) {
+               var initial = properties[i],
+                   attrValue = this.input.getAttribute("data-" + i.toLowerCase());
+
+               if (typeof initial === "number") {
+                       this[i] = parseInt(attrValue);
+               }
+               else if (initial === false) { // Boolean options must be false by default anyway
+                       this[i] = attrValue !== null;
+               }
+               else if (initial instanceof Function) {
+                       this[i] = null;
+               }
+               else {
+                       this[i] = attrValue;
+               }
+
+               if (!this[i] && this[i] !== 0) {
+                       this[i] = (i in o)? o[i] : initial;
+               }
+       }
+}
+
+// Helpers
+
+var slice = Array.prototype.slice;
+
+function $(expr, con) {
+       return typeof expr === "string"? (con || document).querySelector(expr) : expr || null;
+}
+
+function $$(expr, con) {
+       return slice.call((con || document).querySelectorAll(expr));
+}
+
+$.create = function(tag, o) {
+       var element = document.createElement(tag);
+
+       for (var i in o) {
+               var val = o[i];
+
+               if (i === "inside") {
+                       $(val).appendChild(element);
+               }
+               else if (i === "around") {
+                       var ref = $(val);
+                       ref.parentNode.insertBefore(element, ref);
+                       element.appendChild(ref);
+               }
+               else if (i in element) {
+                       element[i] = val;
+               }
+               else {
+                       element.setAttribute(i, val);
+               }
+       }
+
+       return element;
+};
+
+$.bind = function(element, o) {
+       if (element) {
+               for (var event in o) {
+                       var callback = o[event];
+
+                       event.split(/\s+/).forEach(function (event) {
+                               element.addEventListener(event, callback);
+                       });
+               }
+       }
+};
+
+$.fire = function(target, type, properties) {
+       var evt = document.createEvent("HTMLEvents");
+
+       evt.initEvent(type, true, true );
+
+       for (var j in properties) {
+               evt[j] = properties[j];
+       }
+
+       target.dispatchEvent(evt);
+};
+
+$.regExpEscape = function (s) {
+       return s.replace(/[-\\^$*+?.()|[\]{}]/g, "\\$&");
+}
+
+// Initialization
+
+function init() {
+       $$("input.awesomplete").forEach(function (input) {
+               new _(input);
+       });
+}
+
+// Are we in a browser? Check for Document constructor
+if (typeof Document !== "undefined") {
+       // DOM already loaded?
+       if (document.readyState !== "loading") {
+               init();
+       }
+       else {
+               // Wait for it
+               document.addEventListener("DOMContentLoaded", init);
+       }
+}
+
+_.$ = $;
+_.$$ = $$;
+
+// Make sure to export Awesomplete on self when in a browser
+if (typeof self !== "undefined") {
+       self.Awesomplete = _;
+}
+
+// Expose Awesomplete as a CJS module
+if (typeof module === "object" && module.exports) {
+       module.exports = _;
+}
+
+return _;
+
+}());
</ins></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgdeveloperjsawesompleteminjs"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/js/awesomplete.min.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/js/awesomplete.min.js                         (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/js/awesomplete.min.js   2016-01-22 20:36:44 UTC (rev 2359)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,10 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// Awesomplete - Lea Verou - MIT license
+(function(){function m(a,b){for(var c in a){var g=a[c],e=this.input.getAttribute("data-"+c.toLowerCase());this[c]="number"===typeof g?parseInt(e):!1===g?null!==e:g instanceof Function?null:e;this[c]||0===this[c]||(this[c]=c in b?b[c]:g)}}function d(a,b){return"string"===typeof a?(b||document).querySelector(a):a||null}function h(a,b){return k.call((b||document).querySelectorAll(a))}function l(){h("input.awesomplete").forEach(function(a){new f(a)})}var f=function(a,b){var c=this;this.input=d(a);this.input.setAttribute("autocomplete",
+"off");this.input.setAttribute("aria-autocomplete","list");b=b||{};m.call(this,{minChars:2,maxItems:10,autoFirst:!1,filter:f.FILTER_CONTAINS,sort:f.SORT_BYLENGTH,item:function(a,b){var c=""===b?a:a.replace(RegExp(d.regExpEscape(b.trim()),"gi"),"<mark>$&</mark>");return d.create("li",{innerHTML:c,"aria-selected":"false"})},replace:function(a){this.input.value=a}},b);this.index=-1;this.container=d.create("div",{className:"awesomplete",around:a});this.ul=d.create("ul",{hidden:"hidden",inside:this.container});
+this.status=d.create("span",{className:"visually-hidden",role:"status","aria-live":"assertive","aria-relevant":"additions",inside:this.container});d.bind(this.input,{input:this.evaluate.bind(this),blur:this.close.bind(this),keydown:function(a){var b=a.keyCode;if(c.opened)if(13===b&&c.selected)a.preventDefault(),c.select();else if(27===b)c.close();else if(38===b||40===b)a.preventDefault(),c[38===b?"previous":"next"]()}});d.bind(this.input.form,{submit:this.close.bind(this)});d.bind(this.ul,{mousedown:function(a){var b=
+a.target;if(b!==this){for(;b&&!/li/i.test(b.nodeName);)b=b.parentNode;b&&0===a.button&&c.select(b,a)}}});this.input.hasAttribute("list")?(this.list="#"+this.input.getAttribute("list"),this.input.removeAttribute("list")):this.list=this.input.getAttribute("data-list")||b.list||[];f.all.push(this)};f.prototype={set list(a){Array.isArray(a)?this._list=a:"string"===typeof a&&-1<a.indexOf(",")?this._list=a.split(/\s*,\s*/):(a=d(a))&&a.children&&(this._list=k.apply(a.children).map(function(a){return a.textContent.trim()}));
+document.activeElement===this.input&&this.evaluate()},get selected(){return-1<this.index},get opened(){return this.ul&&null==this.ul.getAttribute("hidden")},close:function(){this.ul.setAttribute("hidden","");this.index=-1;d.fire(this.input,"awesomplete-close")},open:function(){this.ul.removeAttribute("hidden");this.autoFirst&&-1===this.index&&this["goto"](0);d.fire(this.input,"awesomplete-open")},next:function(){this["goto"](this.index<this.ul.children.length-1?this.index+1:-1)},previous:function(){var a=
+this.ul.children.length;this["goto"](this.selected?this.index-1:a-1)},"goto":function(a){var b=this.ul.children;this.selected&&b[this.index].setAttribute("aria-selected","false");this.index=a;-1<a&&0<b.length&&(b[a].setAttribute("aria-selected","true"),this.status.textContent=b[a].textContent);d.fire(this.input,"awesomplete-highlight")},select:function(a,b){if(a=a||this.ul.children[this.index]){var c;d.fire(this.input,"awesomplete-select",{text:a.textContent,preventDefault:function(){c=!0},originalEvent:b});
+c||(this.replace(a.textContent),this.close(),d.fire(this.input,"awesomplete-selectcomplete"))}},evaluate:function(){var a=this,b=this.input.value;b.length>=this.minChars&&0<this._list.length?(this.index=-1,this.ul.innerHTML="",this._list.filter(function(c){return a.filter(c,b)}).sort(this.sort).every(function(c,d){a.ul.appendChild(a.item(c,b));return d<a.maxItems-1}),0===this.ul.children.length?this.close():this.open()):this.close()}};f.all=[];f.FILTER_CONTAINS=function(a,b){return RegExp(d.regExpEscape(b.trim()),
+"i").test(a)};f.FILTER_STARTSWITH=function(a,b){return RegExp("^"+d.regExpEscape(b.trim()),"i").test(a)};f.SORT_BYLENGTH=function(a,b){return a.length!==b.length?a.length-b.length:a<b?-1:1};var k=Array.prototype.slice;d.create=function(a,b){var c=document.createElement(a),g;for(g in b){var e=b[g];"inside"===g?d(e).appendChild(c):"around"===g?(e=d(e),e.parentNode.insertBefore(c,e),c.appendChild(e)):g in c?c[g]=e:c.setAttribute(g,e)}return c};d.bind=function(a,b){if(a)for(var c in b){var d=b[c];c.split(/\s+/).forEach(function(b){a.addEventListener(b,
+d)})}};d.fire=function(a,b,c){var d=document.createEvent("HTMLEvents");d.initEvent(b,!0,!0);for(var e in c)d[e]=c[e];a.dispatchEvent(d)};d.regExpEscape=function(a){return a.replace(/[-\\^$*+?.()|[\]{}]/g,"\\$&")};"undefined"!==typeof Document&&("loading"!==document.readyState?l():document.addEventListener("DOMContentLoaded",l));f.$=d;f.$$=h;"undefined"!==typeof self&&(self.Awesomplete=f);"object"===typeof module&&module.exports&&(module.exports=f);return f})();
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgdeveloperstylesheetsautocompletecss"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/stylesheets/autocomplete.css</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/stylesheets/autocomplete.css                          (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/stylesheets/autocomplete.css    2016-01-22 20:36:44 UTC (rev 2359)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,53 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/**
+ * Autocomplete Css
+ *
+ * Mainly overrides for awesomplete.css
+ */
+div.awesomplete > ul > li:hover {
+       background: hsl(200, 40%, 90%);
+}
+
+div.awesomplete > ul > li[aria-selected="true"] {
+       background: hsl(200, 40%, 80%);
+       color: #404040;
+}
+
+div.awesomplete mark {
+       color: #404040;
+}
+
+div.awesomplete li:hover mark, div.awesomplete li[aria-selected="true"] mark {
+       background: hsl(65, 100%, 49%);
+}
+
+.devhub-wrap div.awesomplete > ul {
+       max-height: 13.5em;
+       color: #404040;
+       margin-top: -.9em;
+       overflow: auto;
+       background: linear-gradient(to bottom right, white, hsla(0,0%,100%,.9));
+}
+
+.devhub-wrap .searchform label div.awesomplete > input,
+.devhub-wrap div.awesomplete { 
+       width: 100%;
+}
+
+.devhub-wrap .searchform div.search-post-type {
+       clear: both;
+}
+
+.devhub-wrap .searchform,
+.devhub-wrap .searchform div:first-child,
+.devhub-wrap div.awesomplete {
+       /* Needs to be visible for the awesomplete popup */
+       overflow: visible;
+}
+
+div.awesomplete > ul > li:hover {
+       color: black;
+}
+
+div.awesomplete > ul:before {
+       content: none;
+}
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/stylesheets/autocomplete.css
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgdeveloperstylesheetsawesompletecss"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/stylesheets/awesomplete.css</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/stylesheets/awesomplete.css                           (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/stylesheets/awesomplete.css     2016-01-22 20:36:44 UTC (rev 2359)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,97 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+[hidden] { display: none; }
+
+.visually-hidden {
+       position: absolute;
+       clip: rect(0, 0, 0, 0);
+}
+
+div.awesomplete {
+       display: inline-block;
+       position: relative;
+}
+
+div.awesomplete > input {
+       display: block;
+}
+
+div.awesomplete > ul {
+       position: absolute;
+       left: 0;
+       z-index: 1;
+       min-width: 100%;
+       box-sizing: border-box;
+       list-style: none;
+       padding: 0;
+       border-radius: .3em;
+       margin: .2em 0 0;
+       background: hsla(0,0%,100%,.9);
+       background: linear-gradient(to bottom right, white, hsla(0,0%,100%,.8));
+       border: 1px solid rgba(0,0,0,.3);
+       box-shadow: .05em .2em .6em rgba(0,0,0,.2);
+       text-shadow: none;
+}
+
+div.awesomplete > ul[hidden],
+div.awesomplete > ul:empty {
+       display: none;
+}
+
+@supports (transform: scale(0)) {
+       div.awesomplete > ul {
+               transition: .3s cubic-bezier(.4,.2,.5,1.4);
+               transform-origin: 1.43em -.43em;
+       }
+       
+       div.awesomplete > ul[hidden],
+       div.awesomplete > ul:empty {
+               opacity: 0;
+               transform: scale(0);
+               display: block;
+               transition-timing-function: ease;
+       }
+}
+
+       /* Pointer */
+       div.awesomplete > ul:before {
+               content: "";
+               position: absolute;
+               top: -.43em;
+               left: 1em;
+               width: 0; height: 0;
+               padding: .4em;
+               background: white;
+               border: inherit;
+               border-right: 0;
+               border-bottom: 0;
+               -webkit-transform: rotate(45deg);
+               transform: rotate(45deg);
+       }
+
+       div.awesomplete > ul > li {
+               position: relative;
+               padding: .2em .5em;
+               cursor: pointer;
+       }
+       
+       div.awesomplete > ul > li:hover {
+               background: hsl(200, 40%, 80%);
+               color: black;
+       }
+       
+       div.awesomplete > ul > li[aria-selected="true"] {
+               background: hsl(205, 40%, 40%);
+               color: white;
+       }
+       
+               div.awesomplete mark {
+                       background: hsl(65, 100%, 50%);
+               }
+               
+               div.awesomplete li:hover mark {
+                       background: hsl(68, 100%, 41%);
+               }
+               
+               div.awesomplete li[aria-selected="true"] mark {
+                       background: hsl(86, 100%, 21%);
+                       color: inherit;
+               }
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/stylesheets/awesomplete.css
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span></div>

</body>
</html>