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
d2d29b2c
Commit
d2d29b2c
authored
Jul 23, 2012
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move most javascript loading to below the body, rather than head
parent
5915532a
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
80 additions
and
73 deletions
+80
-73
lms/templates/courseware.html
+1
-3
lms/templates/dashboard.html
+24
-22
lms/templates/gradebook.html
+4
-1
lms/templates/gradebook_profilegraphs.html
+1
-1
lms/templates/main.html
+10
-10
lms/templates/portal/course_about.html
+38
-34
lms/templates/profile.html
+1
-1
lms/templates/simplewiki/simplewiki_base.html
+1
-1
No files found.
lms/templates/courseware.html
View file @
d2d29b2c
...
...
@@ -3,7 +3,7 @@
<
%
block
name=
"bodyclass"
>
courseware
</
%
block>
<
%
block
name=
"title"
><title>
Courseware – MITx 6.002x
</title></
%
block>
<
%
block
name=
"
head
extra"
>
<
%
block
name=
"
js_
extra"
>
<script
type=
"text/javascript"
src=
"${static.url('js/vendor/flot/jquery.flot.js')}"
></script>
<link
rel=
"stylesheet"
href=
"${static.url('css/vendor/jquery.treeview.css')}"
type=
"text/css"
media=
"all"
/>
...
...
@@ -27,9 +27,7 @@
<
%
static:js
group=
'courseware'
/>
<
%
include
file=
"mathjax_include.html"
/>
</
%
block>
<
%
block
name=
"js_extra"
>
<!-- TODO: http://docs.jquery.com/Plugins/Validation -->
<script
type=
"text/javascript"
>
document
.
write
(
'
\
x3Cscript type="text/javascript" src="'
+
...
...
lms/templates/dashboard.html
View file @
d2d29b2c
...
...
@@ -8,6 +8,30 @@
<
%
block
name=
"title"
><title>
Dashboard
</title></
%
block>
<
%
block
name=
"js_extra"
>
<script
type=
"text/javascript"
>
(
function
()
{
$
(
".unenroll"
).
click
(
function
(
event
)
{
$
(
"#unenroll_course_id"
).
val
(
$
(
event
.
target
).
data
(
"course-id"
)
);
$
(
"#unenroll_course_number"
).
text
(
$
(
event
.
target
).
data
(
"course-number"
)
);
});
$
(
document
).
delegate
(
'#unenroll_form'
,
'ajax:success'
,
function
(
data
,
json
,
xhr
)
{
if
(
json
.
success
)
{
location
.
href
=
"${reverse('dashboard')}"
;
}
else
{
if
(
$
(
'#unenroll_error'
).
length
==
0
)
{
$
(
'#unenroll_form'
).
prepend
(
'<div id="unenroll_error" class="modal-form-error"></div>'
);
}
$
(
'#unenroll_error'
).
text
(
json
.
error
).
stop
().
css
(
"display"
,
"block"
);
}
});
})(
this
)
</script>
</
%
block>
<section
class=
"container dashboard"
>
<section
class=
"dashboard-banner"
>
...
...
@@ -110,25 +134,3 @@
</section>
<script
type=
"text/javascript"
>
(
function
()
{
$
(
".unenroll"
).
click
(
function
(
event
)
{
$
(
"#unenroll_course_id"
).
val
(
$
(
event
.
target
).
data
(
"course-id"
)
);
$
(
"#unenroll_course_number"
).
text
(
$
(
event
.
target
).
data
(
"course-number"
)
);
});
$
(
document
).
delegate
(
'#unenroll_form'
,
'ajax:success'
,
function
(
data
,
json
,
xhr
)
{
if
(
json
.
success
)
{
location
.
href
=
"${reverse('dashboard')}"
;
}
else
{
if
(
$
(
'#unenroll_error'
).
length
==
0
)
{
$
(
'#unenroll_form'
).
prepend
(
'<div id="unenroll_error" class="modal-form-error"></div>'
);
}
$
(
'#unenroll_error'
).
text
(
json
.
error
).
stop
().
css
(
"display"
,
"block"
);
}
});
})(
this
)
</script>
lms/templates/gradebook.html
View file @
d2d29b2c
<
%
inherit
file=
"main.html"
/>
<
%
namespace
name=
'static'
file=
'static_content.html'
/>
<
%
block
name=
"
head
extra"
>
<
%
block
name=
"
js_
extra"
>
<script
type=
"text/javascript"
src=
"${static.url('js/vendor/flot/jquery.flot.js')}"
></script>
<script
type=
"text/javascript"
src=
"${static.url('js/vendor/flot/jquery.flot.stack.js')}"
></script>
<script
type=
"text/javascript"
src=
"${static.url('js/vendor/flot/jquery.flot.symbol.js')}"
></script>
</
%
block>
<
%
block
name=
"headextra"
>
<style
type=
"text/css"
>
.grade_a
{
color
:
green
;}
...
...
lms/templates/gradebook_profilegraphs.html
View file @
d2d29b2c
...
...
@@ -2,7 +2,7 @@
<
%
namespace
name=
'static'
file=
'static_content.html'
/>
<
%
namespace
name=
"profile_graphs"
file=
"profile_graphs.js"
/>
<
%
block
name=
"
head
extra"
>
<
%
block
name=
"
js_
extra"
>
<script
type=
"text/javascript"
src=
"${static.url('js/vendor/flot/jquery.flot.js')}"
></script>
<script
type=
"text/javascript"
src=
"${static.url('js/vendor/flot/jquery.flot.stack.js')}"
></script>
<script
type=
"text/javascript"
src=
"${static.url('js/vendor/flot/jquery.flot.symbol.js')}"
></script>
...
...
lms/templates/main.html
View file @
d2d29b2c
...
...
@@ -8,19 +8,12 @@
<link
href=
'http://fonts.googleapis.com/css?family=Open+Sans:800italic,400,800'
rel=
'stylesheet'
type=
'text/css'
>
<
%
static:css
group=
'application'
/>
<
%
static:css
group=
'application'
/>
<!--[if lt IE 9]>
<%static:css group='ie-fixes'/>
<![endif]-->
<
%
static:js
group=
'main_vendor'
/>
<
%
static:js
group=
'application'
/>
<!--[if lt IE 9]>
<script src="${static.url('js/html5shiv.js')}"></script>
<![endif]-->
<
%
block
name=
"headextra"
/>
<
%
static:js
group=
'main_vendor'
/>
<
%
block
name=
"headextra"
/>
<meta
name=
"path_prefix"
content=
"${MITX_ROOT_URL}"
>
</head>
...
...
@@ -33,6 +26,13 @@
<
%
block
name=
"bodyextra"
/>
<
%
include
file=
"footer.html"
/>
<
%
static:js
group=
'application'
/>
<!--[if lt IE 9]>
<script src="${static.url('js/html5shiv.js')}"></script>
<![endif]-->
<
%
block
name=
"js_extra"
/>
<script
src=
"${static.url('js/my_courses_dropdown.js')}"
></script>
<script
src=
"${static.url('js/toggle_login_modal.js')}"
></script>
...
...
lms/templates/portal/course_about.html
View file @
d2d29b2c
...
...
@@ -3,12 +3,48 @@
from
courseware
.
courses
import
course_image_url
,
get_course_about_section
%
>
<
%
namespace
name=
'static'
file=
'../static_content.html'
/>
<
%
inherit
file=
"../main.html"
/>
<
%
block
name=
"js_extra"
>
% if not registered:
%if user.is_authenticated():
## If the user is authenticated, clicking the enroll button just submits a form
<script
type=
"text/javascript"
>
(
function
()
{
$
(
".register"
).
click
(
function
()
{
$
(
"#class_enroll_form"
).
submit
();
});
$
(
document
).
delegate
(
'#class_enroll_form'
,
'ajax:success'
,
function
(
data
,
json
,
xhr
)
{
if
(
json
.
success
)
{
location
.
href
=
"${reverse('dashboard')}"
;
}
});
})(
this
)
</script>
%else:
## If the user is not authenticated, clicking the enroll button pops up the register
## field. We also slip in the registration fields into the login/register fields so
## the user is automatically registered after logging in / registering
<script
type=
"text/javascript"
>
(
function
()
{
$
(
".register"
).
click
(
function
()
{
if
(
$
(
"#login_form .enroll_fieldset"
).
length
===
0
)
{
$
(
"#login_form"
).
append
(
$
(
".enroll_fieldset"
).
first
().
clone
()
);
}
if
(
$
(
"#register_form .enroll_fieldset"
).
length
===
0
)
{
$
(
"#register_form"
).
append
(
$
(
".enroll_fieldset"
).
first
().
clone
()
);
}
});
})(
this
)
</script>
%endif
%endif
<script
src=
"${static.url('js/course_info.js')}"
></script>
</
%
block>
<
%
inherit
file=
"../main.html"
/>
<
%
block
name=
"title"
><title>
About ${course.number}
</title></
%
block>
...
...
@@ -119,38 +155,6 @@
</div>
</form>
</div>
%if user.is_authenticated():
## If the user is authenticated, clicking the enroll button just submits a form
<script
type=
"text/javascript"
>
(
function
()
{
$
(
".register"
).
click
(
function
()
{
$
(
"#class_enroll_form"
).
submit
();
});
$
(
document
).
delegate
(
'#class_enroll_form'
,
'ajax:success'
,
function
(
data
,
json
,
xhr
)
{
if
(
json
.
success
)
{
location
.
href
=
"${reverse('dashboard')}"
;
}
});
})(
this
)
</script>
%else:
## If the user is not authenticated, clicking the enroll button pops up the register
## field. We also slip in the registration fields into the login/register fields so
## the user is automatically registered after logging in / registering
<script
type=
"text/javascript"
>
(
function
()
{
$
(
".register"
).
click
(
function
()
{
if
(
$
(
"#login_form .enroll_fieldset"
).
length
===
0
)
{
$
(
"#login_form"
).
append
(
$
(
".enroll_fieldset"
).
first
().
clone
()
);
}
if
(
$
(
"#register_form .enroll_fieldset"
).
length
===
0
)
{
$
(
"#register_form"
).
append
(
$
(
".enroll_fieldset"
).
first
().
clone
()
);
}
});
})(
this
)
</script>
%endif
%endif
...
...
lms/templates/profile.html
View file @
d2d29b2c
...
...
@@ -8,7 +8,7 @@
from
django
.
core
.
urlresolvers
import
reverse
%
>
<
%
block
name=
"
head
extra"
>
<
%
block
name=
"
js_
extra"
>
<script
type=
"text/javascript"
src=
"${static.url('js/vendor/flot/jquery.flot.js')}"
></script>
<script
type=
"text/javascript"
src=
"${static.url('js/vendor/flot/jquery.flot.stack.js')}"
></script>
<script
type=
"text/javascript"
src=
"${static.url('js/vendor/flot/jquery.flot.symbol.js')}"
></script>
...
...
lms/templates/simplewiki/simplewiki_base.html
View file @
d2d29b2c
...
...
@@ -8,7 +8,7 @@
from
simplewiki
.
views
import
wiki_reverse
%
>
<
%
block
name=
"
head
extra"
>
<
%
block
name=
"
js_
extra"
>
<script
type=
"text/javascript"
src=
"${static.url('js/simplewiki-AutoSuggest_c_2.0.js')}"
></script>
## TODO (cpennington): Remove this when we have a good way for modules to specify js to load on the page
...
...
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