mirror of
https://github.com/excalidraw/excalidraw-libraries.git
synced 2026-05-17 13:30:41 +00:00
fix: instruction link and move consts outside loop (#483)
* fix: instruction link to updated section * refactor: put consts outside of loop
This commit is contained in:
+1
-1
@@ -120,7 +120,7 @@
|
||||
<p>
|
||||
Follow the
|
||||
<a
|
||||
href="https://github.com/excalidraw/excalidraw-libs#add-your-own-library-to-the-list"
|
||||
href="https://github.com/excalidraw/excalidraw-libs#create-your-own-library"
|
||||
>instructions</a
|
||||
>
|
||||
if you want to <strong>add your own library</strong> into this list.
|
||||
|
||||
@@ -210,6 +210,12 @@ const populateLibraryList = (filterQuery = "") => {
|
||||
);
|
||||
}
|
||||
const template = document.getElementById("template");
|
||||
const searchParams = new URLSearchParams(location.search);
|
||||
const referrer = searchParams.get("referrer") || "https://excalidraw.com";
|
||||
const appName = getAppName(referrer);
|
||||
const target = decodeURIComponent(searchParams.get("target") || "_blank");
|
||||
const useHash = searchParams.get("useHash");
|
||||
const csrfToken = searchParams.get("token");
|
||||
for (let library of libraries) {
|
||||
const div = document.createElement("div");
|
||||
div.classList.add("library");
|
||||
@@ -235,15 +241,7 @@ const populateLibraryList = (filterQuery = "") => {
|
||||
} else {
|
||||
inner = inner.replace('<p class="updated">Updated: {updated}</p>', "");
|
||||
}
|
||||
|
||||
const searchParams = new URLSearchParams(location.search);
|
||||
const referrer = searchParams.get("referrer") || "https://excalidraw.com";
|
||||
|
||||
inner = inner.replace(/\{appName\}/g, getAppName(referrer));
|
||||
|
||||
const target = decodeURIComponent(searchParams.get("target") || "_blank");
|
||||
const useHash = searchParams.get("useHash");
|
||||
const csrfToken = searchParams.get("token");
|
||||
inner = inner.replace(/\{appName\}/g, appName);
|
||||
const libraryUrl = encodeURIComponent(`${location.origin}/${source}`);
|
||||
inner = inner.replace(
|
||||
"{addToLib}",
|
||||
|
||||
@@ -15,9 +15,9 @@ ansi-styles@^4.1.0:
|
||||
color-convert "^2.0.1"
|
||||
|
||||
async@^2.6.2:
|
||||
version "2.6.3"
|
||||
resolved "https://registry.yarnpkg.com/async/-/async-2.6.3.tgz#d72625e2344a3656e3a3ad4fa749fa83299d82ff"
|
||||
integrity sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==
|
||||
version "2.6.4"
|
||||
resolved "https://registry.yarnpkg.com/async/-/async-2.6.4.tgz#706b7ff6084664cd7eae713f6f965433b5504221"
|
||||
integrity sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==
|
||||
dependencies:
|
||||
lodash "^4.17.14"
|
||||
|
||||
@@ -64,7 +64,7 @@ colors@>=0.6.0:
|
||||
corser@^2.0.1:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/corser/-/corser-2.0.1.tgz#8eda252ecaab5840dcd975ceb90d9370c819ff87"
|
||||
integrity sha1-jtolLsqrWEDc2XXOuQ2TcMgZ/4c=
|
||||
integrity sha512-utCYNzRSQIZNPIcGZdQc92UVJYAhtGAteCFg0yRaFm8f0P+CPtyGyHXJcGXnffjCybUCEx3FQ2G7U3/o9eIkVQ==
|
||||
|
||||
debug@^3.1.1:
|
||||
version "3.2.7"
|
||||
@@ -79,9 +79,9 @@ eventemitter3@^4.0.0:
|
||||
integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==
|
||||
|
||||
follow-redirects@^1.0.0:
|
||||
version "1.14.9"
|
||||
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.9.tgz#dd4ea157de7bfaf9ea9b3fbd85aa16951f78d8d7"
|
||||
integrity sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w==
|
||||
version "1.15.1"
|
||||
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.1.tgz#0ca6a452306c9b276e4d3127483e29575e207ad5"
|
||||
integrity sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA==
|
||||
|
||||
function-bind@^1.1.1:
|
||||
version "1.1.1"
|
||||
@@ -203,9 +203,9 @@ node-static@0.7.11:
|
||||
optimist ">=0.3.4"
|
||||
|
||||
object-inspect@^1.9.0:
|
||||
version "1.12.0"
|
||||
resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.0.tgz#6e2c120e868fd1fd18cb4f18c31741d0d6e776f0"
|
||||
integrity sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g==
|
||||
version "1.12.2"
|
||||
resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.2.tgz#c0641f26394532f28ab8d796ab954e43c009a8ea"
|
||||
integrity sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==
|
||||
|
||||
opener@^1.5.1:
|
||||
version "1.5.2"
|
||||
|
||||
Reference in New Issue
Block a user