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
8e9c48c2
Commit
8e9c48c2
authored
Oct 11, 2013
by
David Baumgold
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1310 from edx/db/requirejs-gettext
load gettext on every page
parents
75107389
b6281cb0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
15 deletions
+19
-15
cms/djangoapps/contentstore/features/component.py
+9
-8
cms/static/coffee/src/main.coffee
+4
-3
cms/templates/base.html
+2
-2
cms/templates/settings.html
+4
-2
No files found.
cms/djangoapps/contentstore/features/component.py
View file @
8e9c48c2
...
...
@@ -5,6 +5,7 @@ from lettuce import world, step
from
nose.tools
import
assert_true
,
assert_in
,
assert_equal
# pylint: disable=E0611
from
common
import
create_studio_user
,
add_course_author
,
log_into_studio
@step
(
u'I am in Studio editing a new unit$'
)
def
add_unit
(
step
):
world
.
clear_courses
()
...
...
@@ -18,7 +19,7 @@ def add_unit(step):
add_course_author
(
user
,
course
)
log_into_studio
()
world
.
wait_for_requirejs
([
"jquery"
,
"js/models/course"
,
"coffee/src/models/module"
,
"jquery"
,
"
gettext"
,
"
js/models/course"
,
"coffee/src/models/module"
,
"coffee/src/views/unit"
,
"jquery.ui"
,
])
world
.
wait_for_mathjax
()
...
...
@@ -39,13 +40,13 @@ def add_a_single_step_component(step):
css_selector
=
'a[data-type="{}"]'
.
format
(
component
.
lower
())
world
.
css_click
(
css_selector
)
# In the current implementation, all the "new component"
# buttons are handled by one BackBone.js view.
# If we click two buttons at super-human speed,
# the view will miss the second click while it's
# processing the first.
# To account for this, we wait for each component
# to be created before clicking the next component.
# In the current implementation, all the "new component"
# buttons are handled by one BackBone.js view.
# If we click two buttons at super-human speed,
# the view will miss the second click while it's
# processing the first.
# To account for this, we wait for each component
# to be created before clicking the next component.
world
.
wait_for_visible
(
'section.xmodule_{}Module'
.
format
(
component
))
...
...
cms/static/coffee/src/main.coffee
View file @
8e9c48c2
define
[
"jquery"
,
"underscore.string"
,
"backbone"
,
"js/views/feedback_notification"
,
"jquery.cookie"
],
(
$
,
str
,
Backbone
,
NotificationView
)
->
define
[
"domReady"
,
"jquery"
,
"underscore.string"
,
"backbone"
,
"gettext"
,
"js/views/feedback_notification"
,
"jquery.cookie"
],
(
domReady
,
$
,
str
,
Backbone
,
gettext
,
NotificationView
)
->
AjaxPrefix
.
addAjaxPrefix
jQuery
,
->
$
(
"meta[name='path_prefix']"
).
attr
(
'content'
)
...
...
@@ -36,5 +37,5 @@ define ["jquery", "underscore.string", "backbone", "js/views/feedback_notificati
if
onTouchBasedDevice
()
$
(
'body'
).
addClass
'touch-based-device'
$
(
main
)
domReady
(
main
)
return
main
cms/templates/base.html
View file @
8e9c48c2
...
...
@@ -159,8 +159,8 @@ var require = {
deps
:
[
"coffee/src/ajax_prefix"
]
}
},
// load jquery automatically
deps
:
[
"jquery"
],
// load jquery a
nd gettext a
utomatically
deps
:
[
"jquery"
,
"gettext"
],
callback
:
function
()
{
// load other scripts on every page, after jquery loads
require
([
"js/base"
,
"coffee/src/main"
,
"coffee/src/logger"
,
"datepair"
]);
...
...
cms/templates/settings.html
View file @
8e9c48c2
...
...
@@ -17,6 +17,10 @@
</script>
<script
type=
"text/javascript"
>
window
.
CMS
=
window
.
CMS
||
{};
CMS
.
URL
=
CMS
.
URL
||
{};
CMS
.
URL
.
UPLOAD_ASSET
=
'${upload_asset_url}'
;
require
([
"domReady!"
,
"jquery"
,
"js/models/settings/course_details"
,
"js/views/settings/main"
],
function
(
doc
,
$
,
CourseDetailsModel
,
MainView
)
{
// hilighting labels when fields are focused in
...
...
@@ -37,8 +41,6 @@ require(["domReady!", "jquery", "js/models/settings/course_details", "js/views/s
},
reset
:
true
});
CMS
.
URL
.
UPLOAD_ASSET
=
'${upload_asset_url}'
;
});
</script>
</
%
block>
...
...
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