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
54439c83
Commit
54439c83
authored
Dec 08, 2015
by
Piotr Mitros
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PR
parent
b4d9d42a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
12 deletions
+24
-12
completionxblock_mark.png
+0
-0
completionxblock_undo.png
+0
-0
done/done.py
+1
-0
done/static/css/done.css
+17
-0
done/static/js/src/done.js
+6
-12
No files found.
completionxblock_mark.png
View replaced file @
b4d9d42a
View file @
54439c83
3.33 KB
|
W:
|
H:
3.37 KB
|
W:
|
H:
2-up
Swipe
Onion skin
completionxblock_undo.png
View replaced file @
b4d9d42a
View file @
54439c83
1.47 KB
|
W:
|
H:
2.24 KB
|
W:
|
H:
2-up
Swipe
Onion skin
done/done.py
View file @
54439c83
...
@@ -113,6 +113,7 @@ class DoneXBlock(XBlock):
...
@@ -113,6 +113,7 @@ class DoneXBlock(XBlock):
"""<vertical_demo>
"""<vertical_demo>
<done align="left"> </done>
<done align="left"> </done>
<done align="right"> </done>
<done align="right"> </done>
<done align="center"> </done>
</vertical_demo>
</vertical_demo>
"""
),
"""
),
]
]
...
...
done/static/css/done.css
View file @
54439c83
...
@@ -78,4 +78,20 @@
...
@@ -78,4 +78,20 @@
.done_onoffswitch-checkbox
:checked
+
.done_onoffswitch-label
.done_onoffswitch-switch
{
.done_onoffswitch-checkbox
:checked
+
.done_onoffswitch-label
.done_onoffswitch-switch
{
right
:
0px
;
right
:
0px
;
}
.done-checked
{
background-color
:
#018801
;
}
.done-unchecked
{
background-color
:
#FFFFFF
;
}
.done_grow
{
flex-grow
:
1
;
}
.done_nogrow
{
flex-grow
:
0
;
}
}
\ No newline at end of file
done/static/js/src/done.js
View file @
54439c83
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
if
(
typeof
Logger
===
'undefined'
)
{
if
(
typeof
Logger
===
'undefined'
)
{
var
Logger
=
{
var
Logger
=
{
log
:
function
(
a
,
b
)
{
return
;
}
log
:
function
(
a
,
b
)
{
return
;
}
}
}
;
}
}
function
update_knob
(
element
,
data
)
{
function
update_knob
(
element
,
data
)
{
...
@@ -19,19 +19,13 @@ function update_knob(element, data) {
...
@@ -19,19 +19,13 @@ function update_knob(element, data) {
function
DoneXBlock
(
runtime
,
element
,
data
)
{
function
DoneXBlock
(
runtime
,
element
,
data
)
{
$
(
'.done_onoffswitch-checkbox'
,
element
).
prop
(
"checked"
,
data
.
state
);
$
(
'.done_onoffswitch-checkbox'
,
element
).
prop
(
"checked"
,
data
.
state
);
var
grow_left
=
1
;
if
(
data
.
align
!=
"right"
)
{
var
grow_right
=
1
;
$
(
'.done_right_spacer'
,
element
).
addClass
(
"done_grow"
);
if
(
data
.
align
==
"left"
)
{
grow_left
=
0
;
}
}
if
(
data
.
align
==
"righ
t"
)
{
if
(
data
.
align
!=
"lef
t"
)
{
grow_right
=
0
;
$
(
'.done_left_spacer'
,
element
).
addClass
(
"done_grow"
)
;
}
}
$
(
'.done_left_spacer'
,
element
).
css
(
"flex-grow"
,
grow_left
.
toString
());
$
(
'.done_right_spacer'
,
element
).
css
(
"flex-grow"
,
grow_right
.
toString
());
update_knob
(
element
,
data
);
update_knob
(
element
,
data
);
var
handlerUrl
=
runtime
.
handlerUrl
(
element
,
'toggle_button'
);
var
handlerUrl
=
runtime
.
handlerUrl
(
element
,
'toggle_button'
);
...
@@ -42,7 +36,7 @@ function DoneXBlock(runtime, element, data) {
...
@@ -42,7 +36,7 @@ function DoneXBlock(runtime, element, data) {
$
.
ajax
({
$
.
ajax
({
type
:
"POST"
,
type
:
"POST"
,
url
:
handlerUrl
,
url
:
handlerUrl
,
data
:
JSON
.
stringify
({
'done'
:
checked
})
,
data
:
JSON
.
stringify
({
'done'
:
checked
})
});
});
Logger
.
log
(
"edx.done.toggle"
,
{
'done'
:
checked
});
Logger
.
log
(
"edx.done.toggle"
,
{
'done'
:
checked
});
update_knob
(
element
,
data
);
update_knob
(
element
,
data
);
...
...
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