Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scrollstories embed von cloudflare.com #1334

Closed
lukasniebler opened this issue May 25, 2023 · 4 comments
Closed

Scrollstories embed von cloudflare.com #1334

lukasniebler opened this issue May 25, 2023 · 4 comments
Assignees
Labels
Bug Code Codeoptiminierung

Comments

@lukasniebler
Copy link
Contributor

Ist-Zustand

In scrollstories.php werden die Skripte aktuell von Cloudflare CDN geladen:

// Enqueue necessary JavaScript files
function scroll_page_scripts() {
    wp_enqueue_script( 'd3', 'https://d3js.org/d3.v5.min.js' );
    wp_enqueue_script( 'scrollmagic', 'https://cdnjs.cloudflare.com/ajax/libs/ScrollMagic/2.0.7/ScrollMagic.min.js' );
    wp_enqueue_script( 'animation-gsap', 'https://cdnjs.cloudflare.com/ajax/libs/ScrollMagic/2.0.7/plugins/animation.gsap.min.js' );
    wp_enqueue_script( 'debug', 'https://cdnjs.cloudflare.com/ajax/libs/ScrollMagic/2.0.7/plugins/debug.addIndicators.min.js' );
    wp_enqueue_script( 'scroll-page-script', get_template_directory_uri() . '/js/fau-scroll-stories.min.js', array( 'jquery', 'd3', 'scrollmagic', 'animation-gsap', 'debug' ), '1.0.0', true );
}

Soll-Zustand

Externe Skripte sollten nicht über ein CDN geladen werden, sondern lokal im Projekt eingebunden sein.

@FitoreGashi Könnt Ihr die notwendigen Skripte für die Scrollstories noch lokal einbinden?

https://github.com/RRZE-Webteam/FAU-Einrichtungen/blob/cd20af23637d48f7a4802543d434f55c04ccc864/page-templates/scroll-stories.php#LL7C1-L14C2

@lukasniebler lukasniebler added Bug Code Codeoptiminierung labels May 25, 2023
@xwolfde
Copy link
Member

xwolfde commented Jun 7, 2023

Nebenbei haben wir damit natürlich auch ein Datenschutz- und Perfrormanceproblem.

@FitoreGashi
Copy link
Collaborator

Ja, ich kann sie speichern. Kann ich in js einen neuen Ordner mit dem Namen „cloudflare-scrollmagic“ erstellen?

@xwolfde
Copy link
Member

xwolfde commented Jun 7, 2023

Ja, aber in /src/js und dann über das Gulpskript dann die produktive JS in /js kopieren/erstellen lassen

FitoreGashi added a commit that referenced this issue Jun 8, 2023
@xwolfde
Copy link
Member

xwolfde commented Jun 22, 2023

done

@xwolfde xwolfde closed this as completed Jun 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Code Codeoptiminierung
Projects
None yet
Development

No branches or pull requests

3 participants