You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by ur...@apache.org on 2022/05/19 01:39:28 UTC

[pulsar-site] 01/01: fix: sine wave not define

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

urfree pushed a commit to branch fix/sine-waves
in repository https://gitbox.apache.org/repos/asf/pulsar-site.git

commit f324a6c3c922e332cdae7f1c3d43d587261f32a0
Author: Li Li <ur...@apache.org>
AuthorDate: Thu May 19 09:39:14 2022 +0800

    fix: sine wave not define
    
    Signed-off-by: Li Li <ur...@apache.org>
---
 site2/website-next/docusaurus.config.js        |  2 +-
 site2/website-next/src/pages/index.js          | 13 ++++++++++---
 site2/website-next/static/js/sine-waves.min.js | 10 ++++++++++
 3 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/site2/website-next/docusaurus.config.js b/site2/website-next/docusaurus.config.js
index 5d833e782ef..ca9a36c0f64 100644
--- a/site2/website-next/docusaurus.config.js
+++ b/site2/website-next/docusaurus.config.js
@@ -427,7 +427,7 @@ module.exports = {
   ],
   scripts: [
     {
-      src: "https://cdn.jsdelivr.net/npm/sine-waves@0.3.0/sine-waves.min.js",
+      src: "https://pulsar.apache.org/js/sine-waves.min.js",
       async: true,
     },
   ],
diff --git a/site2/website-next/src/pages/index.js b/site2/website-next/src/pages/index.js
index b588a14bc13..4f98a35a946 100644
--- a/site2/website-next/src/pages/index.js
+++ b/site2/website-next/src/pages/index.js
@@ -9,6 +9,9 @@ import PillButton from "../components/PillButton";
 import GitHubIcon from "@mui/icons-material/GitHub";
 import { docUrl, githubUrl } from "../utils/index";
 var startWaves = function () {
+  if (!SineWaves) {
+    return;
+  }
   new SineWaves({
     el: document.getElementById("waves"),
     speed: 2,
@@ -139,7 +142,7 @@ export default function Home() {
           });
         }
       },
-      { threshold: [ 0.1 ] }
+      { threshold: [0.1] }
     );
     observer.observe(document.querySelector("#home-features"));
 
@@ -174,10 +177,14 @@ export default function Home() {
         </div>
         <div className="home-ctas relative z-5">
           <div className="inner">
-            <PillButton variant="" target="" href={docUrl('next/concepts-overview')}>
+            <PillButton
+              variant=""
+              target=""
+              href={docUrl("next/concepts-overview")}
+            >
               Learn More
             </PillButton>
-            <PillButton variant="grey" href={docUrl('next/')}>
+            <PillButton variant="grey" href={docUrl("next/")}>
               Quickstart
             </PillButton>
           </div>
diff --git a/site2/website-next/static/js/sine-waves.min.js b/site2/website-next/static/js/sine-waves.min.js
new file mode 100644
index 00000000000..385ba350388
--- /dev/null
+++ b/site2/website-next/static/js/sine-waves.min.js
@@ -0,0 +1,10 @@
+/*!
+ _______ _____ __   _ _______      _  _  _ _______ _    _ _______ _______
+ |______   |   | \  | |______      |  |  | |_____|  \  /  |______ |______
+ ______| __|__ |  \_| |______      |__|__| |     |   \/   |______ ______|
+                                                                         
+ sine-waves v0.3.0 <https://github.com/isuttell/sine-waves>
+ Contributor(s): Isaac Suttell <is...@isaacsuttell.com>
+ Last Build: 2014-12-03
+*/
+!function(a,b){"use strict";"function"==typeof define&&"object"==typeof define.amd?define([],function(){return b(a)}):a.SineWaves=b(a)}(this,function(){"use strict";function a(a){if(this.options=i.defaults(this.options,a),this.el=this.options.el,delete this.options.el,!this.el)throw"No Canvas Selected";if(this.ctx=this.el.getContext("2d"),this.waves=this.options.waves,delete this.options.waves,!this.waves||!this.waves.length)throw"No waves specified";this.dpr=window.devicePixelRatio||1,t [...]
\ No newline at end of file