You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by ka...@apache.org on 2019/11/15 16:14:08 UTC

[airflow-site] branch aip-11 updated (7e02c20 -> 1c7a899)

This is an automated email from the ASF dual-hosted git repository.

kamilbregula pushed a change to branch aip-11
in repository https://gitbox.apache.org/repos/asf/airflow-site.git.


 discard 7e02c20  displaying commiters in random order (#160)
     new 1c7a899  Display commiters in random order (#160)

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (7e02c20)
            \
             N -- N -- N   refs/heads/aip-11 (1c7a899)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:


[airflow-site] 01/01: Display commiters in random order (#160)

Posted by ka...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kamilbregula pushed a commit to branch aip-11
in repository https://gitbox.apache.org/repos/asf/airflow-site.git

commit 1c7a8994f9914bc016ac3ccc7d71579d1ec89256
Author: Kamil Gabryjelski <ka...@gmail.com>
AuthorDate: Fri Nov 15 17:12:56 2019 +0100

    Display commiters in random order (#160)
---
 landing-pages/src/index.js                         | 10 ++++--
 landing-pages/src/js/commitersList.js              | 36 ++++++++++++++++++++++
 .../src/js/{showAllCommiters.js => showMore.js}    |  6 ++--
 3 files changed, 46 insertions(+), 6 deletions(-)

diff --git a/landing-pages/src/index.js b/landing-pages/src/index.js
index 16b7734..39664e6 100644
--- a/landing-pages/src/index.js
+++ b/landing-pages/src/index.js
@@ -17,7 +17,8 @@
  * under the License.
  */
 
-import {showMore} from "./js/showAllCommiters";
+import {shuffleNodeChildren} from "./js/commitersList";
+import {showMore} from "./js/showMore";
 import {handleActiveVideo} from "./js/handleActiveVideo";
 import "./js/navbarScroll";
 import "./js/drawer";
@@ -31,8 +32,11 @@ if (document.querySelector("#search")) {
   import(/* webpackChunkName: "search" */ "./js/searchBlogPosts");
 }
 
-showMore("#commiters-container", "#show-more-commiters");
-showMore("#pmc-container", "#show-more-pmcs");
+shuffleNodeChildren("#commiters-container");
+shuffleNodeChildren("#pmc-container");
+
+showMore("#commiters-container", "#show-more-commiters", 4);
+showMore("#pmc-container", "#show-more-pmcs", 4);
 showMore(
   "#case-studies-container",
   "#show-more-case-studies",
diff --git a/landing-pages/src/js/commitersList.js b/landing-pages/src/js/commitersList.js
new file mode 100644
index 0000000..e8b80f0
--- /dev/null
+++ b/landing-pages/src/js/commitersList.js
@@ -0,0 +1,36 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+export const shuffleNodeChildren = (containerID) => {
+  const container = document.querySelector(containerID);
+
+  if (!container) {
+    return;
+  }
+
+  const tmp = container.cloneNode(true);
+
+  for (let i = tmp.children.length + 1; i--;) {
+    tmp.appendChild(tmp.children[Math.random() * i | 0]);
+  }
+
+  container.parentNode.replaceChild(tmp, container);
+};
+
+shuffleNodeChildren();
diff --git a/landing-pages/src/js/showAllCommiters.js b/landing-pages/src/js/showMore.js
similarity index 92%
rename from landing-pages/src/js/showAllCommiters.js
rename to landing-pages/src/js/showMore.js
index 52a8840..20d74cc 100644
--- a/landing-pages/src/js/showAllCommiters.js
+++ b/landing-pages/src/js/showMore.js
@@ -34,15 +34,15 @@ export const showMore = (containerID, buttonID, maxItemsOnPage = 8) => {
   }
 
   button.style.display = "block";
-  const commiterElements = Array.from(container.children);
-  commiterElements
+  const elements = Array.from(container.children);
+  elements
     .slice(maxItemsOnPage, container.childElementCount)
     .map((child) => {
       child.style.display = "none";
     });
 
   button.addEventListener("click", () => {
-    showElementsOnPage(commiterElements, currentPage, maxItemsOnPage);
+    showElementsOnPage(elements, currentPage, maxItemsOnPage);
     currentPage += 1;
     if (container.childElementCount <= maxItemsOnPage * currentPage) {
       button.style.display = "none";