Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
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
edx-platform
Commits
2097b693
Commit
2097b693
authored
Feb 05, 2013
by
Arthur Barrett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added button to show/hide guided notes and discussions.
parent
45e4c0cf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
1 deletions
+28
-1
common/lib/xmodule/xmodule/css/annotatable/display.scss
+15
-0
common/lib/xmodule/xmodule/js/src/annotatable/display.coffee
+12
-1
lms/templates/annotatable.html
+1
-0
No files found.
common/lib/xmodule/xmodule/css/annotatable/display.scss
View file @
2097b693
...
@@ -14,12 +14,24 @@
...
@@ -14,12 +14,24 @@
}
}
}
}
.annotatable-toggle
{
display
:
block
;
font-size
:
$body-font-size
;
}
span
.annotatable
{
span
.annotatable
{
color
:
$blue
;
color
:
$blue
;
cursor
:
pointer
;
cursor
:
pointer
;
.annotatable-icon
{
.annotatable-icon
{
margin
:
auto
2px
auto
4px
;
margin
:
auto
2px
auto
4px
;
}
}
&
.hide
{
cursor
:
none
;
color
:
inherit
;
.annotatable-icon
{
display
:
none
;
}
}
}
}
.annotatable-icon
{
.annotatable-icon
{
...
@@ -64,4 +76,7 @@ span.annotatable {
...
@@ -64,4 +76,7 @@ span.annotatable {
&
.opaque
{
&
.opaque
{
opacity
:
0
.4
;
opacity
:
0
.4
;
}
}
&
.hide
{
display
:
none
;
}
}
}
common/lib/xmodule/xmodule/js/src/annotatable/display.coffee
View file @
2097b693
...
@@ -4,6 +4,7 @@ class @Annotatable
...
@@ -4,6 +4,7 @@ class @Annotatable
wrapperSelector
:
'.annotatable-wrapper'
wrapperSelector
:
'.annotatable-wrapper'
spanSelector
:
'span.annotatable[data-span-id]'
spanSelector
:
'span.annotatable[data-span-id]'
discussionSelector
:
'.annotatable-discussion[data-discussion-id]'
discussionSelector
:
'.annotatable-discussion[data-discussion-id]'
toggleSelector
:
'.annotatable-toggle'
constructor
:
(
el
)
->
constructor
:
(
el
)
->
console
.
log
'loaded Annotatable'
if
@
_debug
console
.
log
'loaded Annotatable'
if
@
_debug
...
@@ -11,10 +12,14 @@ class @Annotatable
...
@@ -11,10 +12,14 @@ class @Annotatable
@
init
()
@
init
()
init
:
()
->
init
:
()
->
@
hideAnnotations
=
false
@
spandata
=
{}
@
loadSpanData
()
@
loadSpanData
()
@
initEvents
()
@
initEvents
()
initEvents
:
()
->
initEvents
:
()
->
$
(
@
toggleSelector
,
@
el
).
bind
(
'click'
,
@
_bind
@
onClickToggleAnnotations
)
$
(
@
wrapperSelector
,
@
el
).
delegate
(
@
spanSelector
,
{
$
(
@
wrapperSelector
,
@
el
).
delegate
(
@
spanSelector
,
{
'click'
:
@
_bind
@
onSpanEvent
@
onClickSpan
'click'
:
@
_bind
@
onSpanEvent
@
onClickSpan
'mouseenter'
:
@
_bind
@
onSpanEvent
@
onEnterSpan
'mouseenter'
:
@
_bind
@
onSpanEvent
@
onEnterSpan
...
@@ -30,6 +35,11 @@ class @Annotatable
...
@@ -30,6 +35,11 @@ class @Annotatable
getDiscussionEl
:
(
discussion_id
)
->
getDiscussionEl
:
(
discussion_id
)
->
$
(
@
discussionSelector
,
@
el
).
filter
(
'[data-discussion-id="'
+
discussion_id
+
'"]'
)
$
(
@
discussionSelector
,
@
el
).
filter
(
'[data-discussion-id="'
+
discussion_id
+
'"]'
)
onClickToggleAnnotations
:
(
e
)
->
@
hideAnnotations
=
!
@
hideAnnotations
$
(
@
spanSelector
,
@
el
).
add
(
@
discussionSelector
,
@
el
).
toggleClass
(
'hide'
,
@
hideAnnotations
)
$
(
@
toggleSelector
,
@
el
).
text
(
if
@
hideAnnotations
then
'Show Annotations'
else
'Hide Annotations'
)
onSpanEvent
:
(
fn
)
->
onSpanEvent
:
(
fn
)
->
(
e
)
=>
(
e
)
=>
span_el
=
e
.
currentTarget
span_el
=
e
.
currentTarget
...
@@ -44,7 +54,8 @@ class @Annotatable
...
@@ -44,7 +54,8 @@ class @Annotatable
id
:
discussion_id
id
:
discussion_id
el
:
discussion_el
el
:
discussion_el
}
}
fn
.
call
this
,
span
,
discussion
if
!
@
hideAnnotations
fn
.
call
this
,
span
,
discussion
onClickSpan
:
(
span
,
discussion
)
->
onClickSpan
:
(
span
,
discussion
)
->
@
scrollToDiscussion
(
discussion
.
el
)
@
scrollToDiscussion
(
discussion
.
el
)
...
...
lms/templates/annotatable.html
View file @
2097b693
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
<div
class=
"annotatable-title"
>
${display_name}
</div>
<div
class=
"annotatable-title"
>
${display_name}
</div>
% endif
% endif
<div
class=
"annotatable-description"
>
Annotated Reading + Guided Discussion
</div>
<div
class=
"annotatable-description"
>
Annotated Reading + Guided Discussion
</div>
<a
href=
"javascript:void(0)"
class=
"annotatable-toggle"
>
Hide Annotations
</a>
</div>
</div>
<div
class=
"annotatable-content"
>
<div
class=
"annotatable-content"
>
...
...
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