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
08404672
Commit
08404672
authored
Feb 09, 2015
by
Giulio Gratta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Making edX changes to pdf viewer/analytics html
parent
4726da6c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
24 deletions
+35
-24
lms/static/js/pdf-analytics.js
+14
-14
lms/templates/pdf_viewer.html
+21
-10
No files found.
lms/static/js/pdf-analytics.js
View file @
08404672
...
...
@@ -13,10 +13,10 @@ $(function() {
$
(
window
).
bind
(
"pagechange"
,
function
(
event
)
{
// log every page render
var
page
=
event
.
originalEvent
.
pageNumber
;
var
old_page
=
PDFView
.
previousPageNumber
;
var
page
=
PDFViewerApplication
.
page
;
var
old_page
=
event
.
originalEvent
.
previousPageNumber
;
// pagechange is called many times per viewing.
if
(
PDFView
.
previousPageNumber
!==
page
||
first_page
)
{
if
(
old_page
!==
page
||
first_page
)
{
first_page
=
false
;
if
((
event
.
timeStamp
-
scroll
.
timeStamp
)
<
50
)
{
sendLog
(
"page.scrolled"
,
{
"page"
:
page
,
"direction"
:
scroll
.
direction
});
...
...
@@ -28,12 +28,12 @@ $(function() {
$
(
'#viewerContainer'
).
bind
(
'DOMMouseScroll mousewheel'
,
function
(
event
)
{
scroll
.
timeStamp
=
event
.
timeStamp
;
scroll
.
direction
=
PDFView
.
pageViewS
croll
.
down
?
"down"
:
"up"
;
scroll
.
direction
=
PDFView
erApplication
.
pdfViewer
.
s
croll
.
down
?
"down"
:
"up"
;
});
});
$
(
'#viewThumbnail,#sidebarToggle'
).
on
(
'click'
,
function
()
{
sendLog
(
"thumbnails.toggled"
,
{
"page"
:
PDFView
.
page
});
sendLog
(
"thumbnails.toggled"
,
{
"page"
:
PDFView
erApplication
.
page
});
});
$
(
'#thumbnailView a'
).
live
(
'click'
,
function
(){
...
...
@@ -41,19 +41,19 @@ $('#thumbnailView a').live('click', function(){
});
$
(
'#viewOutline'
).
on
(
'click'
,
function
()
{
sendLog
(
"outline.toggled"
,
{
"page"
:
PDFView
.
page
});
sendLog
(
"outline.toggled"
,
{
"page"
:
PDFView
erApplication
.
page
});
});
$
(
'#previous'
).
on
(
'click'
,
function
()
{
sendLog
(
"page.navigatednext"
,
{
"type"
:
"prevpage"
,
"new"
:
PDFView
.
page
-
1
},
"book"
);
sendLog
(
"page.navigatednext"
,
{
"type"
:
"prevpage"
,
"new"
:
PDFView
erApplication
.
page
-
1
},
"book"
);
});
$
(
'#next'
).
on
(
'click'
,
function
()
{
sendLog
(
"page.navigatednext"
,
{
"type"
:
"nextpage"
,
"new"
:
PDFView
.
page
+
1
},
"book"
);
sendLog
(
"page.navigatednext"
,
{
"type"
:
"nextpage"
,
"new"
:
PDFView
erApplication
.
page
+
1
},
"book"
);
});
$
(
'#zoomIn,#zoomOut'
).
on
(
'click'
,
function
()
{
sendLog
(
"zoom.buttons.changed"
,
{
"direction"
:
$
(
this
).
attr
(
"id"
)
==
"zoomIn"
?
"in"
:
"out"
,
"page"
:
PDFView
.
page
});
sendLog
(
"zoom.buttons.changed"
,
{
"direction"
:
$
(
this
).
attr
(
"id"
)
==
"zoomIn"
?
"in"
:
"out"
,
"page"
:
PDFView
erApplication
.
page
});
});
$
(
'#pageNumber'
).
on
(
'change'
,
function
()
{
...
...
@@ -61,16 +61,16 @@ $('#pageNumber').on('change', function() {
});
var
old_amount
=
1
;
$
(
window
).
bind
(
'scalechange'
,
function
(
evt
)
{
var
amount
=
evt
.
originalEvent
.
scale
;
$
(
window
).
bind
(
'scalechange'
,
function
(
ev
en
t
)
{
var
amount
=
ev
en
t
.
originalEvent
.
scale
;
if
(
amount
!==
old_amount
)
{
sendLog
(
"display.scaled"
,
{
"amount"
:
amount
,
"page"
:
PDFView
.
page
});
sendLog
(
"display.scaled"
,
{
"amount"
:
amount
,
"page"
:
PDFView
erApplication
.
page
});
old_amount
=
amount
;
}
});
$
(
'#scaleSelect'
).
on
(
'change'
,
function
()
{
sendLog
(
"zoom.menu.changed"
,
{
"amount"
:
$
(
"#scaleSelect"
).
val
(),
"page"
:
PDFView
.
page
});
sendLog
(
"zoom.menu.changed"
,
{
"amount"
:
$
(
"#scaleSelect"
).
val
(),
"page"
:
PDFView
erApplication
.
page
});
});
var
search_event
=
null
;
...
...
@@ -81,7 +81,7 @@ $(window).bind("find findhighlightallchange findagain findcasesensitivitychange"
search_event
=
setTimeout
(
function
(){
var
message
=
event
.
originalEvent
.
detail
;
message
.
status
=
$
(
'#findMsg'
).
text
();
message
.
page
=
PDFView
.
page
;
message
.
page
=
PDFView
erApplication
.
page
;
var
event_name
=
"search"
;
switch
(
event
.
type
)
{
case
"find"
:
...
...
lms/templates/pdf_viewer.html
View file @
08404672
<!DOCTYPE html>
<
%
namespace
name=
'static'
file=
'static_content.html'
/>
<!--
Copyright 2012 Mozilla Foundation
...
...
@@ -22,20 +23,29 @@ http://sourceforge.net/adobe/cmap/wiki/License/
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1, maximum-scale=1"
>
<meta
name=
"google"
content=
"notranslate"
>
<title>
PDF.js viewer
</title>
<title>
${current_chapter['title'] if current_chapter else '' |h}
</title>
<link
rel=
"stylesheet"
href=
"
viewer.css
"
/>
<link
rel=
"stylesheet"
href=
"
${static.url('/static/css/vendor/pdfjs/viewer.css')}
"
/>
<script
src=
"compatibility.js
"
></script>
<script
type=
"text/javascript"
src=
"${static.url('/static/js/vendor/pdfjs/compatibility.js')}
"
></script>
<!-- This snippet is used in production (included from viewer.html) -->
<link
rel=
"resource"
type=
"application/l10n"
href=
"locale/locale.properties
"
/>
<script
src=
"l10n.js
"
></script>
<script
src=
"../build/pdf.js
"
></script>
<!-- This snippet is used in production (included from viewer.html) -->
<link
rel=
"resource"
type=
"application/l10n"
href=
"${static.url('/static/js/vendor/pdfjs/locale/locale.properties')}
"
/>
<script
type=
"text/javascript"
src=
"${static.url('/static/js/vendor/pdfjs/l10n.js')}
"
></script>
<script
type=
"text/javascript"
src=
"${static.url('/static/js/vendor/pdfjs/pdf.js')}
"
></script>
<script
src=
"debugger.js"
></script>
<script
src=
"viewer.js"
></script>
<script
type=
"text/javascript"
>
PDFJS
.
imageResourcesPath
=
"${static.url('/static/css/vendor/pdfjs/images/')}"
;
PDFJS
.
workerSrc
=
"${static.url('/static/js/vendor/pdfjs/pdf.worker.js')}"
;
PDFJS
.
cMapUrl
=
"${static.url('/static/css/vendor/pdfjs/cmaps/')}"
;
PDF_URL
=
'${current_url | h}'
;
</script>
<script
${
static
.
url
('/
static
/
js
/
vendor
/
pdfjs
/
debugger
.
js
')}
></script>
<
%
static:js
group=
'main_vendor'
/>
<
%
static:js
group=
'application'
/>
<
%
static:js
group=
'courseware'
/>
</head>
<body
tabindex=
"1"
>
...
...
@@ -400,6 +410,7 @@ http://sourceforge.net/adobe/cmap/wiki/License/
</div>
</div>
</div>
<script
type=
"text/javascript"
src=
"${static.url('/static/js/vendor/pdfjs/viewer.js')}"
></script>
<script
type=
"text/javascript"
src=
"${static.url('/static/js/pdf-analytics.js')}"
></script>
</body>
</html>
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