From 18f0ca2580211d5f02160b19689b7581c3a8cbe0 Mon Sep 17 00:00:00 2001 From: dblythy Date: Mon, 12 Jun 2023 14:30:06 +1000 Subject: [PATCH 1/6] dynamic-docs --- _includes/head.html | 9 +- css/docs.scss | 173 +++++++++++++++++++++++++++++++++++++ index.md | 206 +------------------------------------------- js/links.js | 200 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 382 insertions(+), 206 deletions(-) create mode 100644 js/links.js diff --git a/_includes/head.html b/_includes/head.html index afcc77550..26178e9ed 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -23,7 +23,14 @@ + + + + @@ -43,7 +50,7 @@ - + {% if page.layout == "guide" %} {% else %} diff --git a/css/docs.scss b/css/docs.scss index 805ec0084..de403db3e 100644 --- a/css/docs.scss +++ b/css/docs.scss @@ -68,3 +68,176 @@ $svg-plus: "{{ '/assets/svgs/plus.svg' | prepend: site.baseurl }}"; @import "lib/marketing/components/heros"; @import "lib/docs/components/docs-platform"; + +.repoRow { + width: 100%; + display: flex; + gap: 40px; + justify-content: center; + flex-wrap: wrap; +} + +.repo, .repoList { + border: 1px solid #E0E0EA; + background: rgba(14, 105, 161, 0.03); + overflow: hidden; } + .repo .repoDescription p, .repoList .repoDescription p { + font-size: 14px; + overflow: hidden; + color: rgba(102, 99, 122, 0.5); + margin: 0px; } + .repo img.icon, .repoList img.icon { + height: 14px; + margin-right: 4px; + position: relative; + top: 1px; } + +.repo { + text-overflow: ellipsis; + min-width: 180px; + max-width: 320px; + border-radius: 4px; + width: 33.333333%; + margin-right: 0px; + width: calc(33.333333% - 32px); + } + .repo:nth-of-type(3n) { + margin-right: 0px; } + .repo h4 { + color: #66637A; + text-overflow: ellipsis; + overflow: hidden; + font-size: 28px; + } + .repo .SDKLogo { + height: 30px; + position: absolute; + top: 0px; + bottom: 0px; + margin: auto 0; + right: 16px; } + .repo .repoTitle { + padding: 10px 16px; + position: relative; } + .repo .repoTitle h4 { + transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1); + white-space: normal; } + .repo .repoTitle p { + margin: 0px; + opacity: 0.45; + font-size: 14px; + font-family: "webfont_alright"; + line-height: 16px; } + .repo .repoTitle p span { + margin-right: 24px; } + .repo .repoLink { + height: 40px; + border-top: 1px solid #E0E0EA; + position: relative; + cursor: pointer; + background: #ffffff; } + .repo .repoLink a { + border-bottom: 1px solid #E0E0EA; } + .repo .repoLink:first-of-type { + margin-top: 0px; } + .repo .repoLink p { + line-height: 40px; + padding: 0px 16px; + color: #66637A; + margin: 0px; } + .repo .repoLink:not(.blankRepoLink):hover:after { + opacity: 1; } + .repo .repoLink:not(.blankRepoLink):after { + transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1); + content: ""; + position: absolute; + right: 12px; + top: 8px; + width: 24px; + height: 24px; + background: url("../img/arrowRight.svg") no-repeat center; + background-size: 100% auto; + opacity: 0.18; } + .repo .repoLink.expandableRepoLink { + min-height: 40px; + height: auto; + max-height: 40px; + overflow: hidden; + transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1); } + .repo .repoLink.expandableRepoLink p { + border-bottom: 1px solid #E0E0EA; } + .repo .repoLink.expandableRepoLink ul { + padding: 12px 0px; + margin: 0px; + background: rgba(224, 224, 234, 0.2); } + .repo .repoLink.expandableRepoLink ul li { + margin-left: 16px; + padding-left: 12px; + font-size: 14px; + color: rgba(85, 85, 114, 0.6); + line-height: 24px; + list-style: none; + border-left: 1px solid #E0E0EA; + transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1); } + .repo .repoLink.expandableRepoLink ul li:hover { + color: #555572; + border-left: 1px solid #555572; } + .repo .repoLink.expandableRepoLink.expanded { + max-height: 240px; } + .repo .repoLink.expandableRepoLink.expanded:not(.blankRepoLink):after { + transform: rotate(90deg); + opacity: 1; } + .repo .repoDescription { + background: #ffffff; + border-top: 1px solid #E0E0EA; + height: auto; + text-overflow: ellipsis; + line-height: 24px; + padding: 12px 16px; } + .repo .repoButton { + padding: 14px 16px; + border-top: 1px solid #E0E0EA; + min-height: 61px; } + .repo .repoButton button, .repo .repoButton .button { + width: 100%; } + @media screen and (max-width: 960px) { + .repo { + width: calc(33.333333333% - 24px); + margin-right: calc(32px); } } + @media screen and (max-width: 600px) { + .repo { + float: none; + width: 100%; + margin: 0 auto 32px auto; } + .repo:nth-of-type(3n) { + margin: 0 auto 32px auto; } + .repo .blankRepoLink { + display: none; } } + + button, .button { + font-family: "webfont_alright"; + border-radius: 4px; + outline: none; + background: #169CEE; + color: #ffffff; + border: none; + margin-right: 32px; + font-size: 14px; + padding: 0px 16px; + height: 32px; + line-height: 32px; + transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1); + font-weight: 100; } + button.outline, .button.outline { + background: transparent; + border: 1px solid #169CEE; + color: #169CEE; } + button.outline:hover, .button.outline:hover { + background: #169CEE; + color: #ffffff; } + button.large, .button.large { + font-family: 'alrightRegular'; + text-transform: uppercase; + font-size: 18px; + margin-right: 16px; + margin-top: 16px; } diff --git a/index.md b/index.md index 9978afad5..1f08dac3c 100644 --- a/index.md +++ b/index.md @@ -11,211 +11,7 @@ layout: docs

You can set up your own Parse server and dashboard or use a service that hosts Parse for you.

-
-
-
- Parse Server - -
- - -
-
-
- GraphQL API - -
- -
-
-
-
-
- iOS - -
- - -
- -
-
- Android - -
- - -
- -
-
- Flutter - -
- - -
- -
-
- Dart - -
- - -
- -
-
- JavaScript - -
- - -
- -
-
- .NET + Xamarin - -
- - -
- -
-
- macOS - -
- - -
- -
-
- Unity - -
- - -
- -
-
- PHP - -
- - -
- -
-
- Arduino - -
- - -
- -
-
- Embedded C - -
- - -
- -
-
- Cloud Code - -
- -
-
-
- -
-
- REST API - -
- -
-
-
+
diff --git a/js/links.js b/js/links.js new file mode 100644 index 000000000..952f6c913 --- /dev/null +++ b/js/links.js @@ -0,0 +1,200 @@ +const links = { + "parse-server": { + image: "https://parseplatform.org/img/cloudcode.svg", + }, + "Parse-SDK-iOS-OSX": { + name: "Objective-C", + image: "https://parseplatform.org/img/ios.svg", + guides: [ + { + name: "iOS Guide", + link: "https://docs.parseplatform.org/ios/guide/", + }, + { + name: "macOS Guide", + link: "https://docs.parseplatform.org/macos/guide/", + }, + ], + modules: [{ name: "Live Query", link: "https://github.com/parse-community/ParseLiveQuery-iOS-OSX" }], + }, + "Parse-SDK-Android": { + image: "https://parseplatform.org/img/android.svg", + name: "Android", + guide: "https://docs.parseplatform.org/android/guide/", + modules: [ + { name: "Parse UI", link: "https://github.com/parse-community/ParseUI-Android" }, + { name: "Live Query", link: "https://github.com/parse-community/ParseLiveQuery-Android" }, + ], + }, + "Parse-SDK-JS": { + image: "https://parseplatform.org/img/javascript.svg", + guide: "https://docs.parseplatform.org/js/guide/", + name: "JavaScript", + }, + "Parse-Swift": { + image: "https://parseplatform.org/img/swiftColour.svg", + guide: "https://github.com/parse-community/Parse-Swift#usage-guide", + name: "Swift", + }, + "Parse-SDK-Flutter": [ + { + image: "https://parseplatform.org/img/flutter.svg", + guide: "https://docs.parseplatform.org/flutter/guide/", + api: "https://parseplatform.org/Parse-SDK-Flutter/flutter/flutter_parse_sdk_flutter/flutter_parse_sdk_flutter-library.html", + name: "Flutter", + }, + { + image: "https://parseplatform.org/img/dart.svg", + guide: "https://docs.parseplatform.org/dart/guide/", + api: "https://parseplatform.org/Parse-SDK-Flutter/flutter/flutter_parse_sdk_flutter/flutter_parse_sdk_flutter-library.html", + name: "Dart", + }, + ], + "parse-php-sdk": { + image: "https://parseplatform.org/img/php.svg", + guide: "https://docs.parseplatform.org/php/guide/", + api: "https://parseplatform.org/parse-php-sdk/", + name: "PHP", + }, + "Parse-SDK-dotNET": [ + { + image: "https://parseplatform.org/img/net.svg", + guide: "https://docs.parseplatform.org/dotnet/guide/", + name: ".NET + Xaramin", + }, + { + image: "https://parseplatform.org/img/unity.svg", + guide: "https://docs.parseplatform.org/unity/guide/", + name: "Unity", + }, + ], + "Parse-SDK-Arduino": { + image: "https://parseplatform.org/img/arduino.svg", + guide: "https://docs.parseplatform.org/arduino/guide/", + name: "Arduino", + }, + "parse-embedded-sdks": { + image: "https://parseplatform.org/img/c.svg", + guide: "https://docs.parseplatform.org/embedded_c/guide/", + name: "Embedded C", + }, +}; +const additionalMeta = [ + { + name: "Cloud Code", + image: "https://parseplatform.org/img/cloudcode.svg", + guide: "https://docs.parseplatform.org/cloudcode/guide/", + }, + { + name: "REST API", + image: "https://parseplatform.org/img/rest.svg", + guide: "https://docs.parseplatform.org/rest/guide/", + }, + { + name: "GraphQL API", + image: "https://parseplatform.org/img/graphql.svg", + guide: "https://docs.parseplatform.org/graphql/guide/", + }, +]; + +$(document).ready(function () { + if (!gitJson) { + return; + } + gitJson = gitJson.sort((a, b) => b.stargazers_count - a.stargazers_count); + const formatNumber = new Intl.NumberFormat().format; + for (const git of gitJson) { + const title = git.name; + const stars = parseInt(git.stargazers_count); + const forks = parseInt(git.forks_count); + const meta = links[title]; + if (meta) { + for (const metaData of Array.isArray(meta) ? meta : [meta]) { + const formattedTitle = title + .split("-") + .map((string) => string.charAt(0).toUpperCase() + string.slice(1)) + .join(" "); + const guideLink = metaData.guides + ? ` + ` + : ` + + + `; + const modules = metaData.modules + ? ` + ` + : ``; + const text = ` +
+
+ +

${metaData.name || formattedTitle}

+

+ + + ${formatNumber(stars)} + + + + ${formatNumber(forks)} + +

+
+ ${guideLink} + + + + + + + ${modules} + +
`; + $(".repoRow").append(text); + } + } + } + + for (const row of additionalMeta) { + const text = ` +
+
+ +

${row.name}

+
+ + + +
`; + $(".repoRow").append(text); + } + + $(".expandableRepoLink").on("click", function(){ + const clicked = $(this); + $(".expandableRepoLink").not(clicked).removeClass("expanded"); + clicked.toggleClass("expanded"); + }); +}); From 1a4ab58f9692f7dae3e30a4bf9812e90ced7a685 Mon Sep 17 00:00:00 2001 From: dblythy Date: Mon, 12 Jun 2023 18:46:40 +1000 Subject: [PATCH 2/6] Update docs.scss --- css/docs.scss | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/css/docs.scss b/css/docs.scss index de403db3e..f5b5362e4 100644 --- a/css/docs.scss +++ b/css/docs.scss @@ -104,10 +104,11 @@ $svg-plus: "{{ '/assets/svgs/plus.svg' | prepend: site.baseurl }}"; .repo:nth-of-type(3n) { margin-right: 0px; } .repo h4 { + margin: 10px 0px; color: #66637A; text-overflow: ellipsis; overflow: hidden; - font-size: 28px; + font-size: 20px;; } .repo .SDKLogo { height: 30px; From 1bdd0afc94e5f5cb4e624cde4645b8f1d964fa0b Mon Sep 17 00:00:00 2001 From: dblythy Date: Mon, 12 Jun 2023 18:56:13 +1000 Subject: [PATCH 3/6] wip --- css/docs.scss | 1 + js/links.js | 43 ++++++++++++++++++++++--------------------- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/css/docs.scss b/css/docs.scss index f5b5362e4..061bfbac4 100644 --- a/css/docs.scss +++ b/css/docs.scss @@ -75,6 +75,7 @@ $svg-plus: "{{ '/assets/svgs/plus.svg' | prepend: site.baseurl }}"; gap: 40px; justify-content: center; flex-wrap: wrap; + align-items: start; } .repo, .repoList { diff --git a/js/links.js b/js/links.js index 952f6c913..a34a64e5d 100644 --- a/js/links.js +++ b/js/links.js @@ -97,7 +97,7 @@ const additionalMeta = [ }, ]; -$(document).ready(function () { +jQuery(function ($) { if (!gitJson) { return; } @@ -108,36 +108,38 @@ $(document).ready(function () { const stars = parseInt(git.stargazers_count); const forks = parseInt(git.forks_count); const meta = links[title]; - if (meta) { - for (const metaData of Array.isArray(meta) ? meta : [meta]) { - const formattedTitle = title - .split("-") - .map((string) => string.charAt(0).toUpperCase() + string.slice(1)) - .join(" "); - const guideLink = metaData.guides - ? ` + if (!meta) { + continue; + } + for (const metaData of Array.isArray(meta) ? meta : [meta]) { + const formattedTitle = title + .split("-") + .map((string) => string.charAt(0).toUpperCase() + string.slice(1)) + .join(" "); + const guideLink = metaData.guides + ? ` ` - : ` + : ` `; - const modules = metaData.modules - ? ` + const modules = metaData.modules + ? ` ` - : ``; - const text = ` + : ``; + const text = `
@@ -171,8 +173,7 @@ $(document).ready(function () {
`; - $(".repoRow").append(text); - } + $(".repoRow").append(text); } } @@ -192,9 +193,9 @@ $(document).ready(function () { $(".repoRow").append(text); } - $(".expandableRepoLink").on("click", function(){ - const clicked = $(this); - $(".expandableRepoLink").not(clicked).removeClass("expanded"); - clicked.toggleClass("expanded"); - }); + $(".expandableRepoLink").on("click", function () { + const clicked = $(this); + $(".expandableRepoLink").not(clicked).removeClass("expanded"); + clicked.toggleClass("expanded"); + }); }); From eefebb54b933e39461e234fc46b935c0dcfcf485 Mon Sep 17 00:00:00 2001 From: dblythy Date: Mon, 12 Jun 2023 19:00:55 +1000 Subject: [PATCH 4/6] Update links.js --- js/links.js | 173 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 99 insertions(+), 74 deletions(-) diff --git a/js/links.js b/js/links.js index a34a64e5d..857579e1a 100644 --- a/js/links.js +++ b/js/links.js @@ -1,99 +1,106 @@ const links = { - "parse-server": { - image: "https://parseplatform.org/img/cloudcode.svg", + 'parse-server': { + image: 'https://parseplatform.org/img/cloudcode.svg', }, - "Parse-SDK-iOS-OSX": { - name: "Objective-C", - image: "https://parseplatform.org/img/ios.svg", + 'Parse-SDK-iOS-OSX': { + name: 'Objective-C', + image: 'https://parseplatform.org/img/ios.svg', guides: [ { - name: "iOS Guide", - link: "https://docs.parseplatform.org/ios/guide/", + name: 'iOS Guide', + link: 'https://docs.parseplatform.org/ios/guide/', }, { - name: "macOS Guide", - link: "https://docs.parseplatform.org/macos/guide/", + name: 'macOS Guide', + link: 'https://docs.parseplatform.org/macos/guide/', }, ], - modules: [{ name: "Live Query", link: "https://github.com/parse-community/ParseLiveQuery-iOS-OSX" }], + modules: [ + { name: 'Live Query', link: 'https://github.com/parse-community/ParseLiveQuery-iOS-OSX' }, + ], }, - "Parse-SDK-Android": { - image: "https://parseplatform.org/img/android.svg", - name: "Android", - guide: "https://docs.parseplatform.org/android/guide/", + 'Parse-SDK-Android': { + image: 'https://parseplatform.org/img/android.svg', + name: 'Android', + guide: 'https://docs.parseplatform.org/android/guide/', modules: [ - { name: "Parse UI", link: "https://github.com/parse-community/ParseUI-Android" }, - { name: "Live Query", link: "https://github.com/parse-community/ParseLiveQuery-Android" }, + { name: 'Parse UI', link: 'https://github.com/parse-community/ParseUI-Android' }, + { name: 'Live Query', link: 'https://github.com/parse-community/ParseLiveQuery-Android' }, ], }, - "Parse-SDK-JS": { - image: "https://parseplatform.org/img/javascript.svg", - guide: "https://docs.parseplatform.org/js/guide/", - name: "JavaScript", + 'Parse-SDK-JS': { + image: 'https://parseplatform.org/img/javascript.svg', + guide: 'https://docs.parseplatform.org/js/guide/', + name: 'JavaScript', }, - "Parse-Swift": { - image: "https://parseplatform.org/img/swiftColour.svg", - guide: "https://github.com/parse-community/Parse-Swift#usage-guide", - name: "Swift", + 'Parse-Swift': { + image: 'https://parseplatform.org/img/swiftColour.svg', + guide: 'https://github.com/parse-community/Parse-Swift#usage-guide', + name: 'Swift', }, - "Parse-SDK-Flutter": [ + 'Parse-SDK-Flutter': [ { - image: "https://parseplatform.org/img/flutter.svg", - guide: "https://docs.parseplatform.org/flutter/guide/", - api: "https://parseplatform.org/Parse-SDK-Flutter/flutter/flutter_parse_sdk_flutter/flutter_parse_sdk_flutter-library.html", - name: "Flutter", + image: 'https://parseplatform.org/img/flutter.svg', + guide: 'https://docs.parseplatform.org/flutter/guide/', + api: + 'https://parseplatform.org/Parse-SDK-Flutter/flutter/flutter_parse_sdk_flutter/flutter_parse_sdk_flutter-library.html', + name: 'Flutter', }, { - image: "https://parseplatform.org/img/dart.svg", - guide: "https://docs.parseplatform.org/dart/guide/", - api: "https://parseplatform.org/Parse-SDK-Flutter/flutter/flutter_parse_sdk_flutter/flutter_parse_sdk_flutter-library.html", - name: "Dart", + image: 'https://parseplatform.org/img/dart.svg', + guide: 'https://docs.parseplatform.org/dart/guide/', + api: + 'https://parseplatform.org/Parse-SDK-Flutter/flutter/flutter_parse_sdk_flutter/flutter_parse_sdk_flutter-library.html', + name: 'Dart', }, ], - "parse-php-sdk": { - image: "https://parseplatform.org/img/php.svg", - guide: "https://docs.parseplatform.org/php/guide/", - api: "https://parseplatform.org/parse-php-sdk/", - name: "PHP", + 'parse-php-sdk': { + image: 'https://parseplatform.org/img/php.svg', + guide: 'https://docs.parseplatform.org/php/guide/', + api: 'https://parseplatform.org/parse-php-sdk/', + name: 'PHP', }, - "Parse-SDK-dotNET": [ + 'Parse-SDK-dotNET': [ { - image: "https://parseplatform.org/img/net.svg", - guide: "https://docs.parseplatform.org/dotnet/guide/", - name: ".NET + Xaramin", + image: 'https://parseplatform.org/img/net.svg', + guide: 'https://docs.parseplatform.org/dotnet/guide/', + name: '.NET + Xaramin', }, { - image: "https://parseplatform.org/img/unity.svg", - guide: "https://docs.parseplatform.org/unity/guide/", - name: "Unity", + image: 'https://parseplatform.org/img/unity.svg', + guide: 'https://docs.parseplatform.org/unity/guide/', + name: 'Unity', }, ], - "Parse-SDK-Arduino": { - image: "https://parseplatform.org/img/arduino.svg", - guide: "https://docs.parseplatform.org/arduino/guide/", - name: "Arduino", + 'Parse-SDK-Arduino': { + image: 'https://parseplatform.org/img/arduino.svg', + guide: 'https://docs.parseplatform.org/arduino/guide/', + name: 'Arduino', }, - "parse-embedded-sdks": { - image: "https://parseplatform.org/img/c.svg", - guide: "https://docs.parseplatform.org/embedded_c/guide/", - name: "Embedded C", + 'parse-embedded-sdks': { + image: 'https://parseplatform.org/img/c.svg', + guide: 'https://docs.parseplatform.org/embedded_c/guide/', + name: 'Embedded C', }, }; const additionalMeta = [ { - name: "Cloud Code", - image: "https://parseplatform.org/img/cloudcode.svg", - guide: "https://docs.parseplatform.org/cloudcode/guide/", + name: 'Cloud Code', + image: 'https://parseplatform.org/img/cloudcode.svg', + guide: 'https://docs.parseplatform.org/cloudcode/guide/', + other: [ + { title: 'Defined Schemas', link: 'https://docs.parseplatform.org/defined-schema/guide/' }, + ], }, { - name: "REST API", - image: "https://parseplatform.org/img/rest.svg", - guide: "https://docs.parseplatform.org/rest/guide/", + name: 'REST API', + image: 'https://parseplatform.org/img/rest.svg', + guide: 'https://docs.parseplatform.org/rest/guide/', }, { - name: "GraphQL API", - image: "https://parseplatform.org/img/graphql.svg", - guide: "https://docs.parseplatform.org/graphql/guide/", + name: 'GraphQL API', + image: 'https://parseplatform.org/img/graphql.svg', + guide: 'https://docs.parseplatform.org/graphql/guide/', }, ]; @@ -113,19 +120,23 @@ jQuery(function ($) { } for (const metaData of Array.isArray(meta) ? meta : [meta]) { const formattedTitle = title - .split("-") - .map((string) => string.charAt(0).toUpperCase() + string.slice(1)) - .join(" "); + .split('-') + .map(string => string.charAt(0).toUpperCase() + string.slice(1)) + .join(' '); const guideLink = metaData.guides ? ` ` : ` - + @@ -135,7 +146,9 @@ jQuery(function ($) { ` : ``; @@ -173,11 +186,20 @@ jQuery(function ($) { `; - $(".repoRow").append(text); + $('.repoRow').append(text); } } for (const row of additionalMeta) { + const additonal = (row.other || []) + .map( + other => ` + + ` + ) + .join(''); const text = `
@@ -189,13 +211,16 @@ jQuery(function ($) {

Guide

-
`; - $(".repoRow").append(text); + ${additonal} +
+
+ `; + $('.repoRow').append(text); } - $(".expandableRepoLink").on("click", function () { + $('.expandableRepoLink').on('click', function () { const clicked = $(this); - $(".expandableRepoLink").not(clicked).removeClass("expanded"); - clicked.toggleClass("expanded"); + $('.expandableRepoLink').not(clicked).removeClass('expanded'); + clicked.toggleClass('expanded'); }); }); From 2d2ad60466d43c913ee5a7b1f4706039155de1f6 Mon Sep 17 00:00:00 2001 From: dblythy Date: Mon, 12 Jun 2023 23:00:00 +1000 Subject: [PATCH 5/6] remove jquery --- _includes/head.html | 3 +-- js/links.js | 17 ++++++++--------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/_includes/head.html b/_includes/head.html index 26178e9ed..eaca647f6 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -23,14 +23,13 @@ - - + diff --git a/js/links.js b/js/links.js index 857579e1a..9e94293b1 100644 --- a/js/links.js +++ b/js/links.js @@ -104,12 +104,13 @@ const additionalMeta = [ }, ]; -jQuery(function ($) { +document.addEventListener("DOMContentLoaded", () => { if (!gitJson) { return; } gitJson = gitJson.sort((a, b) => b.stargazers_count - a.stargazers_count); const formatNumber = new Intl.NumberFormat().format; + const repoRow = document.querySelector('.repoRow'); for (const git of gitJson) { const title = git.name; const stars = parseInt(git.stargazers_count); @@ -186,7 +187,7 @@ jQuery(function ($) { `; - $('.repoRow').append(text); + repoRow.insertAdjacentHTML('beforeend', text); } } @@ -215,12 +216,10 @@ jQuery(function ($) {
`; - $('.repoRow').append(text); + repoRow.insertAdjacentHTML('beforeend', text); + } + const expandButtons = document.querySelectorAll('.expandableRepoLink') + for (const button of expandButtons) { + button.addEventListener('click', () => button.classList.toggle('expanded')); } - - $('.expandableRepoLink').on('click', function () { - const clicked = $(this); - $('.expandableRepoLink').not(clicked).removeClass('expanded'); - clicked.toggleClass('expanded'); - }); }); From 23dfa778ed8087ece3db26551bb0808104293225 Mon Sep 17 00:00:00 2001 From: dblythy Date: Tue, 13 Jun 2023 14:41:04 +1000 Subject: [PATCH 6/6] remove links --- _includes/head.html | 3 +- js/links.js | 225 -------------------------------------------- 2 files changed, 1 insertion(+), 227 deletions(-) delete mode 100644 js/links.js diff --git a/_includes/head.html b/_includes/head.html index eaca647f6..8859ffdd7 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -28,8 +28,7 @@ if (window.location.protocol !== "https:" && window.location.hostname !== "127.0.0.1") window.location.protocol = "https:"; // force https var gitJson = {{ site.github.public_repositories | jsonify }}; - - + diff --git a/js/links.js b/js/links.js deleted file mode 100644 index 9e94293b1..000000000 --- a/js/links.js +++ /dev/null @@ -1,225 +0,0 @@ -const links = { - 'parse-server': { - image: 'https://parseplatform.org/img/cloudcode.svg', - }, - 'Parse-SDK-iOS-OSX': { - name: 'Objective-C', - image: 'https://parseplatform.org/img/ios.svg', - guides: [ - { - name: 'iOS Guide', - link: 'https://docs.parseplatform.org/ios/guide/', - }, - { - name: 'macOS Guide', - link: 'https://docs.parseplatform.org/macos/guide/', - }, - ], - modules: [ - { name: 'Live Query', link: 'https://github.com/parse-community/ParseLiveQuery-iOS-OSX' }, - ], - }, - 'Parse-SDK-Android': { - image: 'https://parseplatform.org/img/android.svg', - name: 'Android', - guide: 'https://docs.parseplatform.org/android/guide/', - modules: [ - { name: 'Parse UI', link: 'https://github.com/parse-community/ParseUI-Android' }, - { name: 'Live Query', link: 'https://github.com/parse-community/ParseLiveQuery-Android' }, - ], - }, - 'Parse-SDK-JS': { - image: 'https://parseplatform.org/img/javascript.svg', - guide: 'https://docs.parseplatform.org/js/guide/', - name: 'JavaScript', - }, - 'Parse-Swift': { - image: 'https://parseplatform.org/img/swiftColour.svg', - guide: 'https://github.com/parse-community/Parse-Swift#usage-guide', - name: 'Swift', - }, - 'Parse-SDK-Flutter': [ - { - image: 'https://parseplatform.org/img/flutter.svg', - guide: 'https://docs.parseplatform.org/flutter/guide/', - api: - 'https://parseplatform.org/Parse-SDK-Flutter/flutter/flutter_parse_sdk_flutter/flutter_parse_sdk_flutter-library.html', - name: 'Flutter', - }, - { - image: 'https://parseplatform.org/img/dart.svg', - guide: 'https://docs.parseplatform.org/dart/guide/', - api: - 'https://parseplatform.org/Parse-SDK-Flutter/flutter/flutter_parse_sdk_flutter/flutter_parse_sdk_flutter-library.html', - name: 'Dart', - }, - ], - 'parse-php-sdk': { - image: 'https://parseplatform.org/img/php.svg', - guide: 'https://docs.parseplatform.org/php/guide/', - api: 'https://parseplatform.org/parse-php-sdk/', - name: 'PHP', - }, - 'Parse-SDK-dotNET': [ - { - image: 'https://parseplatform.org/img/net.svg', - guide: 'https://docs.parseplatform.org/dotnet/guide/', - name: '.NET + Xaramin', - }, - { - image: 'https://parseplatform.org/img/unity.svg', - guide: 'https://docs.parseplatform.org/unity/guide/', - name: 'Unity', - }, - ], - 'Parse-SDK-Arduino': { - image: 'https://parseplatform.org/img/arduino.svg', - guide: 'https://docs.parseplatform.org/arduino/guide/', - name: 'Arduino', - }, - 'parse-embedded-sdks': { - image: 'https://parseplatform.org/img/c.svg', - guide: 'https://docs.parseplatform.org/embedded_c/guide/', - name: 'Embedded C', - }, -}; -const additionalMeta = [ - { - name: 'Cloud Code', - image: 'https://parseplatform.org/img/cloudcode.svg', - guide: 'https://docs.parseplatform.org/cloudcode/guide/', - other: [ - { title: 'Defined Schemas', link: 'https://docs.parseplatform.org/defined-schema/guide/' }, - ], - }, - { - name: 'REST API', - image: 'https://parseplatform.org/img/rest.svg', - guide: 'https://docs.parseplatform.org/rest/guide/', - }, - { - name: 'GraphQL API', - image: 'https://parseplatform.org/img/graphql.svg', - guide: 'https://docs.parseplatform.org/graphql/guide/', - }, -]; - -document.addEventListener("DOMContentLoaded", () => { - if (!gitJson) { - return; - } - gitJson = gitJson.sort((a, b) => b.stargazers_count - a.stargazers_count); - const formatNumber = new Intl.NumberFormat().format; - const repoRow = document.querySelector('.repoRow'); - for (const git of gitJson) { - const title = git.name; - const stars = parseInt(git.stargazers_count); - const forks = parseInt(git.forks_count); - const meta = links[title]; - if (!meta) { - continue; - } - for (const metaData of Array.isArray(meta) ? meta : [meta]) { - const formattedTitle = title - .split('-') - .map(string => string.charAt(0).toUpperCase() + string.slice(1)) - .join(' '); - const guideLink = metaData.guides - ? ` - ` - : ` - - - `; - const modules = metaData.modules - ? ` - ` - : ``; - const text = ` -
-
- -

${metaData.name || formattedTitle}

-

- - - ${formatNumber(stars)} - - - - ${formatNumber(forks)} - -

-
- ${guideLink} - - - - - - - ${modules} - -
`; - repoRow.insertAdjacentHTML('beforeend', text); - } - } - - for (const row of additionalMeta) { - const additonal = (row.other || []) - .map( - other => ` - - ` - ) - .join(''); - const text = ` -
-
- -

${row.name}

-
- - - - ${additonal} -
-
-
`; - repoRow.insertAdjacentHTML('beforeend', text); - } - const expandButtons = document.querySelectorAll('.expandableRepoLink') - for (const button of expandButtons) { - button.addEventListener('click', () => button.classList.toggle('expanded')); - } -});