Skip to content
This repository has been archived by the owner on Jun 18, 2024. It is now read-only.

Commit

Permalink
Make LMS and Studio functionality accessible.
Browse files Browse the repository at this point in the history
  • Loading branch information
itsjeyd committed Nov 25, 2015
1 parent c3a098d commit d2fe045
Show file tree
Hide file tree
Showing 9 changed files with 895 additions and 74 deletions.
289 changes: 267 additions & 22 deletions tests/integration/test_vectordraw.py

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions tests/integration/xml/custom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
vector_properties_label="Custom properties label"
background_url="https://github.com/open-craft/jsinput-vectordraw/raw/master/Notes_and_Examples/2_boxIncline_multiVector/box_on_incline.png"
background_width="20"
background_description="A very informative description"
vectors="{{ vectors }}"
points="{{ points }}"
expected_result="{{ expected_result }}"
Expand Down
43 changes: 36 additions & 7 deletions vectordraw/public/css/vectordraw.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
pointer-events: none; /* prevents cursor from turning into caret when over a label */
}

/* Menu */

.vectordraw_block .menu {
width: 100%;
}
Expand All @@ -41,7 +43,7 @@
font-size: 18px;
}

.vectordraw_block .menu .controls button {
.vectordraw_block .menu button {
border: 1px solid #1f628d;
border-radius: 5px;
margin: 4px 0;
Expand All @@ -53,7 +55,7 @@
text-decoration: none;
}

.vectordraw_block .menu .controls button:hover {
.vectordraw_block .menu button:hover {
background: #c2e0f4;
background-image: -webkit-linear-gradient(top, #c2e0f4, #add5f0);
background-image: -moz-linear-gradient(top, #c2e0f4, #add5f0);
Expand Down Expand Up @@ -85,12 +87,39 @@
margin: 0 0 5px;
}

.vectordraw_block .menu .vector-properties .vector-prop-bold {
font-weight: bold;
.vectordraw_block .menu .vector-properties .vector-prop-list {
display: table;
width: 100%
}

.vectordraw_block .menu .vector-prop-slope {
display: none;
.vectordraw_block .menu .vector-properties .vector-prop-list .row {
display: table-row;
}

.vectordraw_block .menu .vector-properties .vector-prop-list .row .vector-prop-name,
.vectordraw_block .menu .vector-properties .vector-prop-list .row .vector-prop-tail,
.vectordraw_block .menu .vector-properties .vector-prop-list .row .vector-prop-tail-label,
.vectordraw_block .menu .vector-properties .vector-prop-list .row .vector-prop-length,
.vectordraw_block .menu .vector-properties .vector-prop-list .row .vector-prop-length-label,
.vectordraw_block .menu .vector-properties .vector-prop-list .row .vector-prop-angle,
.vectordraw_block .menu .vector-properties .vector-prop-list .row .vector-prop-angle-label,
.vectordraw_block .menu .vector-properties .vector-prop-list .row .vector-prop-slope,
.vectordraw_block .menu .vector-properties .vector-prop-list .row .vector-prop-slope-label,
.vectordraw_block .menu .vector-properties .vector-prop-list .row .vector-prop-update {

This comment has been minimized.

Copy link
@bradenmacdonald

bradenmacdonald Nov 26, 2015

Member

Can you just add another class that these vector-prop-blah elements have in common, so you don't have to define so many rules here? Maybe just give them all the vector-prop class?

display: table-cell;
width: 50%
}

.vectordraw_block .menu .vector-properties .vector-prop-list .row .vector-prop-name,
.vectordraw_block .menu .vector-properties .vector-prop-list .row .vector-prop-tail,
.vectordraw_block .menu .vector-properties .vector-prop-list .row .vector-prop-angle {
padding-right: 5px;
}

.vectordraw_block .menu .vector-properties .vector-prop-list .row select,
.vectordraw_block .menu .vector-properties .vector-prop-list .row input {
float: right;
width: 50%;
}

.vectordraw_block .action button {
Expand All @@ -101,7 +130,7 @@
}

/* Make sure screen-reader content is hidden in the workbench: */
.vectordraw_block .action .sr {
.vectordraw_block .sr {
display: none;
border: 0;
clip: rect(0 0 0 0);
Expand Down
104 changes: 104 additions & 0 deletions vectordraw/public/css/vectordraw_edit.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,107 @@
pointer-events: none; /* prevents cursor from turning into caret when over a label */
}

/* Menu */

.vectordraw_edit_block .menu {
width: 100%;
}

.vectordraw_edit_block .menu .controls {
border-top-left-radius: 5px;
border-top-right-radius: 5px;
border-top: 2px solid #1f628d;
border-left: 2px solid #1f628d;
border-right: 2px solid #1f628d;
padding: 3px;
background-color: #e0e0e0;
font-size: 0;
}

.vectordraw_edit_block .menu .controls select {
width: 160px;
margin-right: 3px;
font-size: 18px;
}

.vectordraw_edit_block .menu button {
border: 1px solid #1f628d;
border-radius: 5px;
margin: 4px 0;
padding: 5px 10px 5px 10px;
box-shadow: 0 1px 3px #666;
background-color: #c2e0f4;
color: #1f628d;
font-size: 14px;
text-decoration: none;
}

.vectordraw_edit_block .menu button:hover {
background: #c2e0f4;
background-image: -webkit-linear-gradient(top, #c2e0f4, #add5f0);
background-image: -moz-linear-gradient(top, #c2e0f4, #add5f0);
background-image: -ms-linear-gradient(top, #c2e0f4, #add5f0);
background-image: -o-linear-gradient(top, #c2e0f4, #add5f0);
background-image: linear-gradient(to bottom, #c2e0f4, #add5f0);
text-decoration: none;
}

.vectordraw_edit_block .menu .vector-properties {
border-top: 2px solid #1f628d;
border-left: 2px solid #1f628d;
border-right: 2px solid #1f628d;
border-bottom: 0px none;
padding: 10px;
font-size: 16px;
line-height: 1.25;
background-color: #f7f7f7;
}

.vectordraw_edit_block .menu .vector-properties h3 {
font-size: 16px;
margin: 0 0 5px;
}

.vectordraw_edit_block .menu .vector-properties .vector-prop-list {
display: table;
width: 100%
}

.vectordraw_edit_block .menu .vector-properties .vector-prop-list .row {
display: table-row;
}

.vectordraw_edit_block .menu .vector-properties .vector-prop-list .row .vector-prop-name,
.vectordraw_edit_block .menu .vector-properties .vector-prop-list .row .vector-prop-tail,
.vectordraw_edit_block .menu .vector-properties .vector-prop-list .row .vector-prop-tail-label,
.vectordraw_edit_block .menu .vector-properties .vector-prop-list .row .vector-prop-length,
.vectordraw_edit_block .menu .vector-properties .vector-prop-list .row .vector-prop-length-label,
.vectordraw_edit_block .menu .vector-properties .vector-prop-list .row .vector-prop-angle,
.vectordraw_edit_block .menu .vector-properties .vector-prop-list .row .vector-prop-angle-label,
.vectordraw_edit_block .menu .vector-properties .vector-prop-list .row .vector-prop-slope,
.vectordraw_edit_block .menu .vector-properties .vector-prop-list .row .vector-prop-slope-label,
.vectordraw_edit_block .menu .vector-properties .vector-prop-list .row .vector-prop-update,
.vectordraw_edit_block .menu .vector-properties .vector-prop-list .row .vector-remove {
display: table-cell;
width: 50%
}

.vectordraw_edit_block .menu .vector-properties .vector-prop-list .row .vector-prop-name,
.vectordraw_edit_block .menu .vector-properties .vector-prop-list .row .vector-prop-tail,
.vectordraw_edit_block .menu .vector-properties .vector-prop-list .row .vector-prop-angle {
padding-right: 5px;
}

.vectordraw_edit_block .menu .vector-properties .vector-prop-list .row select,
.vectordraw_edit_block .menu .vector-properties .vector-prop-list .row input {
float: right;
width: 50%;
}

.vectordraw_edit_block .menu .vector-properties .vector-prop-list .row .vector-remove {
vertical-align: bottom;
}

.vectordraw_edit_block .menu .vector-properties .vector-prop-list .row .vector-remove button {
float: right;
}

This comment has been minimized.

Copy link
@bradenmacdonald

bradenmacdonald Nov 26, 2015

Member

It's not good to have so many CSS rules duplicated. Is there a compelling reason for that?

It would be much nicer if you can just put Studio-specific rules in this file and then add in all the rules using the following code in studio_view:

fragment.add_css_url(self.runtime.local_resource_url(self, 'public/css/vectordraw.css'))
fragment.add_css_url(self.runtime.local_resource_url(self, 'public/css/vectordraw_edit.css'))
Loading

0 comments on commit d2fe045

Please sign in to comment.