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
8481937f
Commit
8481937f
authored
Jul 19, 2012
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move Logger and *withPrefix javascript into a common location
parent
87ce8257
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
39 additions
and
18 deletions
+39
-18
cms/envs/common.py
+11
-3
cms/static/coffee/src/main.coffee
+1
-5
common/static/coffee/spec/logger_spec.coffee
+0
-0
common/static/coffee/src/.gitignore
+1
-0
common/static/coffee/src/ajax_prefix.coffee
+16
-0
common/static/coffee/src/logger.coffee
+2
-2
lms/envs/common.py
+5
-1
lms/envs/dev.py
+2
-2
lms/static/coffee/src/main.coffee
+1
-5
No files found.
cms/envs/common.py
View file @
8481937f
...
...
@@ -146,10 +146,10 @@ MANAGERS = ADMINS
# Static content
STATIC_URL
=
'/static/'
ADMIN_MEDIA_PREFIX
=
'/static/admin/'
STATIC_ROOT
=
ENV_ROOT
/
"staticfiles"
STATIC_ROOT
=
ENV_ROOT
/
"staticfiles"
STATICFILES_DIRS
=
[
(
'js/vendor'
,
COMMON_ROOT
/
"static"
/
"js"
/
"vendor"
)
,
COMMON_ROOT
/
"static"
,
PROJECT_ROOT
/
"static"
,
# This is how you would use the textbook images locally
...
...
@@ -219,7 +219,15 @@ for idx, filetype, fragment in sorted(fragments):
PIPELINE_JS
=
{
'main'
:
{
'source_filenames'
:
[
pth
.
replace
(
PROJECT_ROOT
/
'static/'
,
''
)
for
pth
in
glob2
.
glob
(
PROJECT_ROOT
/
'static/coffee/src/**/*.coffee'
)],
'source_filenames'
:
[
pth
.
replace
(
COMMON_ROOT
/
'static/'
,
''
)
for
pth
in
glob2
.
glob
(
COMMON_ROOT
/
'static/coffee/src/**/*.coffee'
)
]
+
[
pth
.
replace
(
PROJECT_ROOT
/
'static/'
,
''
)
for
pth
in
glob2
.
glob
(
PROJECT_ROOT
/
'static/coffee/src/**/*.coffee'
)
],
'output_filename'
:
'js/application.js'
,
},
'module-js'
:
{
...
...
cms/static/coffee/src/main.coffee
View file @
8481937f
jQuery
.
postWithPrefix
=
(
url
,
data
,
callback
,
type
)
->
$
.
post
(
"
#{
CMS
.
prefix
}#{
url
}
"
,
data
,
callback
,
type
)
jQuery
.
getWithPrefix
=
(
url
,
data
,
callback
,
type
)
->
$
.
get
(
"
#{
CMS
.
prefix
}#{
url
}
"
,
data
,
callback
,
type
)
AjaxPrefix
.
addAjaxPrefix
(
jQuery
,
->
CMS
.
prefix
)
@
CMS
=
Models
:
{}
...
...
lms
/static/coffee/spec/logger_spec.coffee
→
common
/static/coffee/spec/logger_spec.coffee
View file @
8481937f
File moved
common/static/coffee/src/.gitignore
0 → 100644
View file @
8481937f
*.js
common/static/coffee/src/ajax_prefix.coffee
0 → 100644
View file @
8481937f
@
AjaxPrefix
=
addAjaxPrefix
:
(
jQuery
,
prefix
)
->
jQuery
.
postWithPrefix
=
(
url
,
data
,
callback
,
type
)
->
$
.
post
(
"
#{
prefix
()
}#{
url
}
"
,
data
,
callback
,
type
)
jQuery
.
getWithPrefix
=
(
url
,
data
,
callback
,
type
)
->
$
.
get
(
"
#{
prefix
()
}#{
url
}
"
,
data
,
callback
,
type
)
jQuery
.
ajaxWithPrefix
=
(
url
,
settings
)
->
if
settings
?
$
.
ajax
(
"
#{
prefix
()
}#{
url
}
"
,
settings
)
else
settings
=
url
settings
.
url
=
"
#{
prefix
()
}#{
settings
.
url
}
"
$
.
ajax
settings
lms
/static/coffee/src/logger.coffee
→
common
/static/coffee/src/logger.coffee
View file @
8481937f
...
...
@@ -7,8 +7,8 @@ class @Logger
@
bind
:
->
window
.
onunload
=
->
$
.
ajax
url
:
"
#{
Courseware
.
prefix
}
/event"
$
.
ajax
WithPrefix
url
:
"/event"
data
:
event_type
:
'page_close'
event
:
''
...
...
lms/envs/common.py
View file @
8481937f
...
...
@@ -184,7 +184,7 @@ ADMIN_MEDIA_PREFIX = '/static/admin/'
STATIC_ROOT
=
ENV_ROOT
/
"staticfiles"
STATICFILES_DIRS
=
[
(
'js/vendor'
,
COMMON_ROOT
/
"static"
/
"js"
/
"vendor"
)
,
COMMON_ROOT
/
"static"
,
PROJECT_ROOT
/
"static"
,
ASKBOT_ROOT
/
"askbot"
/
"skins"
,
...
...
@@ -365,6 +365,10 @@ PIPELINE_JS = {
'application'
:
{
# Application will contain all paths not in courseware_only_js
'source_filenames'
:
[
pth
.
replace
(
COMMON_ROOT
/
'static/'
,
''
)
for
pth
in
glob2
.
glob
(
COMMON_ROOT
/
'static/coffee/src/**/*.coffee'
)
]
+
[
pth
.
replace
(
PROJECT_ROOT
/
'static/'
,
''
)
for
pth
in
glob2
.
glob
(
PROJECT_ROOT
/
'static/coffee/src/**/*.coffee'
)
\
if
pth
not
in
courseware_only_js
...
...
lms/envs/dev.py
View file @
8481937f
...
...
@@ -56,8 +56,8 @@ CACHES = {
SECRET_KEY
=
'85920908f28904ed733fe576320db18cabd7b6cd'
################################ DEBUG TOOLBAR #################################
#
INSTALLED_APPS += ('debug_toolbar',)
#
MIDDLEWARE_CLASSES += ('debug_toolbar.middleware.DebugToolbarMiddleware',)
INSTALLED_APPS
+=
(
'debug_toolbar'
,)
MIDDLEWARE_CLASSES
+=
(
'debug_toolbar.middleware.DebugToolbarMiddleware'
,)
INTERNAL_IPS
=
(
'127.0.0.1'
,)
DEBUG_TOOLBAR_PANELS
=
(
...
...
lms/static/coffee/src/main.coffee
View file @
8481937f
jQuery
.
postWithPrefix
=
(
url
,
data
,
callback
,
type
)
->
$
.
post
(
"
#{
Courseware
.
prefix
}#{
url
}
"
,
data
,
callback
,
type
)
jQuery
.
getWithPrefix
=
(
url
,
data
,
callback
,
type
)
->
$
.
get
(
"
#{
Courseware
.
prefix
}#{
url
}
"
,
data
,
callback
,
type
)
AjaxPrefix
.
addAjaxPrefix
(
jQuery
,
->
Courseware
.
prefix
)
$
->
$
.
ajaxSetup
...
...
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