Compare commits

..

5 Commits

  1. 21
      LICENSE
  2. 2
      README.md
  3. 18
      card-sort.html

21
LICENSE

@ -1,9 +1,18 @@
This is free and unencumbered software released into the public domain.
MIT No Attribution License
Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.
Copyright (c) 2023 indigane
In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the “Software”), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTBILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
For more information, please refer to <https://unlicense.org/>
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

2
README.md

@ -1,6 +1,6 @@
# Card Sort
Card Sort is a **free** and open-source tool for conducting a virtual card sorting. It was built as a way to **quickly conduct a card sorting online**, without the need to sign up or pay for commercial solutions or self-host an open-source project.
Card Sort is a **free** and open-source tool for conducting a virtual card sorting. It was built as a way to **quickly conduct a card sorting online**, without the need to sign up or subscribe to commercial solutions or self-host an open-source project.
It works best when combined with other tooling. For example you could create a form with instructions, questionnaire and a link to the card sorting. You could also ask the participants to copy the results back into the form.

18
card-sort.html

@ -288,6 +288,7 @@
function createCard(text, categoryGrid) {
const targetGrid = categoryGrid || uncategorizedCardsGrid;
const itemElement = document.importNode(cardTemplate.content.children[0], true);
const cardElement = itemElement.querySelector('.card');
const hasImage = text.match(cardImageRegex);
if (hasImage) {
const [textBefore, imageUrl, textAfter] = text.split(cardImageRegex);
@ -300,7 +301,7 @@
}
const imageElement = document.createElement('img');
imageElement.className = 'card-image';
imageElement.onload = () => uncategorizedCardsGrid.refreshItems().layout();
imageElement.onload = () => targetGrid.refreshItems().layout();
imageElement.src = imageUrl;
cardChildElements.push(imageElement);
if (textAfter.trim()) {
@ -309,11 +310,12 @@
span.appendChild(document.createTextNode(textAfter));
cardChildElements.push(span);
}
itemElement.querySelector('.card').replaceChildren(...cardChildElements);
cardElement.replaceChildren(...cardChildElements);
}
else {
itemElement.querySelector('.card').textContent = text;
cardElement.textContent = text;
}
cardElement.setAttribute('data-text', text);
targetGrid.show(
targetGrid.add([itemElement], {
active: false,
@ -334,6 +336,7 @@
});
if (name) {
titleInput.value = name;
titleInput.disabled = true;
}
else if (settings.allowCategoryEditing === false) {
titleInput.style.opacity = '0';
@ -362,9 +365,12 @@
},
});
categoryGrid.on('dragEnd', function handleDragEnd(data) {
debouncedUpdateData();
categoriesGrid.refreshItems().layout();
});
categoryGrid.on('dragReleaseEnd', function handleDragReleaseEnd(data) {
categoryGrid.synchronize();
debouncedUpdateData();
});
cardGrids.push(categoryGrid);
const cardTexts = data[name] || [];
for (const text of cardTexts) {
@ -389,12 +395,12 @@
}
data[categoryName] = [];
for (const cardElement of categoryElement.querySelectorAll('.card')) {
data[categoryName].push(cardElement.textContent);
data[categoryName].push(cardElement.getAttribute('data-text'));
}
}
data[uncategorizedKey] = [];
for (const cardElement of document.querySelectorAll('.uncategorized-cards .card')) {
data[uncategorizedKey].push(cardElement.textContent);
data[uncategorizedKey].push(cardElement.getAttribute('data-text'));
}
data[settingsFlagsKey] = saveSettings(settings);
}

Loading…
Cancel
Save