eagle-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h..@apache.org
Subject svn commit: r1789961 [1/5] - in /eagle/site/docs: ./ latest/ latest/include/images/ latest/mkdocs/ latest/mkdocs/js/ v0.5.0/ v0.5.0/include/images/ v0.5.0/mkdocs/ v0.5.0/mkdocs/js/
Date Mon, 03 Apr 2017 11:29:31 GMT
Author: hao
Date: Mon Apr  3 11:29:31 2017
New Revision: 1789961

URL: http://svn.apache.org/viewvc?rev=1789961&view=rev
Log:
Add docs for latest and v0.5.0

Added:
    eagle/site/docs/latest/include/images/site_list.png   (with props)
    eagle/site/docs/latest/mkdocs/js/search.js   (with props)
    eagle/site/docs/latest/mkdocs/search_index.json   (with props)
    eagle/site/docs/latest/search.html   (with props)
    eagle/site/docs/latest/searchbox.html   (with props)
    eagle/site/docs/latest/sitemap.xml   (with props)
    eagle/site/docs/security.html   (with props)
    eagle/site/docs/v0.5.0/include/images/site_list.png   (with props)
    eagle/site/docs/v0.5.0/mkdocs/js/search.js   (with props)
    eagle/site/docs/v0.5.0/mkdocs/search_index.json   (with props)
    eagle/site/docs/v0.5.0/search.html   (with props)
    eagle/site/docs/v0.5.0/searchbox.html   (with props)

Added: eagle/site/docs/latest/include/images/site_list.png
URL: http://svn.apache.org/viewvc/eagle/site/docs/latest/include/images/site_list.png?rev=1789961&view=auto
==============================================================================
Binary file - no diff available.

Propchange: eagle/site/docs/latest/include/images/site_list.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: eagle/site/docs/latest/mkdocs/js/search.js
URL: http://svn.apache.org/viewvc/eagle/site/docs/latest/mkdocs/js/search.js?rev=1789961&view=auto
==============================================================================
--- eagle/site/docs/latest/mkdocs/js/search.js (added)
+++ eagle/site/docs/latest/mkdocs/js/search.js Mon Apr  3 11:29:31 2017
@@ -0,0 +1,88 @@
+require([
+    base_url + '/mkdocs/js/mustache.min.js',
+    base_url + '/mkdocs/js/lunr-0.5.7.min.js',
+    'text!search-results-template.mustache',
+    'text!../search_index.json',
+], function (Mustache, lunr, results_template, data) {
+   "use strict";
+
+    function getSearchTerm()
+    {
+        var sPageURL = window.location.search.substring(1);
+        var sURLVariables = sPageURL.split('&');
+        for (var i = 0; i < sURLVariables.length; i++)
+        {
+            var sParameterName = sURLVariables[i].split('=');
+            if (sParameterName[0] == 'q')
+            {
+                return decodeURIComponent(sParameterName[1].replace(/\+/g, '%20'));
+            }
+        }
+    }
+
+    var index = lunr(function () {
+        this.field('title', {boost: 10});
+        this.field('text');
+        this.ref('location');
+    });
+
+    data = JSON.parse(data);
+    var documents = {};
+
+    for (var i=0; i < data.docs.length; i++){
+        var doc = data.docs[i];
+        doc.location = base_url + doc.location;
+        index.add(doc);
+        documents[doc.location] = doc;
+    }
+
+    var search = function(){
+
+        var query = document.getElementById('mkdocs-search-query').value;
+        var search_results = document.getElementById("mkdocs-search-results");
+        while (search_results.firstChild) {
+            search_results.removeChild(search_results.firstChild);
+        }
+
+        if(query === ''){
+            return;
+        }
+
+        var results = index.search(query);
+
+        if (results.length > 0){
+            for (var i=0; i < results.length; i++){
+                var result = results[i];
+                doc = documents[result.ref];
+                doc.base_url = base_url;
+                doc.summary = doc.text.substring(0, 200);
+                var html = Mustache.to_html(results_template, doc);
+                search_results.insertAdjacentHTML('beforeend', html);
+            }
+        } else {
+            search_results.insertAdjacentHTML('beforeend', "<p>No results found</p>");
+        }
+
+        if(jQuery){
+            /*
+             * We currently only automatically hide bootstrap models. This
+             * requires jQuery to work.
+             */
+            jQuery('#mkdocs_search_modal a').click(function(){
+                jQuery('#mkdocs_search_modal').modal('hide');
+            })
+        }
+
+    };
+
+    var search_input = document.getElementById('mkdocs-search-query');
+
+    var term = getSearchTerm();
+    if (term){
+        search_input.value = term;
+        search();
+    }
+
+    search_input.addEventListener("keyup", search);
+
+});

Propchange: eagle/site/docs/latest/mkdocs/js/search.js
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message