-
Notifications
You must be signed in to change notification settings - Fork 14
Checkbox magic #230
Checkbox magic #230
Conversation
|
Thanks! Do you have a build published in somewhere? If not, do not stress it, I'll try it local later today. |
package.json
Outdated
| "jquery": "^2.1.3", | ||
| "js-cookie": "^2.0.4", | ||
| "json5": "^0.4.0", | ||
| "markdown-it-checkbox": "^1.1.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Conventions in this repo are "build-deps" => development dependencies and "Client-deps" => dependencies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oooh, so I should save-dev on this one. Should have spotted that. Thanks!
|
If we can merge this before the weekend, that would be great :) |
styles/lesson.less
Outdated
| ul, ol { | ||
| padding: 0; | ||
| margin: 0 0 20px 0; | ||
| margin: 0 0 20px 20px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Jeg har lyst å foreslå noen endringer. Jeg synes at listene skal ligne litt mer på det som er i dag enn det @agnetedjupvik foreslår. Så hvis vi dropper denne endringen...
styles/lesson.less
Outdated
| } | ||
| li { | ||
| list-style: none; | ||
| list-style: circle; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...og dropper denne endringen...
| list-style: circle; | ||
| padding-top: 10px; | ||
| padding-bottom: 10px; | ||
| margin-left: -30px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(denne linjen kan vi godt fjerne, for den blir jo "overskrevet" av neste linje)
| // check box for list items | ||
| li:before { | ||
| content: " "; | ||
| border-radius: 8px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...øke denne, f.eks. til 20px, slik at det blir en sirkel...
| content: " "; | ||
| border-radius: 8px; | ||
| border: 3px solid #ABDBEA; | ||
| padding: 10px 10px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... gjør sirkelen litt mindre, f.eks. padding: 8px (vi trenger tallet bare 1 gang)...
| li:before { | ||
| content: " "; | ||
| border-radius: 8px; | ||
| border: 3px solid #ABDBEA; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... beholde denne...
| padding-bottom: 10px; | ||
| margin-left: -30px; | ||
| // adjust all elements inside a list item | ||
| margin-left: 45px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...beholde denne...
| } | ||
| // check box for list items | ||
| li:before { | ||
| content: " "; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...beholde denne...
styles/lesson.less
Outdated
| margin-top: 10px; | ||
| } | ||
|
|
||
| label { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Når det gjelder denne, hadde det ikke vært lurt å legge denne inni en klasse, slik at det ikke ødelegger for bootstrap sin listevisning evt andre steder? Det kunne jo være innenfor .check, .activity, .save?
styles/lesson.less
Outdated
|
|
||
| label { | ||
| font-weight: normal; | ||
| margin-left: 6px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Synes ikke disse checkboxene er så veldig fine. Hva om vi heller gjør noe slikt?
input[type="checkbox"] {
opacity: 0;
filter: alpha(opacity=0);
}
input[type="checkbox"] + label {
position: relative;
margin-left: 10px;
font-weight: normal;
}
input[type="checkbox"] + label:before {
content: '';
display: inline-block;
visibility: visible;
left: 0;
width: 1em;
height: 1em;
margin: 0 0.8em -0.1em -1em;
line-height: 0.6;
text-align: center;
/* Put checkbox styles here: */
border: 3px solid #ABDBEA;
}
input[type="checkbox"]:checked + label:before {
content: '✔';
line-height: 0.8em;
text-align: center;
}
(fant dette på nettet, og tweaket littegrann, så kan sikkert gjøres bedre, men nå ligner det ihvertfall litt mer på listevisningen)
|
En ting som er litt dumt, er at det ser ut som om markdown-it-checkbox (tror det er denne) ikke parser innholdet helt riktig. For at alt skal komme inni Jeg tror det er dette som gjør at innholdet for hele checkbox-label (list item) ikke blir indendert riktig. Det er mulig at mcecot/markdown-it-checkbox#5 løser dette, men da må den gjøres (evt at man forker markdown-it-checkbox og fikser det selv)... |
|
Hi! As @NorwegianKiwi says, the style is a step back: What about another solution: I see you plan to persistent store the state. For that you need to implement some click event handler. Then, the same UI can be achieved by using similar styling as @NorwegianKiwi suggest. Edit: To be clear, keeping the |
|
So now I have a .checked class, and I'm thinking that I'll use that for managing the subtask state in codeclub-viewer. Why Travis fails and some links appear broken, though, is a mystery to me... I see that we've had problems with it in earlier commits and it has been solved in later commits for no apparent reason. |
We use PhantomJS to generate PDFs. PhantomJS crashes sometimes due to a memory leak. The crash is not resolved gracefully. With headless Chrome in the making, the PDF generation will be better in near future (hopefully). |
|
Doesn't look the plugin works well will list points which are several lines. code [ ] Prøv å klikk på de blå klossene midt på skjermen. For eksempel,
om du klikker påAs you can see in the picture, only the first line of the check point are contained in the Link to lesson: https://raw.githubusercontent.com/Skagevang/oppgaver/076ea3184ed162886c5b59598efdd3c6d409b8e1/src/scratch/astrokatt/astrokatt.md |
|
Yup, noticed it. I made a fork of the plugin and will try to see what I can do to fix it in the next couple of days. Don't hesitate to bring in any ideas for that :) |
|
Also check the other checkbox plugins, there are two others.
|
|
We found a plugin which adds all text into labels in order for it to sound nicer using text-to-speech tools. However, we found out that it wrapped everything in so many other tags that it really doesn't give any value to the site at all. So, I'll add the clickable label thing as an issue in my fork, which can be solved later on, but is not required for this to be merged. |
|
Still issue with list points over several lines, list points should be contained in a parent node. For example [ ] List point
over several linesshould become something like <li>
<input type=checkbox>
<p>list point</p>
<p>over several lines</p>
</li>but currently renders to <p><input type=checkbox>list point</p>
<p>over several lines</p>Which gives instead of This makes it hard to distinct "just text" vs "task". |
|
Tip: Perhaps correct alignment here as was done for kodeklubben/codeclub-viewer#267 ? |
| display: none; | ||
| } | ||
|
|
||
| input[type="checkbox"] + label { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious, what does + label and + label::before do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<label> which is sibling to <input type="checkbox">.
https://stackoverflow.com/questions/1139763/what-does-the-plus-sign-css-selector-mean
|
Thanks |




This uses markdown-it-checkbox to support checkboxes for each subtask in a lesson, as adressed in issue #218 in codeclub-viewer.
The checkboxes here are dumb, and they only have a 1-indexed ID given by markdown-it-checkbox. They can become unique identificators by combining them with the task name (or path).
Merging this now, while checkboxes aren't in use in the oppgaver repo yet, will change the appearance of regular list items into actual lists, not fake checkboxes. Checkboxes can then be added into oppgaver by using
[ ]instead of+.