pidgin/nest

Merged in default (pull request #13)

2019-04-17, Gary Kramlich
28a6b9b7329e
Merged in default (pull request #13)

Design updates

Approved-by: Gary Kramlich
--- a/hugo/config.toml Wed Apr 17 01:11:11 2019 +0000
+++ b/hugo/config.toml Wed Apr 17 02:22:11 2019 +0000
@@ -29,3 +29,8 @@
name = "<i class='fab fa-fw fa-discord'></i> Discord"
identifier = "discord"
url = "https://discord.gg/pB9fbVC"
+
+[[menu.shortcuts]]
+ name = "<i class='fab fa-reddit-alien'></i> Reddit"
+ identifier = "reddit"
+ url = "https://reddit.com/r/pidgin"
--- a/hugo/content/plugins/_index.md Wed Apr 17 01:11:11 2019 +0000
+++ b/hugo/content/plugins/_index.md Wed Apr 17 02:22:11 2019 +0000
@@ -4,4 +4,4 @@
anchor: "plugins"
---
-Pidgin has a lot of plugins...
+{{< plugintable >}}
--- a/hugo/content/plugins/trusted-plugins.md Wed Apr 17 01:11:11 2019 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
----
-title: "Trusted Plugins"
-date: 2019-01-10T22:32:00-06:00
-anchor: "trusted-plugins"
----
-
-This page contains a list of plugins from trusted authors. What's make's an
-author trusted you ask? Basically they've been working with us for a long time
-and they put out some great software!
-
-If you believe someone should be on this list, please open a pull request with
-the update or let grim know.
-
-{{< plugintable >}}
--- a/hugo/i18n/en.toml Wed Apr 17 01:11:11 2019 +0000
+++ b/hugo/i18n/en.toml Wed Apr 17 02:22:11 2019 +0000
@@ -30,3 +30,18 @@
[Repo]
other = "Repo"
+
+[Trusted]
+other = "Trusted"
+
+[Trusted-Info]
+other = "What makes an author trusted you ask? Basically they've been working with us for a long time and they put out some great software!"
+
+[Community]
+other = "Community"
+
+[Community-Info]
+other = "Created by the pidgin communtiy"
+
+[Plugin-Info]
+other = "This page contains a list of plugins from trusted authors and the community. If you believe a plugin should be on this list, please get in touch with us or open a pull request with the update."
--- a/hugo/layouts/shortcodes/plugintable.html Wed Apr 17 01:11:11 2019 +0000
+++ b/hugo/layouts/shortcodes/plugintable.html Wed Apr 17 02:22:11 2019 +0000
@@ -1,5 +1,48 @@
+{{/*** Templates ***/}}
+{{ define "trusted" }}
+ <span aria-label="{{ T "Trusted" }}" class="tooltipped tooltipped-s">
+ <i class="fas fa-check-circle " style="color:#784a85"></i>
+ </span>
+{{ end }}
+{{ define "community" }}
+ <span aria-label="{{ T "Community" }}" class="tooltipped tooltipped-s">
+ <i class="fas fa-users" style="color:green"></i>
+ </span>
+{{ end }}
+
+{{/*** Content ***/}}
+<p>
+ {{ T "Plugin-Info" }}
+</p>
+
+<ul>
+ <li>{{ template "trusted" }} {{ T "Trusted-Info" }}</li>
+ <li>{{ template "community" }} {{ T "Community-Info" }}</li>
+</ul>
+
<div id="plugin-filters">
+ <div id="publisher-selector">
+ <label style="display: inline-block;">
+ <input type="radio" id="all" name="publisher" style="margin-right: 0; margin-left: 0.75rem;" value="all" checked>
+ All
+ </label>
+
+ <label style="display: inline-block;">
+ <input type="radio" id="pidgin" name="publisher" style="margin-right: 0; margin-left: 0.75rem;" value="pidgin">
+ {{ template "trusted" }}
+ {{ T "Trusted" }}
+ </label>
+
+ <label style="display: inline-block;">
+ <input type="radio" id="community" name="publisher" style="margin-right: 0; margin-left: 0.75rem;"
+ value="community">
+ {{ template "community" }}
+ {{ T "Community" }}
+ </label>
+ </div>
+
<input type="text" id="plugin-filter-search" placeholder="{{ T "Search-placeholder" }}" />
+
<div id="protocol-selector"></div>
</div>
@@ -13,18 +56,28 @@
{{ T "Repo" }}
</th>
</thead>
+
<tbody>
{{ range .Site.Data.plugins }}
- <tr data-type="{{ .type }}">
+ <tr data-type="{{ .type }}" {{ if .isTrusted }}isTrusted="true"{{ end }}>
<td>
<img src="{{ .logo }}" />
</td>
+
<td class="pulgin-heading">
{{ .heading }}
</td>
+
<td class="pulgin-info">
+ {{ if .isTrusted }}
+ {{ template "trusted" }}
+ {{ else }}
+ {{ template "community" }}
+ {{ end }}
+
<b>{{ .type }}</b> {{ .info | markdownify }}
</td>
+
<td class="pulgin-repo">
<a href="{{ .repo }}">{{ .maintainer }}</a>
</td>
@@ -38,10 +91,8 @@
const selectorsContainer = document.getElementById("protocol-selector");
const search = document.getElementById("plugin-filter-search");
search.addEventListener("input", debounce(1000 * 0.5, filterRows));
- const [, ...rows] = (
- document.getElementById("protocol-table")
- .getElementsByTagName("tr")
- );
+ const [, ...rows] =
+ document.getElementById("protocol-table").getElementsByTagName("tr");
const types = {};
const typeFilter = new Set();
const rowinfo = rows.map(elem => {
@@ -57,9 +108,13 @@
head: getContents("pulgin-heading", elem),
info: getContents("pulgin-info", elem),
repo: getContents("pulgin-repo", elem),
+ isTrusted: elem.getAttribute('isTrusted') == 'true'
}
})
+ document.getElementById("publisher-selector")
+ .addEventListener('click', filterRows)
+
Object.keys(types).forEach(type => {
const label = createAndAppend("label", selectorsContainer);
label.classList.add('pidgin-plugin-filter-checkbox')
@@ -72,7 +127,7 @@
/////////////////////////
- function getContents(className, elem = document){
+ function getContents(className, elem){
return (
elem.getElementsByClassName(className)[0]
.textContent.toLowerCase()
@@ -84,21 +139,30 @@
filterRows();
}
+ const publisherRadioQuery = 'input[name="publisher"]:checked'
+
function filterRows() {
const str = (search.value || "").toLowerCase()
+ const publisherSelector = document.querySelector(publisherRadioQuery).value;
rowinfo.forEach((row) => {
- if (shouldFilter(row, str))
+ if (shouldFilter(row, publisherSelector, str))
row.elem.classList.remove("filter-hide");
else
row.elem.classList.add("filter-hide");
});
}
- function shouldFilter(row, str) {
+ function shouldFilter(row, publisher, str) {
return (
// Checkboxes
(!typeFilter.size || typeFilter.has(row.elem.dataset.type))
+ // Provider
+ && (
+ publisher == 'all'
+ || (publisher == 'pidgin' && row.isTrusted)
+ || (publisher == 'community' && !row.isTrusted)
+ )
// Search box
&& (
!str
--- a/hugo/static/css/custom.css Wed Apr 17 01:11:11 2019 +0000
+++ b/hugo/static/css/custom.css Wed Apr 17 02:22:11 2019 +0000
@@ -25,3 +25,26 @@
font-weight: bolder;
font-size: 20px;
}
+
+#body-inner li p {
+ /* This is to fix the unwanted p-tags that blackfriday adds */
+ margin-block-start: 0;
+ margin-block-end: 0;
+}
+
+#body-inner li pre {
+ margin: 1rem 0;
+}
+
+#body-inner li {
+ margin-block-start: 0.3rem;
+ margin-block-end: 0.3rem;
+}
+
+nav#TableOfContents code {
+ /* Make titles with code snippets look nicer */
+ white-space: nowrap;
+ color: #8451a1;
+ background: #e2e2fd;
+ padding: 0px 2px;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hugo/static/oauth.html Wed Apr 17 02:22:11 2019 +0000
@@ -0,0 +1,159 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>libpurple oauth helper</title>
+
+ <meta charset="utf-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
+
+ <script
+ src="https://code.jquery.com/jquery-3.2.1.min.js"
+ integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
+ crossorigin="anonymous"
+ ></script>
+ <link
+ href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"
+ rel="stylesheet"
+ integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN"
+ crossorigin="anonymous"
+ />
+ <link
+ rel="stylesheet"
+ href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
+ integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u"
+ crossorigin="anonymous"
+ />
+ <script
+ src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"
+ integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa"
+ crossorigin="anonymous"
+ ></script>
+
+ <style>
+ body {
+ margin-top: 1em;
+ }
+ .blur {
+ filter: blur(3px);
+ }
+ </style>
+ </head>
+ <body>
+ <div class="container">
+ <div class="col-sm-8 col-sm-offset-2">
+ <div class="row">
+ <img
+ src="/images/pidgin-circle-256.png"
+ class="img-responsive center-block"
+ />
+ </div>
+
+ <div class="row">
+ <div class="panel panel-info">
+ <div class="panel-heading">About</div>
+ <div class="panel-body">
+ This page helps you to login your accounts that
+ require oauth authentication. Due to the way
+ OAuth2's implicit flow works, we do not have access
+ to, nor do we store, this access token.
+ </div>
+ </div>
+ </div>
+
+ <div class="row">
+ <div class="panel panel-success">
+ <div class="panel-heading">Usage</div>
+ <div class="panel-body">
+ To use this page, click the copy button next to the
+ access token and paste it into the password entry
+ for the pidgin account you just enabled.
+ </div>
+ </div>
+ </div>
+
+ <div class="row">
+ <div class="alert alert-warning" role="alert">
+ <strong>Warning!</strong> This access code is used to
+ access your account. Do not share it with anyone!
+ </div>
+ </div>
+
+ <div class="row">
+ <div class="input-group">
+ <span class="input-group-btn">
+ <button
+ class="btn btn-secondary"
+ type="button"
+ id="access_token_toggle"
+ onclick="toggleAccessToken()"
+ >
+ Show
+ </button>
+ </span>
+ <input
+ type="text"
+ class="blur form-control"
+ id="access_token"
+ />
+ <span class="input-group-btn">
+ <button
+ type="button"
+ class="btn btn-default"
+ aria-label="Copy to clipboard"
+ onclick="copyToClipboard();"
+ >
+ <span
+ class="glyphicon glyphicon-copy"
+ aria-hidden="true"
+ ></span>
+ </button>
+ </span>
+ </div>
+ </div>
+ </div>
+ </div>
+ <script type="text/javascript">
+ $(document).ready(function() {
+ // set the input box's value to the value of access_token in window.location.hash
+ var data = window.location.hash.slice(1);
+ var vars = data.split("&");
+ for (var i = 0; i < vars.length; i++) {
+ var parts = vars[i].split("=");
+ if (parts[0] == "access_token") {
+ // remove the hash from the url so we don't leak it.
+ window.location.hash = "";
+
+ // update the input box with the access token
+ var element = $("#access_token");
+ element.val(parts[1]);
+ element.select();
+
+ // stop processing
+ break;
+ }
+ }
+ });
+
+ function copyToClipboard(e) {
+ $("#access_token").select();
+ document.execCommand("copy");
+ }
+
+ function toggleAccessToken() {
+ var toggle = $("#access_token_toggle");
+ var token = $("#access_token");
+
+ if (toggle.text() == "Show") {
+ toggle.text("Hide");
+ token.removeClass("blur");
+ } else {
+ toggle.text("Show");
+ token.addClass("blur");
+ }
+
+ token.select();
+ }
+ </script>
+ </body>
+</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/hugo/themes/learn/i18n/nl.toml Wed Apr 17 02:22:11 2019 +0000
@@ -0,0 +1,26 @@
+[Search-placeholder]
+other = "Zoeken..."
+
+[Clear-History]
+other = "Wis geschiedenis"
+
+[Attachments-label]
+other = "Bijlagen"
+
+[title-404]
+other = "Error"
+
+[message-404]
+other = "Blijkbaar bestaat deze pagina niet ¯\\_(ツ)_/¯."
+
+[Go-to-homepage]
+other = "Naar startpagina"
+
+[Edit-this-page]
+other = "Deze pagina bewerken"
+
+[Shortcuts-Title]
+other = "Snelkoppelingen"
+
+[Expand-title]
+other = "Lees meer..."
--- a/hugo/themes/learn/layouts/404.html Wed Apr 17 01:11:11 2019 +0000
+++ b/hugo/themes/learn/layouts/404.html Wed Apr 17 02:22:11 2019 +0000
@@ -18,7 +18,6 @@
<link href="{{ "css/nucleus.css" | relURL }}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" rel="stylesheet">
<link href="{{ "css/fontawesome-all.min.css" | relURL }}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" rel="stylesheet">
<link href="{{ "css/hybrid.css" | relURL }}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" rel="stylesheet">
- <link href="{{ "css/featherlight.min.css" | relURL }}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" rel="stylesheet">
<link href="{{ "css/perfect-scrollbar.min.css" | relURL }}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" rel="stylesheet">
<link href="{{ "css/horsey.css" | relURL }}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" rel="stylesheet">
<link href="{{ "css/theme.css" | relURL }}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" rel="stylesheet">
--- a/hugo/themes/learn/layouts/partials/footer.html Wed Apr 17 01:11:11 2019 +0000
+++ b/hugo/themes/learn/layouts/partials/footer.html Wed Apr 17 02:22:11 2019 +0000
@@ -61,7 +61,6 @@
<script src="{{ "js/perfect-scrollbar.min.js" | relURL }}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}"></script>
<script src="{{ "js/perfect-scrollbar.jquery.min.js" | relURL }}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}"></script>
<script src="{{ "js/jquery.sticky.js" | relURL }}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}"></script>
- <script src="{{ "js/featherlight.min.js" | relURL }}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}"></script>
<script src="{{ "js/html5shiv-printshiv.min.js" | relURL }}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}"></script>
<script src="{{ "js/highlight.pack.js" | relURL }}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}"></script>
<script>hljs.initHighlightingOnLoad();</script>
--- a/hugo/themes/learn/layouts/partials/header.html Wed Apr 17 01:11:11 2019 +0000
+++ b/hugo/themes/learn/layouts/partials/header.html Wed Apr 17 02:22:11 2019 +0000
@@ -12,7 +12,6 @@
<link href="{{ "css/nucleus.css" | relURL }}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" rel="stylesheet">
<link href="{{ "css/fontawesome-all.min.css" | relURL }}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" rel="stylesheet">
<link href="{{ "css/hybrid.css" | relURL }}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" rel="stylesheet">
- <link href="{{ "css/featherlight.min.css" | relURL }}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" rel="stylesheet">
<link href="{{ "css/perfect-scrollbar.min.css" | relURL }}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" rel="stylesheet">
<link href="{{ "css/auto-complete.css" | relURL }}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" rel="stylesheet">
<link href="{{ "css/theme.css" | relURL }}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" rel="stylesheet">
@@ -82,27 +81,37 @@
</div>
{{ if $toc }}
- {{ partial "toc.html" . }}
+ <div class="progress">
+ <div class="wrapper">
+ {{ .TableOfContents }}
+ </div>
+ </div>
{{ end }}
</div>
</div>
{{ end }}
- {{/* TODO: Remove disgusting conditional tag spanning file */}}
{{ if .Params.chapter }}
<div id="chapter">
{{ end }}
+
+ {{ if and (not .IsHome) (not .Params.chapter) }}
+ <h1>{{ .Title }}</h1>
+ {{ end }}
+
+ {{ if gt .WordCount 400 }}
+ {{ .TableOfContents }}
+ {{ end }}
+
<div id="body-inner">
- {{ if and (not .IsHome) (not .Params.chapter) }}
- <h1>{{ .Title }}</h1>
- {{ end }}
- {{ define "breadcrumb" }}
- {{ $parent := .page.Parent }}
- {{ if $parent }}
- {{ $value := (printf "<a href='%s'>%s</a> > %s" $parent.URL $parent.Title .value) }}
- {{ template "breadcrumb" dict "page" $parent "value" $value }}
- {{ else }}
- {{ .value|safeHTML }}
- {{ end }}
- {{ end }}
+{{/*** Templates ***/}}
+{{ define "breadcrumb" }}
+ {{ $parent := .page.Parent }}
+ {{ if $parent }}
+ {{ $value := (printf "<a href='%s'>%s</a> > %s" $parent.URL $parent.Title .value) }}
+ {{ template "breadcrumb" dict "page" $parent "value" $value }}
+ {{ else }}
+ {{ .value|safeHTML }}
+ {{ end }}
+{{ end }}
--- a/hugo/themes/learn/layouts/partials/menu.html Wed Apr 17 01:11:11 2019 +0000
+++ b/hugo/themes/learn/layouts/partials/menu.html Wed Apr 17 02:22:11 2019 +0000
@@ -92,10 +92,10 @@
<!-- templates -->
{{ define "section-tree-nav" }}
-{{ $showvisitedlinks := .showvisitedlinks }}
-{{ $currentNode := .currentnode }}
-{{ with .sect }}
- {{ if .IsSection }}
+ {{ $showvisitedlinks := .showvisitedlinks }}
+ {{ $currentNode := .currentnode }}
+ {{ with .sect }}
+ {{ if .IsSection }}
{{ safeHTML .Params.head }}
<li data-nav-id="{{ .URL }}" title="{{ .Title }}" class="dd-item
{{- if .IsAncestor $currentNode }} parent{{ end -}}
--- a/hugo/themes/learn/layouts/partials/toc.html Wed Apr 17 01:11:11 2019 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-<div class="progress">
- <div class="wrapper">
-{{ .TableOfContents }}
- </div>
-</div>
--- a/hugo/themes/learn/static/css/featherlight.min.css Wed Apr 17 01:11:11 2019 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-/**
- * Featherlight - ultra slim jQuery lightbox
- * Version 1.2.3 - http://noelboss.github.io/featherlight/
- *
- * Copyright 2015, Noël Raoul Bossart (http://www.noelboss.com)
- * MIT Licensed.
-**/
-@media all{.featherlight{display:none;position:fixed;top:0;right:0;bottom:0;left:0;z-index:2147483647;text-align:center;white-space:nowrap;cursor:pointer;background:#333;background:rgba(0,0,0,0)}.featherlight:last-of-type{background:rgba(0,0,0,.8)}.featherlight:before{content:'';display:inline-block;height:100%;vertical-align:middle;margin-right:-.25em}.featherlight .featherlight-content{position:relative;text-align:left;vertical-align:middle;display:inline-block;overflow:auto;padding:25px 25px 0;border-bottom:25px solid transparent;min-width:30%;margin-left:5%;margin-right:5%;max-height:95%;background:#fff;cursor:auto;white-space:normal}.featherlight .featherlight-inner{display:block}.featherlight .featherlight-close-icon{position:absolute;z-index:9999;top:0;right:0;line-height:25px;width:25px;cursor:pointer;text-align:center;font:Arial,sans-serif;background:#fff;background:rgba(255,255,255,.3);color:#000}.featherlight .featherlight-image{width:100%}.featherlight-iframe .featherlight-content{border-bottom:0;padding:0}.featherlight iframe{border:0}}@media only screen and (max-width:1024px){.featherlight .featherlight-content{margin-left:10px;margin-right:10px;max-height:98%;padding:10px 10px 0;border-bottom:10px solid transparent}}
\ No newline at end of file
--- a/hugo/themes/learn/static/css/theme.css Wed Apr 17 01:11:11 2019 +0000
+++ b/hugo/themes/learn/static/css/theme.css Wed Apr 17 02:22:11 2019 +0000
@@ -917,9 +917,6 @@
#github-contrib i {
vertical-align: middle;
}
-.featherlight img {
- margin: 0 !important;
-}
.lifecycle #body-inner ul {
list-style: none;
margin: 0;
--- a/hugo/themes/learn/static/js/featherlight.min.js Wed Apr 17 01:11:11 2019 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-/**
- * Featherlight - ultra slim jQuery lightbox
- * Version 1.2.3 - http://noelboss.github.io/featherlight/
- *
- * Copyright 2015, Noël Raoul Bossart (http://www.noelboss.com)
- * MIT Licensed.
-**/
-!function(a){"use strict";function b(a,c){if(!(this instanceof b)){var d=new b(a,c);return d.open(),d}this.id=b.id++,this.setup(a,c),this.chainCallbacks(b._callbackChain)}if("undefined"==typeof a)return void("console"in window&&window.console.info("Too much lightness, Featherlight needs jQuery."));var c=[],d=function(b){return c=a.grep(c,function(a){return a!==b&&a.$instance.closest("body").length>0})},e=function(a,b){var c={},d=new RegExp("^"+b+"([A-Z])(.*)");for(var e in a){var f=e.match(d);if(f){var g=(f[1]+f[2].replace(/([A-Z])/g,"-$1")).toLowerCase();c[g]=a[e]}}return c},f={keyup:"onKeyUp",resize:"onResize"},g=function(c){a.each(b.opened().reverse(),function(){return c.isDefaultPrevented()||!1!==this[f[c.type]](c)?void 0:(c.preventDefault(),c.stopPropagation(),!1)})},h=function(c){if(c!==b._globalHandlerInstalled){b._globalHandlerInstalled=c;var d=a.map(f,function(a,c){return c+"."+b.prototype.namespace}).join(" ");a(window)[c?"on":"off"](d,g)}};b.prototype={constructor:b,namespace:"featherlight",targetAttr:"data-featherlight",variant:null,resetCss:!1,background:null,openTrigger:"click",closeTrigger:"click",filter:null,root:"body",openSpeed:250,closeSpeed:250,closeOnClick:"background",closeOnEsc:!0,closeIcon:"&#10005;",loading:"",otherClose:null,beforeOpen:a.noop,beforeContent:a.noop,beforeClose:a.noop,afterOpen:a.noop,afterContent:a.noop,afterClose:a.noop,onKeyUp:a.noop,onResize:a.noop,type:null,contentFilters:["jquery","image","html","ajax","iframe","text"],setup:function(b,c){"object"!=typeof b||b instanceof a!=!1||c||(c=b,b=void 0);var d=a.extend(this,c,{target:b}),e=d.resetCss?d.namespace+"-reset":d.namespace,f=a(d.background||['<div class="'+e+"-loading "+e+'">','<div class="'+e+'-content">','<span class="'+e+"-close-icon "+d.namespace+'-close">',d.closeIcon,"</span>",'<div class="'+d.namespace+'-inner">'+d.loading+"</div>","</div>","</div>"].join("")),g="."+d.namespace+"-close"+(d.otherClose?","+d.otherClose:"");return d.$instance=f.clone().addClass(d.variant),d.$instance.on(d.closeTrigger+"."+d.namespace,function(b){var c=a(b.target);("background"===d.closeOnClick&&c.is("."+d.namespace)||"anywhere"===d.closeOnClick||c.closest(g).length)&&(b.preventDefault(),d.close())}),this},getContent:function(){var b=this,c=this.constructor.contentFilters,d=function(a){return b.$currentTarget&&b.$currentTarget.attr(a)},e=d(b.targetAttr),f=b.target||e||"",g=c[b.type];if(!g&&f in c&&(g=c[f],f=b.target&&e),f=f||d("href")||"",!g)for(var h in c)b[h]&&(g=c[h],f=b[h]);if(!g){var i=f;if(f=null,a.each(b.contentFilters,function(){return g=c[this],g.test&&(f=g.test(i)),!f&&g.regex&&i.match&&i.match(g.regex)&&(f=i),!f}),!f)return"console"in window&&window.console.error("Featherlight: no content filter found "+(i?' for "'+i+'"':" (no target specified)")),!1}return g.process.call(b,f)},setContent:function(b){var c=this;return(b.is("iframe")||a("iframe",b).length>0)&&c.$instance.addClass(c.namespace+"-iframe"),c.$instance.removeClass(c.namespace+"-loading"),c.$instance.find("."+c.namespace+"-inner").slice(1).remove().end().replaceWith(a.contains(c.$instance[0],b[0])?"":b),c.$content=b.addClass(c.namespace+"-inner"),c},open:function(b){var d=this;if(d.$instance.hide().appendTo(d.root),!(b&&b.isDefaultPrevented()||d.beforeOpen(b)===!1)){b&&b.preventDefault();var e=d.getContent();if(e)return c.push(d),h(!0),d.$instance.fadeIn(d.openSpeed),d.beforeContent(b),a.when(e).always(function(a){d.setContent(a),d.afterContent(b)}).then(d.$instance.promise()).done(function(){d.afterOpen(b)})}return d.$instance.detach(),a.Deferred().reject().promise()},close:function(b){var c=this,e=a.Deferred();return c.beforeClose(b)===!1?e.reject():(0===d(c).length&&h(!1),c.$instance.fadeOut(c.closeSpeed,function(){c.$instance.detach(),c.afterClose(b),e.resolve()})),e.promise()},chainCallbacks:function(b){for(var c in b)this[c]=a.proxy(b[c],this,a.proxy(this[c],this))}},a.extend(b,{id:0,autoBind:"[data-featherlight]",defaults:b.prototype,contentFilters:{jquery:{regex:/^[#.]\w/,test:function(b){return b instanceof a&&b},process:function(b){return a(b).clone(!0)}},image:{regex:/\.(png|jpg|jpeg|gif|tiff|bmp)(\?\S*)?$/i,process:function(b){var c=this,d=a.Deferred(),e=new Image,f=a('<img src="'+b+'" alt="" class="'+c.namespace+'-image" />');return e.onload=function(){f.naturalWidth=e.width,f.naturalHeight=e.height,d.resolve(f)},e.onerror=function(){d.reject(f)},e.src=b,d.promise()}},html:{regex:/^\s*<[\w!][^<]*>/,process:function(b){return a(b)}},ajax:{regex:/./,process:function(b){var c=a.Deferred(),d=a("<div></div>").load(b,function(a,b){"error"!==b&&c.resolve(d.contents()),c.fail()});return c.promise()}},iframe:{process:function(b){var c=new a.Deferred,d=a("<iframe/>").hide().attr("src",b).css(e(this,"iframe")).on("load",function(){c.resolve(d.show())}).appendTo(this.$instance.find("."+this.namespace+"-content"));return c.promise()}},text:{process:function(b){return a("<div>",{text:b})}}},functionAttributes:["beforeOpen","afterOpen","beforeContent","afterContent","beforeClose","afterClose"],readElementConfig:function(b,c){var d=this,e=new RegExp("^data-"+c+"-(.*)"),f={};return b&&b.attributes&&a.each(b.attributes,function(){var b=this.name.match(e);if(b){var c=this.value,g=a.camelCase(b[1]);if(a.inArray(g,d.functionAttributes)>=0)c=new Function(c);else try{c=a.parseJSON(c)}catch(h){}f[g]=c}}),f},extend:function(b,c){var d=function(){this.constructor=b};return d.prototype=this.prototype,b.prototype=new d,b.__super__=this.prototype,a.extend(b,this,c),b.defaults=b.prototype,b},attach:function(b,c,d){var e=this;"object"!=typeof c||c instanceof a!=!1||d||(d=c,c=void 0),d=a.extend({},d);var f=d.namespace||e.defaults.namespace,g=a.extend({},e.defaults,e.readElementConfig(b[0],f),d);return b.on(g.openTrigger+"."+g.namespace,g.filter,function(f){var h=a.extend({$source:b,$currentTarget:a(this)},e.readElementConfig(b[0],g.namespace),e.readElementConfig(this,g.namespace),d);new e(c,h).open(f)}),b},current:function(){var a=this.opened();return a[a.length-1]||null},opened:function(){var b=this;return d(),a.grep(c,function(a){return a instanceof b})},close:function(){var a=this.current();return a?a.close():void 0},_onReady:function(){var b=this;b.autoBind&&(b.attach(a(document),{filter:b.autoBind}),a(b.autoBind).filter("[data-featherlight-filter]").each(function(){b.attach(a(this))}))},_callbackChain:{onKeyUp:function(a,b){return 27===b.keyCode?(this.closeOnEsc&&this.$instance.find("."+this.namespace+"-close:first").click(),!1):a(b)},onResize:function(a,b){if(this.$content.naturalWidth){var c=this.$content.naturalWidth,d=this.$content.naturalHeight;this.$content.css("width","").css("height","");var e=Math.max(c/parseInt(this.$content.parent().css("width"),10),d/parseInt(this.$content.parent().css("height"),10));e>1&&this.$content.css("width",""+c/e+"px").css("height",""+d/e+"px")}return a(b)},afterContent:function(a,b){var c=a(b);return this.onResize(b),c}}}),a.featherlight=b,a.fn.featherlight=function(a,c){return b.attach(this,a,c)},a(document).ready(function(){b._onReady()})}(jQuery);
\ No newline at end of file
--- a/hugo/themes/learn/static/js/hugo-learn.js Wed Apr 17 01:11:11 2019 +0000
+++ b/hugo/themes/learn/static/js/hugo-learn.js Wed Apr 17 02:22:11 2019 +0000
@@ -1,62 +1,3 @@
-// Get Parameters from some url
-var getUrlParameter = function getUrlParameter(sPageURL) {
- var url = sPageURL.split('?');
- var obj = {};
- if (url.length == 2) {
- var sURLVariables = url[1].split('&'),
- sParameterName,
- i;
- for (i = 0; i < sURLVariables.length; i++) {
- sParameterName = sURLVariables[i].split('=');
- obj[sParameterName[0]] = sParameterName[1];
- }
- return obj;
- } else {
- return undefined;
- }
-};
-
-// Execute actions on images generated from Markdown pages
-var images = $("div#body-inner img").not(".inline");
-// Wrap image inside a featherlight (to get a full size view in a popup)
-images.wrap(function(){
- var image =$(this);
- if (!image.parent("a").length) {
- return "<a href='" + image[0].src + "' data-featherlight='image'></a>";
- }
-});
-
-// Change styles, depending on parameters set to the image
-images.each(function(index){
- var image = $(this)
- var o = getUrlParameter(image[0].src);
- if (typeof o !== "undefined") {
- var h = o["height"];
- var w = o["width"];
- var c = o["classes"];
- image.css("width", function() {
- if (typeof w !== "undefined") {
- return w;
- } else {
- return "auto";
- }
- });
- image.css("height", function() {
- if (typeof h !== "undefined") {
- return h;
- } else {
- return "auto";
- }
- });
- if (typeof c !== "undefined") {
- var classes = c.split(',');
- for (i = 0; i < classes.length; i++) {
- image.addClass(classes[i]);
- }
- }
- }
-});
-
// Stick the top to the top of the screen when scrolling
$(document).ready(function(){
$("#top-bar").sticky({topSpacing:0, zIndex: 1000});
--- a/hugo/themes/learn/static/js/learn.js Wed Apr 17 01:11:11 2019 +0000
+++ b/hugo/themes/learn/static/js/learn.js Wed Apr 17 02:22:11 2019 +0000
@@ -381,12 +381,6 @@
$(".highlightable").highlight(sessionStorage.getItem('search-value'), { element: 'mark' });
});
-$(function() {
- $('a[rel="lightbox"]').featherlight({
- root: 'section#body'
- });
-});
-
jQuery.extend({
highlight: function(node, re, nodeName, className) {
if (node.nodeType === 3) {