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
5026d6e9
Commit
5026d6e9
authored
Jul 18, 2012
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Give all XModuleDescriptors a module_class, and make it inheritance of js_module_names work
parent
3cdceab1
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
10 additions
and
19 deletions
+10
-19
cms/envs/common.py
+1
-5
common/lib/xmodule/xmodule/capa_module.py
+1
-0
common/lib/xmodule/xmodule/raw_module.py
+1
-0
common/lib/xmodule/xmodule/seq_module.py
+1
-0
common/lib/xmodule/xmodule/video_module.py
+2
-1
common/lib/xmodule/xmodule/x_module.py
+3
-8
lms/envs/common.py
+1
-5
No files found.
cms/envs/common.py
View file @
5026d6e9
...
@@ -194,11 +194,7 @@ except OSError as exc:
...
@@ -194,11 +194,7 @@ except OSError as exc:
fragments
=
set
()
fragments
=
set
()
for
descriptor
in
XModuleDescriptor
.
load_classes
()
+
[
RawDescriptor
]:
for
descriptor
in
XModuleDescriptor
.
load_classes
()
+
[
RawDescriptor
]:
descriptor_js
=
descriptor
.
get_javascript
()
descriptor_js
=
descriptor
.
get_javascript
()
module
=
getattr
(
descriptor
,
'module_class'
,
None
)
module_js
=
descriptor
.
module_class
.
get_javascript
()
if
module
is
not
None
:
module_js
=
module
.
get_javascript
()
else
:
module_js
=
{}
for
filetype
in
(
'coffee'
,
'js'
):
for
filetype
in
(
'coffee'
,
'js'
):
for
fragment
in
descriptor_js
.
get
(
filetype
,
[])
+
module_js
.
get
(
filetype
,
[]):
for
fragment
in
descriptor_js
.
get
(
filetype
,
[])
+
module_js
.
get
(
filetype
,
[]):
...
...
common/lib/xmodule/xmodule/capa_module.py
View file @
5026d6e9
...
@@ -72,6 +72,7 @@ class CapaModule(XModule):
...
@@ -72,6 +72,7 @@ class CapaModule(XModule):
icon_class
=
'problem'
icon_class
=
'problem'
js
=
{
'coffee'
:
[
resource_string
(
__name__
,
'js/src/capa/display.coffee'
)]}
js
=
{
'coffee'
:
[
resource_string
(
__name__
,
'js/src/capa/display.coffee'
)]}
js_module_name
=
"Problem"
def
__init__
(
self
,
system
,
location
,
definition
,
instance_state
=
None
,
shared_state
=
None
,
**
kwargs
):
def
__init__
(
self
,
system
,
location
,
definition
,
instance_state
=
None
,
shared_state
=
None
,
**
kwargs
):
XModule
.
__init__
(
self
,
system
,
location
,
definition
,
instance_state
,
shared_state
,
**
kwargs
)
XModule
.
__init__
(
self
,
system
,
location
,
definition
,
instance_state
,
shared_state
,
**
kwargs
)
...
...
common/lib/xmodule/xmodule/raw_module.py
View file @
5026d6e9
...
@@ -13,6 +13,7 @@ class RawDescriptor(MakoModuleDescriptor, XmlDescriptor):
...
@@ -13,6 +13,7 @@ class RawDescriptor(MakoModuleDescriptor, XmlDescriptor):
mako_template
=
"widgets/raw-edit.html"
mako_template
=
"widgets/raw-edit.html"
js
=
{
'coffee'
:
[
resource_string
(
__name__
,
'js/src/raw/edit.coffee'
)]}
js
=
{
'coffee'
:
[
resource_string
(
__name__
,
'js/src/raw/edit.coffee'
)]}
js_module_name
=
"RawDescriptor"
def
get_context
(
self
):
def
get_context
(
self
):
return
{
return
{
...
...
common/lib/xmodule/xmodule/seq_module.py
View file @
5026d6e9
...
@@ -21,6 +21,7 @@ class SequenceModule(XModule):
...
@@ -21,6 +21,7 @@ class SequenceModule(XModule):
''' Layout module which lays out content in a temporal sequence
''' Layout module which lays out content in a temporal sequence
'''
'''
js
=
{
'coffee'
:
[
resource_string
(
__name__
,
'js/src/sequence/display.coffee'
)]}
js
=
{
'coffee'
:
[
resource_string
(
__name__
,
'js/src/sequence/display.coffee'
)]}
js_module_name
=
"Sequence"
def
__init__
(
self
,
system
,
location
,
definition
,
instance_state
=
None
,
shared_state
=
None
,
**
kwargs
):
def
__init__
(
self
,
system
,
location
,
definition
,
instance_state
=
None
,
shared_state
=
None
,
**
kwargs
):
XModule
.
__init__
(
self
,
system
,
location
,
definition
,
instance_state
,
shared_state
,
**
kwargs
)
XModule
.
__init__
(
self
,
system
,
location
,
definition
,
instance_state
,
shared_state
,
**
kwargs
)
...
...
common/lib/xmodule/xmodule/video_module.py
View file @
5026d6e9
...
@@ -18,8 +18,9 @@ class VideoModule(XModule):
...
@@ -18,8 +18,9 @@ class VideoModule(XModule):
[
resource_string
(
__name__
,
'js/src/video/display.coffee'
)]
+
[
resource_string
(
__name__
,
'js/src/video/display.coffee'
)]
+
[
resource_string
(
__name__
,
'js/src/video/display/'
+
filename
)
[
resource_string
(
__name__
,
'js/src/video/display/'
+
filename
)
for
filename
for
filename
in
resource_listdir
(
__name__
,
'js/src/video/display'
)
in
sorted
(
resource_listdir
(
__name__
,
'js/src/video/display'
)
)
]}
]}
js_module_name
=
"Video"
def
__init__
(
self
,
system
,
location
,
definition
,
instance_state
=
None
,
shared_state
=
None
,
**
kwargs
):
def
__init__
(
self
,
system
,
location
,
definition
,
instance_state
=
None
,
shared_state
=
None
,
**
kwargs
):
XModule
.
__init__
(
self
,
system
,
location
,
definition
,
instance_state
,
shared_state
,
**
kwargs
)
XModule
.
__init__
(
self
,
system
,
location
,
definition
,
instance_state
,
shared_state
,
**
kwargs
)
...
...
common/lib/xmodule/xmodule/x_module.py
View file @
5026d6e9
...
@@ -78,6 +78,7 @@ class XModule(object):
...
@@ -78,6 +78,7 @@ class XModule(object):
icon_class
=
'other'
icon_class
=
'other'
js
=
{}
js
=
{}
js_module_name
=
None
def
__init__
(
self
,
system
,
location
,
definition
,
instance_state
=
None
,
shared_state
=
None
,
**
kwargs
):
def
__init__
(
self
,
system
,
location
,
definition
,
instance_state
=
None
,
shared_state
=
None
,
**
kwargs
):
'''
'''
...
@@ -197,10 +198,6 @@ class XModule(object):
...
@@ -197,10 +198,6 @@ class XModule(object):
# ================================== HTML INTERFACE DEFINITIONS ======================
# ================================== HTML INTERFACE DEFINITIONS ======================
@property
def
js_module_name
(
self
):
return
self
.
__class__
.
__name__
@classmethod
@classmethod
def
get_javascript
(
cls
):
def
get_javascript
(
cls
):
"""
"""
...
@@ -232,6 +229,8 @@ class XModuleDescriptor(Plugin):
...
@@ -232,6 +229,8 @@ class XModuleDescriptor(Plugin):
"""
"""
entry_point
=
"xmodule.v1"
entry_point
=
"xmodule.v1"
js
=
{}
js
=
{}
js_module_name
=
None
module_class
=
XModule
# A list of metadata that this module can inherit from its parent module
# A list of metadata that this module can inherit from its parent module
inheritable_metadata
=
(
inheritable_metadata
=
(
...
@@ -406,10 +405,6 @@ class XModuleDescriptor(Plugin):
...
@@ -406,10 +405,6 @@ class XModuleDescriptor(Plugin):
raise
NotImplementedError
(
'Modules must implement export_to_xml to enable xml export'
)
raise
NotImplementedError
(
'Modules must implement export_to_xml to enable xml export'
)
# ================================== HTML INTERFACE DEFINITIONS ======================
# ================================== HTML INTERFACE DEFINITIONS ======================
@property
def
js_module_name
(
self
):
return
self
.
__class__
.
__name__
@classmethod
@classmethod
def
get_javascript
(
cls
):
def
get_javascript
(
cls
):
"""
"""
...
...
lms/envs/common.py
View file @
5026d6e9
...
@@ -344,11 +344,7 @@ except OSError as exc:
...
@@ -344,11 +344,7 @@ except OSError as exc:
fragments
=
set
()
fragments
=
set
()
for
descriptor
in
XModuleDescriptor
.
load_classes
()
+
[
HiddenDescriptor
]:
for
descriptor
in
XModuleDescriptor
.
load_classes
()
+
[
HiddenDescriptor
]:
module
=
getattr
(
descriptor
,
'module_class'
,
None
)
module_js
=
descriptor
.
module_class
.
get_javascript
()
if
module
is
None
:
continue
js
=
module
.
get_javascript
()
for
filetype
in
(
'coffee'
,
'js'
):
for
filetype
in
(
'coffee'
,
'js'
):
for
fragment
in
js
.
get
(
filetype
,
[]):
for
fragment
in
js
.
get
(
filetype
,
[]):
fragments
.
add
((
filetype
,
fragment
))
fragments
.
add
((
filetype
,
fragment
))
...
...
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