Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 8A970200D26 for ; Thu, 14 Sep 2017 21:53:51 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 8A1B11609C6; Thu, 14 Sep 2017 19:53:51 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 7D8771609D2 for ; Thu, 14 Sep 2017 21:53:49 +0200 (CEST) Received: (qmail 13375 invoked by uid 500); 14 Sep 2017 19:53:48 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 12978 invoked by uid 99); 14 Sep 2017 19:53:48 -0000 Received: from Unknown (HELO svn01-us-west.apache.org) (209.188.14.144) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Sep 2017 19:53:48 +0000 Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id 211203A034F for ; Thu, 14 Sep 2017 19:53:46 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1018164 [4/8] - in /websites/production/activemq/content/artemis/docs/latest/hacking-guide: ./ gitbook/ gitbook/fonts/ gitbook/fonts/fontawesome/ gitbook/gitbook-plugin-fontsettings/ gitbook/gitbook-plugin-highlight/ gitbook/gitbook-plugin... Date: Thu, 14 Sep 2017 19:53:45 -0000 To: commits@activemq.apache.org From: clebertsuconic@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20170914195346.211203A034F@svn01-us-west.apache.org> archived-at: Thu, 14 Sep 2017 19:53:51 -0000 Added: websites/production/activemq/content/artemis/docs/latest/hacking-guide/gitbook/gitbook-plugin-search/search.css ============================================================================== --- websites/production/activemq/content/artemis/docs/latest/hacking-guide/gitbook/gitbook-plugin-search/search.css (added) +++ websites/production/activemq/content/artemis/docs/latest/hacking-guide/gitbook/gitbook-plugin-search/search.css Thu Sep 14 19:53:45 2017 @@ -0,0 +1,35 @@ +/* + This CSS only styled the search results section, not the search input + It defines the basic interraction to hide content when displaying results, etc +*/ +#book-search-results .search-results { + display: none; +} +#book-search-results .search-results ul.search-results-list { + list-style-type: none; + padding-left: 0; +} +#book-search-results .search-results ul.search-results-list li { + margin-bottom: 1.5rem; + padding-bottom: 0.5rem; + /* Highlight results */ +} +#book-search-results .search-results ul.search-results-list li p em { + background-color: rgba(255, 220, 0, 0.4); + font-style: normal; +} +#book-search-results .search-results .no-results { + display: none; +} +#book-search-results.open .search-results { + display: block; +} +#book-search-results.open .search-noresults { + display: none; +} +#book-search-results.no-results .search-results .has-results { + display: none; +} +#book-search-results.no-results .search-results .no-results { + display: block; +} Added: websites/production/activemq/content/artemis/docs/latest/hacking-guide/gitbook/gitbook-plugin-search/search.js ============================================================================== --- websites/production/activemq/content/artemis/docs/latest/hacking-guide/gitbook/gitbook-plugin-search/search.js (added) +++ websites/production/activemq/content/artemis/docs/latest/hacking-guide/gitbook/gitbook-plugin-search/search.js Thu Sep 14 19:53:45 2017 @@ -0,0 +1,213 @@ +require([ + 'gitbook', + 'jquery' +], function(gitbook, $) { + var MAX_RESULTS = 15; + var MAX_DESCRIPTION_SIZE = 500; + + var usePushState = (typeof history.pushState !== 'undefined'); + + // DOM Elements + var $body = $('body'); + var $bookSearchResults; + var $searchInput; + var $searchList; + var $searchTitle; + var $searchResultsCount; + var $searchQuery; + + // Throttle search + function throttle(fn, wait) { + var timeout; + + return function() { + var ctx = this, args = arguments; + if (!timeout) { + timeout = setTimeout(function() { + timeout = null; + fn.apply(ctx, args); + }, wait); + } + }; + } + + function displayResults(res) { + $bookSearchResults.addClass('open'); + + var noResults = res.count == 0; + $bookSearchResults.toggleClass('no-results', noResults); + + // Clear old results + $searchList.empty(); + + // Display title for research + $searchResultsCount.text(res.count); + $searchQuery.text(res.query); + + // Create an
  • element for each result + res.results.forEach(function(res) { + var $li = $('
  • ', { + 'class': 'search-results-item' + }); + + var $title = $('

    '); + + var $link = $('', { + 'href': gitbook.state.basePath + '/' + res.url, + 'text': res.title + }); + + var content = res.body.trim(); + if (content.length > MAX_DESCRIPTION_SIZE) { + content = content.slice(0, MAX_DESCRIPTION_SIZE).trim()+'...'; + } + var $content = $('

    ').html(content); + + $link.appendTo($title); + $title.appendTo($li); + $content.appendTo($li); + $li.appendTo($searchList); + }); + } + + function launchSearch(q) { + // Add class for loading + $body.addClass('with-search'); + $body.addClass('search-loading'); + + // Launch search query + throttle(gitbook.search.query(q, 0, MAX_RESULTS) + .then(function(results) { + displayResults(results); + }) + .always(function() { + $body.removeClass('search-loading'); + }), 1000); + } + + function closeSearch() { + $body.removeClass('with-search'); + $bookSearchResults.removeClass('open'); + } + + function launchSearchFromQueryString() { + var q = getParameterByName('q'); + if (q && q.length > 0) { + // Update search input + $searchInput.val(q); + + // Launch search + launchSearch(q); + } + } + + function bindSearch() { + // Bind DOM + $searchInput = $('#book-search-input input'); + $bookSearchResults = $('#book-search-results'); + $searchList = $bookSearchResults.find('.search-results-list'); + $searchTitle = $bookSearchResults.find('.search-results-title'); + $searchResultsCount = $searchTitle.find('.search-results-count'); + $searchQuery = $searchTitle.find('.search-query'); + + // Launch query based on input content + function handleUpdate() { + var q = $searchInput.val(); + + if (q.length == 0) { + closeSearch(); + } + else { + launchSearch(q); + } + } + + // Detect true content change in search input + // Workaround for IE < 9 + var propertyChangeUnbound = false; + $searchInput.on('propertychange', function(e) { + if (e.originalEvent.propertyName == 'value') { + handleUpdate(); + } + }); + + // HTML5 (IE9 & others) + $searchInput.on('input', function(e) { + // Unbind propertychange event for IE9+ + if (!propertyChangeUnbound) { + $(this).unbind('propertychange'); + propertyChangeUnbound = true; + } + + handleUpdate(); + }); + + // Push to history on blur + $searchInput.on('blur', function(e) { + // Update history state + if (usePushState) { + var uri = updateQueryString('q', $(this).val()); + history.pushState({ path: uri }, null, uri); + } + }); + } + + gitbook.events.on('page.change', function() { + bindSearch(); + closeSearch(); + + // Launch search based on query parameter + if (gitbook.search.isInitialized()) { + launchSearchFromQueryString(); + } + }); + + gitbook.events.on('search.ready', function() { + bindSearch(); + + // Launch search from query param at start + launchSearchFromQueryString(); + }); + + function getParameterByName(name) { + var url = window.location.href; + name = name.replace(/[\[\]]/g, '\\$&'); + var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)', 'i'), + results = regex.exec(url); + if (!results) return null; + if (!results[2]) return ''; + return decodeURIComponent(results[2].replace(/\+/g, ' ')); + } + + function updateQueryString(key, value) { + value = encodeURIComponent(value); + + var url = window.location.href; + var re = new RegExp('([?&])' + key + '=.*?(&|#|$)(.*)', 'gi'), + hash; + + if (re.test(url)) { + if (typeof value !== 'undefined' && value !== null) + return url.replace(re, '$1' + key + '=' + value + '$2$3'); + else { + hash = url.split('#'); + url = hash[0].replace(re, '$1$3').replace(/(&|\?)$/, ''); + if (typeof hash[1] !== 'undefined' && hash[1] !== null) + url += '#' + hash[1]; + return url; + } + } + else { + if (typeof value !== 'undefined' && value !== null) { + var separator = url.indexOf('?') !== -1 ? '&' : '?'; + hash = url.split('#'); + url = hash[0] + separator + key + '=' + value; + if (typeof hash[1] !== 'undefined' && hash[1] !== null) + url += '#' + hash[1]; + return url; + } + else + return url; + } + } +}); Added: websites/production/activemq/content/artemis/docs/latest/hacking-guide/gitbook/gitbook-plugin-sharing/buttons.js ============================================================================== --- websites/production/activemq/content/artemis/docs/latest/hacking-guide/gitbook/gitbook-plugin-sharing/buttons.js (added) +++ websites/production/activemq/content/artemis/docs/latest/hacking-guide/gitbook/gitbook-plugin-sharing/buttons.js Thu Sep 14 19:53:45 2017 @@ -0,0 +1,90 @@ +require(['gitbook', 'jquery'], function(gitbook, $) { + var SITES = { + 'facebook': { + 'label': 'Facebook', + 'icon': 'fa fa-facebook', + 'onClick': function(e) { + e.preventDefault(); + window.open('http://www.facebook.com/sharer/sharer.php?s=100&p[url]='+encodeURIComponent(location.href)); + } + }, + 'twitter': { + 'label': 'Twitter', + 'icon': 'fa fa-twitter', + 'onClick': function(e) { + e.preventDefault(); + window.open('http://twitter.com/home?status='+encodeURIComponent(document.title+' '+location.href)); + } + }, + 'google': { + 'label': 'Google+', + 'icon': 'fa fa-google-plus', + 'onClick': function(e) { + e.preventDefault(); + window.open('https://plus.google.com/share?url='+encodeURIComponent(location.href)); + } + }, + 'weibo': { + 'label': 'Weibo', + 'icon': 'fa fa-weibo', + 'onClick': function(e) { + e.preventDefault(); + window.open('http://service.weibo.com/share/share.php?content=utf-8&url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)); + } + }, + 'instapaper': { + 'label': 'Instapaper', + 'icon': 'fa fa-instapaper', + 'onClick': function(e) { + e.preventDefault(); + window.open('http://www.instapaper.com/text?u='+encodeURIComponent(location.href)); + } + }, + 'vk': { + 'label': 'VK', + 'icon': 'fa fa-vk', + 'onClick': function(e) { + e.preventDefault(); + window.open('http://vkontakte.ru/share.php?url='+encodeURIComponent(location.href)); + } + } + }; + + + + gitbook.events.bind('start', function(e, config) { + var opts = config.sharing; + + // Create dropdown menu + var menu = $.map(opts.all, function(id) { + var site = SITES[id]; + + return { + text: site.label, + onClick: site.onClick + }; + }); + + // Create main button with dropdown + if (menu.length > 0) { + gitbook.toolbar.createButton({ + icon: 'fa fa-share-alt', + label: 'Share', + position: 'right', + dropdown: [menu] + }); + } + + // Direct actions to share + $.each(SITES, function(sideId, site) { + if (!opts[sideId]) return; + + gitbook.toolbar.createButton({ + icon: site.icon, + label: site.text, + position: 'right', + onClick: site.onClick + }); + }); + }); +}); Added: websites/production/activemq/content/artemis/docs/latest/hacking-guide/gitbook/gitbook.js ============================================================================== --- websites/production/activemq/content/artemis/docs/latest/hacking-guide/gitbook/gitbook.js (added) +++ websites/production/activemq/content/artemis/docs/latest/hacking-guide/gitbook/gitbook.js Thu Sep 14 19:53:45 2017 @@ -0,0 +1,4 @@ +!function e(t,n,r){function o(s,a){if(!n[s]){if(!t[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(i)return i(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[s]={exports:{}};t[s][0].call(c.exports,function(e){var n=t[s][1][e];return o(n?n:e)},c,c.exports,e,t,n,r)}return n[s].exports}for(var i="function"==typeof require&&require,s=0;s0&&t-1 in e}function r(e,t,n){if(Z.isFunction(t))return Z.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return Z.gr ep(e,function(e){return e===t!==n});if("string"==typeof t){if(ae.test(t))return Z.filter(t,e,n);t=Z.filter(t,e)}return Z.grep(e,function(e){return X.call(t,e)>=0!==n})}function o(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}function i(e){var t=de[e]={};return Z.each(e.match(he)||[],function(e,n){t[n]=!0}),t}function s(){Q.removeEventListener("DOMContentLoaded",s,!1),e.removeEventListener("load",s,!1),Z.ready()}function a(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=Z.expando+a.uid++}function u(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(be,"-$1").toLowerCase(),n=e.getAttribute(r),"string"==typeof n){try{n="true"===n?!0:"false"===n?!1:"null"===n?null:+n+""===n?+n:xe.test(n)?Z.parseJSON(n):n}catch(o){}ye.set(e,t,n)}else n=void 0;return n}function l(){return!0}function c(){return!1}function f(){try{return Q.activeElement}catch(e){}}function p(e,t){return Z.nodeName(e,"table")&&Z.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.g etElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function h(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function d(e){var t=Re.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function g(e,t){for(var n=0,r=e.length;r>n;n++)ve.set(e[n],"globalEval",!t||ve.get(t[n],"globalEval"))}function m(e,t){var n,r,o,i,s,a,u,l;if(1===t.nodeType){if(ve.hasData(e)&&(i=ve.access(e),s=ve.set(t,i),l=i.events)){delete s.handle,s.events={};for(o in l)for(n=0,r=l[o].length;r>n;n++)Z.event.add(t,o,l[o][n])}ye.hasData(e)&&(a=ye.access(e),u=Z.extend({},a),ye.set(t,u))}}function v(e,t){var n=e.getElementsByTagName?e.getElementsByTagName(t||"*"):e.querySelectorAll?e.querySelectorAll(t||"*"):[];return void 0===t||t&&Z.nodeName(e,t)?Z.merge([e],n):n}function y(e,t){var n=t.nodeName.toLowerCase();"input"===n&&je.test(e.type)?t.checked=e.checked:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}function x(t,n){var r,o=Z(n.createEl ement(t)).appendTo(n.body),i=e.getDefaultComputedStyle&&(r=e.getDefaultComputedStyle(o[0]))?r.display:Z.css(o[0],"display");return o.detach(),i}function b(e){var t=Q,n=$e[e];return n||(n=x(e,t),"none"!==n&&n||(Me=(Me||Z("