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
d9c798dc
Commit
d9c798dc
authored
May 25, 2016
by
Brian Jacobel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix JS load order issues for edxnotes
parent
61353234
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
4 deletions
+26
-4
common/djangoapps/pipeline_mako/templates/static_content.html
+22
-0
common/templates/edxnotes_wrapper.html
+2
-2
lms/templates/edxnotes/toggle_notes.html
+2
-2
No files found.
common/djangoapps/pipeline_mako/templates/static_content.html
View file @
d9c798dc
...
...
@@ -90,6 +90,28 @@ source, template_path = Loader(engine).load_template_source(path)
</script>
</
%
def>
<
%
def
name=
"require_module_async(module_name, class_name)"
>
<script
type=
"text/javascript"
>
(
function
(
require
)
{
%
if
settings
.
REQUIRE_DEBUG
:
require
([
'${module_name | n, js_escaped_string}'
],
function
(
$
{
class_name
|
n
,
decode
.
utf8
})
{
$
{
caller
.
body
()
|
n
,
decode
.
utf8
}
});
%
else
:
##
The
"raw"
parameter
is
specified
to
avoid
the
URL
from
being
further
maninpulated
by
##
static_replace
calls
(
as
woudl
happen
if
require_module
is
used
within
courseware
).
##
Without
specifying
"raw"
,
a
call
to
static_replace
would
result
in
the
MD5
hash
being
##
being
appended
more
than
once
,
causing
the
import
to
fail
in
production
environments
.
require
([
'${staticfiles_storage.url(module_name + ".js") + "?raw" | n, js_escaped_string}'
],
function
()
{
require
([
'${module_name | n, js_escaped_string}'
],
function
(
$
{
class_name
|
n
,
decode
.
utf8
})
{
$
{
caller
.
body
()
|
n
,
decode
.
utf8
}
});
});
%
endif
}).
call
(
this
,
require
||
RequireJS
.
require
);
</script>
</
%
def>
<
%
def
name=
"optional_include_mako(file, is_theming_enabled=False)"
><
%
#
http:
//
stackoverflow
.
com
/
q
/
21219531
if
is_theming_enabled:
...
...
common/templates/edxnotes_wrapper.html
View file @
d9c798dc
...
...
@@ -11,7 +11,7 @@ from student.models import anonymous_id_for_user
<div
id=
"edx-notes-wrapper-${uid}"
class=
"edx-notes-wrapper"
>
<div
class=
"edx-notes-wrapper-content"
>
${content}
</div>
</div>
<
%
static:require_module
module_name=
"js/edxnotes/views/notes_visibility_factory"
class_name=
"NotesVisibilityFactory"
>
<
%
static:require_module
_async
module_name=
"js/edxnotes/views/notes_visibility_factory"
class_name=
"NotesVisibilityFactory"
>
var element = document.getElementById('edx-notes-wrapper-${uid}');
NotesVisibilityFactory.VisibilityDecorator.factory(element, ${json.dumps(params)}, ${edxnotes_visibility});
</
%
static:require
_module
>
</
%
static:require
_module
_async
>
lms/templates/edxnotes/toggle_notes.html
View file @
d9c798dc
...
...
@@ -22,9 +22,9 @@ from openedx.core.djangolib.js_utils import dump_js_escaped_json, js_escaped_str
</button>
</div>
<
%
static:require_module
module_name=
"js/edxnotes/views/notes_visibility_factory"
class_name=
"NotesVisibilityFactory"
>
<
%
static:require_module
_async
module_name=
"js/edxnotes/views/notes_visibility_factory"
class_name=
"NotesVisibilityFactory"
>
NotesVisibilityFactory.ToggleVisibilityView(
${edxnotes_visibility | n, dump_js_escaped_json},
'${edxnotes_visibility_url | n, js_escaped_string}'
);
</
%
static:require
_module
>
</
%
static:require
_module
_async
>
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