Skip to content

Commit 5bcb511

Browse files
joeykleecatarak
authored andcommitted
Update/Updated Generative Design Examples (processing#774)
* replaced () with {} to fix implicit return error * added first version of fetching generative-design examples * ignore local testing files * formatting * updated examples-gg-latest * updated examples-gg-latest.js - data files not served via rawgit - hallelujah! - added jquery * updated p5 version * refactoring and code cleanup * added comment * comment out link to svgFiles - unused * moved commented code * fixed conflicts * linted examples-gg-latest * changed branch ref to master * rm spaces * updated url links with https for jquery and set branch to dev-updates for testing * changed branched ref to master * removed console.log of response.data to prevent logging user data to console * fixed linting error * updated p5 version from 0.7.1 to 0.7.2
1 parent b68e3a7 commit 5bcb511

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

server/scripts/examples-gg-latest.js

+9-12
Original file line numberDiff line numberDiff line change
@@ -21,26 +21,23 @@ const defaultHTML =
2121
`<!DOCTYPE html>
2222
<html>
2323
<head>
24-
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.6.1/p5.min.js"></script>
25-
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.6.1/addons/p5.dom.min.js"></script>
26-
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.6.1/addons/p5.sound.min.js"></script>
24+
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.7.2/p5.min.js"></script>
25+
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.7.2/addons/p5.dom.min.js"></script>
26+
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.7.2/addons/p5.sound.min.js"></script>
2727
2828
<!-- Generative Design Dependencies here -->
2929
<!-- GG Bundled -->
30-
<script src=
31-
"https://rawgit.com/generative-design/Code-Package-p5.js/${branchName}/libraries/gg-dep-bundle/gg-dep-bundle.js">
32-
</script>
33-
30+
<script src="https://raw.githack.com/generative-design/Code-Package-p5.js/${branchName}/libraries/gg-dep-bundle/gg-dep-bundle.js"></script>
3431
<!-- Opentype -->
3532
<script src="https://cdnjs.cloudflare.com/ajax/libs/opentype.js/0.7.3/opentype.min.js"></script>
3633
<!-- Rita -->
3734
<script src="https://cdnjs.cloudflare.com/ajax/libs/rita/1.3.11/rita-small.min.js"></script>
3835
<!-- Chroma -->
3936
<script src="https://cdnjs.cloudflare.com/ajax/libs/chroma-js/1.3.6/chroma.min.js"></script>
4037
<!-- Jquery -->
41-
<script src="http://code.jquery.com/jquery-3.3.1.min.js"
42-
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
43-
crossorigin="anonymous"></script>
38+
<script src="https://code.jquery.com/jquery-3.3.1.min.js"
39+
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
40+
crossorigin="anonymous"></script>
4441
4542
<!-- sketch additions -->
4643
@@ -432,10 +429,10 @@ function getAllSketchContent(newProjectList) {
432429
console.log(sketchFile.name);
433430
// https://cdn.rawgit.com/opensourcedesign/fonts/2f220059/gnu-freefont_freesans/FreeSans.otf?raw=true
434431
// "https://raw.githubusercontent.com/generative-design/Code-Package-p5.js/gg4editor/01_P/P_3_2_1_01/data/FreeSans.otf",
435-
const rawGitRef = `https://cdn.rawgit.com/${newProject.files[i].url.split('.com/')[1]}`;
432+
const rawGitRef = `https://raw.githack.com/${newProject.files[i].url.split('.com/')[1]}`;
436433
sketchFile.content = rawGitRef;
437434
sketchFile.url = rawGitRef;
438-
435+
// https://raw.githack.com/generative-design/Code-Package-p5.js/master/libraries/gg-dep-bundle/gg-dep-bundle.js
439436
// replace ref in sketch.js ==> should serve from the file?
440437
// newProject.files[1].content = newProject.files[1].content.replace(`'data/${sketchFile.name}'`, `'${rawGitRef}'`);
441438
resolve(newProject);

0 commit comments

Comments
 (0)