Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
DoneXBlock
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
DoneXBlock
Commits
92e6ae6b
Commit
92e6ae6b
authored
May 29, 2014
by
Piotr Mitros
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Align attribute
parent
612f10fa
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
16 deletions
+34
-16
done/done.py
+14
-1
done/static/css/done.css
+18
-15
done/static/html/done.html
+2
-0
No files found.
done/done.py
View file @
92e6ae6b
...
@@ -20,6 +20,12 @@ class DoneXBlock(XBlock):
...
@@ -20,6 +20,12 @@ class DoneXBlock(XBlock):
default
=
False
default
=
False
)
)
align
=
String
(
scope
=
Scope
.
settings
,
help
=
"Align left/right/center"
,
default
=
"left"
)
def
resource_string
(
self
,
path
):
def
resource_string
(
self
,
path
):
"""Handy helper for getting resources from our kit."""
"""Handy helper for getting resources from our kit."""
data
=
pkg_resources
.
resource_string
(
__name__
,
path
)
data
=
pkg_resources
.
resource_string
(
__name__
,
path
)
...
@@ -48,6 +54,13 @@ class DoneXBlock(XBlock):
...
@@ -48,6 +54,13 @@ class DoneXBlock(XBlock):
#frag.add_javascript_url("//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js")
#frag.add_javascript_url("//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js")
frag
.
add_javascript_url
(
"//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"
)
frag
.
add_javascript_url
(
"//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"
)
frag
.
add_css
(
self
.
resource_string
(
"static/css/done.css"
))
frag
.
add_css
(
self
.
resource_string
(
"static/css/done.css"
))
grow_left
=
1
grow_right
=
1
if
self
.
align
.
lower
()
==
"left"
:
grow_left
=
0
if
self
.
align
.
lower
()
==
"right"
:
grow_right
=
0
frag
.
add_css
(
".done_left_spacer {{ flex-grow:{l}; }} .done_right_spacer {{ flex-grow:{r}; }}"
.
format
(
r
=
grow_right
,
l
=
grow_left
))
frag
.
add_javascript
(
"var done_done = "
+
(
"true"
if
self
.
done
else
"false"
)
+
";"
)
frag
.
add_javascript
(
"var done_done = "
+
(
"true"
if
self
.
done
else
"false"
)
+
";"
)
frag
.
add_javascript
(
self
.
resource_string
(
"static/js/src/done.js"
))
frag
.
add_javascript
(
self
.
resource_string
(
"static/js/src/done.js"
))
frag
.
initialize_js
(
'DoneXBlock'
)
frag
.
initialize_js
(
'DoneXBlock'
)
...
@@ -61,7 +74,7 @@ class DoneXBlock(XBlock):
...
@@ -61,7 +74,7 @@ class DoneXBlock(XBlock):
return
[
return
[
(
"DoneXBlock"
,
(
"DoneXBlock"
,
"""<vertical_demo>
"""<vertical_demo>
<done> </done>
<done
align="left"
> </done>
</vertical_demo>
</vertical_demo>
"""
),
"""
),
]
]
done/static/css/done.css
View file @
92e6ae6b
/* CSS for DoneXBlock */
/* CSS for DoneXBlock */
.done_block
{
.done_block
{
width
:
200px
;
width
:
100%
;
height
:
35px
;
height
:
35px
;
cursor
:
pointer
;
display
:
flex
;
border
:
1px
solid
#0d72a2
;
flex-direction
:
row
;
border-radius
:
3px
;
font-family
:
'Open Sans'
,
Verdana
,
Geneva
,
sans-serif
,
sans-serif
;
font-size
:
13.333333015441895px
;
font-weight
:
bold
;
letter-spacing
:
normal
;
//
padding
:
5
0
-5
0
;
//
padding
:
5
0
-5
0
;
//
margin
:
-5
0
5
0
;
//
margin
:
-5
0
5
0
;
}
}
.wipe
{
.wipe
{
-webkit-transition
:
width
0.2s
;
-webkit-transition
:
width
0.2s
;
transition
:
width
0.2s
;
transition
:
width
0.2s
;
text-align
:
center
;
text-align
:
center
;
vertical-align
:
-10
;
vertical-align
:
-10
;
}
}
.windshield_animated
{
.windshield_animated
{
-webkit-transition
:
background-color
0.4s
,
box-shadow
0.4s
,
color
0.4s
,
text-shadow
0.4s
,
background-image
0.4s
;
-webkit-transition
:
background-color
0.4s
,
box-shadow
0.4s
,
color
0.4s
,
text-shadow
0.4s
,
background-image
0.4s
;
transition
:
background-color
0.4s
,
box-shadow
0.4s
,
color
0.4s
,
text-shadow
0.4s
,
background-image
0.4s
;
transition
:
background-color
0.4s
,
box-shadow
0.4s
,
color
0.4s
,
text-shadow
0.4s
,
background-image
0.4s
;
}
}
.windshield
{
.windshield
{
height
:
100%
;
cursor
:
pointer
;
width
:
200px
;
height
:
100%
;
border
:
1px
solid
#0d72a2
;
border-radius
:
3px
;
font-family
:
'Open Sans'
,
Verdana
,
Geneva
,
sans-serif
,
sans-serif
;
font-size
:
13.333333015441895px
;
font-weight
:
bold
;
letter-spacing
:
normal
;
}
}
.windshield_on
{
//
"Mark
as
complete"
.windshield_on
{
//
"Mark
as
complete"
...
...
done/static/html/done.html
View file @
92e6ae6b
<div
class=
"done_block"
>
<div
class=
"done_block"
>
<div
class=
"done_left_spacer"
>
</div>
<div
class=
"windshield"
>
<div
class=
"windshield"
>
<div
class=
"wipe wipe_off"
>
Undo
</div>
<div
class=
"wipe wipe_off"
>
Undo
</div>
<div
class=
"wiper"
>
<span
class=
"ui-icon ui-icon-circle-plus ui_icon_white"
></span>
</div>
<div
class=
"wiper"
>
<span
class=
"ui-icon ui-icon-circle-plus ui_icon_white"
></span>
</div>
<div
class=
"wipe wipe_on"
>
Mark as complete
</div>
<div
class=
"wipe wipe_on"
>
Mark as complete
</div>
</div>
</div>
<div
class=
"done_right_spacer"
>
</div>
</div>
</div>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment