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
cb7a3ad8
Commit
cb7a3ad8
authored
Aug 19, 2013
by
Miles Steele
Committed by
Carlos Andrés Rocha
Aug 20, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
switch from log_event to Logger.log
keep log_event for compatibility
parent
5692867b
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
11 deletions
+12
-11
common/static/coffee/src/logger.coffee
+3
-1
common/static/js/pdfviewer.js
+3
-3
lms/static/coffee/spec/navigation_spec.coffee
+2
-3
lms/static/coffee/src/navigation.coffee
+1
-1
lms/templates/staticbook.html
+3
-3
No files found.
common/static/coffee/src/logger.coffee
View file @
cb7a3ad8
...
...
@@ -42,5 +42,7 @@ class @Logger
page
:
window
.
location
.
href
async
:
false
# Keeping this for compatibility issue only.
# log_event exists for compatibility reasons
# and will soon be deprecated.
@
log_event
=
Logger
.
log
common/static/js/pdfviewer.js
View file @
cb7a3ad8
...
...
@@ -157,7 +157,7 @@ PDFJS.disableWorker = true;
}
// Update logging:
log_event
(
"book"
,
{
"type"
:
"gotopage"
,
"old"
:
pageNum
,
"new"
:
num
});
Logger
.
log
(
"book"
,
{
"type"
:
"gotopage"
,
"old"
:
pageNum
,
"new"
:
num
});
parentElement
=
viewerElement
;
while
(
parentElement
.
hasChildNodes
())
...
...
@@ -207,7 +207,7 @@ PDFJS.disableWorker = true;
if
(
pageNum
<=
1
)
return
;
renderPage
(
pageNum
-
1
);
log_event
(
"book"
,
{
"type"
:
"prevpage"
,
"new"
:
pageNum
});
Logger
.
log
(
"book"
,
{
"type"
:
"prevpage"
,
"new"
:
pageNum
});
}
// Go to next page
...
...
@@ -215,7 +215,7 @@ PDFJS.disableWorker = true;
if
(
pageNum
>=
pdfDocument
.
numPages
)
return
;
renderPage
(
pageNum
+
1
);
log_event
(
"book"
,
{
"type"
:
"nextpage"
,
"new"
:
pageNum
});
Logger
.
log
(
"book"
,
{
"type"
:
"nextpage"
,
"new"
:
pageNum
});
}
selectScaleOption
=
function
(
value
)
{
...
...
lms/static/coffee/spec/navigation_spec.coffee
View file @
cb7a3ad8
...
...
@@ -57,8 +57,7 @@ describe 'Navigation', ->
describe
'log'
,
->
beforeEach
->
window
.
log_event
=
->
spyOn
window
,
'log_event'
spyOn
Logger
,
'log'
it
'submit event log'
,
->
@
navigation
.
log
{},
{
...
...
@@ -68,6 +67,6 @@ describe 'Navigation', ->
text
:
->
"old"
}
expect
(
window
.
log_event
).
toHaveBeenCalledWith
'accordion'
,
expect
(
Logger
.
log
).
toHaveBeenCalledWith
'accordion'
,
newheader
:
'new'
oldheader
:
'old'
lms/static/coffee/src/navigation.coffee
View file @
cb7a3ad8
...
...
@@ -20,7 +20,7 @@ class @Navigation
$
(
'#accordion a'
).
click
@
setChapter
log
:
(
event
,
ui
)
->
log_event
'accordion'
,
Logger
.
log
'accordion'
,
newheader
:
ui
.
newHeader
.
text
()
oldheader
:
ui
.
oldHeader
.
text
()
...
...
lms/templates/staticbook.html
View file @
cb7a3ad8
...
...
@@ -25,7 +25,7 @@ $(document).ready(function(){
});
function
goto_page
(
n
)
{
log_event
(
"book"
,
{
"type"
:
"gotopage"
,
"old"
:
page
,
"new"
:
n
});
Logger
.
log
(
"book"
,
{
"type"
:
"gotopage"
,
"old"
:
page
,
"new"
:
n
});
page
=
n
;
var
prefix
=
""
;
if
(
n
<
100
)
{
...
...
@@ -42,14 +42,14 @@ function prev_page() {
var
newpage
=
page
-
1
;
if
(
newpage
<
$
{
start_page
})
newpage
=
$
{
start_page
};
goto_page
(
newpage
);
log_event
(
"book"
,
{
"type"
:
"prevpage"
,
"new"
:
page
});
Logger
.
log
(
"book"
,
{
"type"
:
"prevpage"
,
"new"
:
page
});
}
function
next_page
()
{
var
newpage
=
page
+
1
;
if
(
newpage
>
$
{
end_page
})
newpage
=
$
{
end_page
};
goto_page
(
newpage
);
log_event
(
"book"
,
{
"type"
:
"nextpage"
,
"new"
:
page
});
Logger
.
log
(
"book"
,
{
"type"
:
"nextpage"
,
"new"
:
page
});
}
$
(
"#open_close_accordion a"
).
click
(
function
(){
...
...
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