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
4289ecd3
Commit
4289ecd3
authored
Mar 12, 2015
by
Shrhawk
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7104 from edx/shr/bug/AN-4618-Browser-events-are-being-dropped
Add metatag <path_prefix> for pdf_viewer.html
parents
78d8b00a
64515f1d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
0 deletions
+69
-0
common/static/js/spec/logger_spec.js
+68
-0
lms/templates/pdf_viewer.html
+1
-0
No files found.
common/static/js/spec/logger_spec.js
View file @
4289ecd3
...
...
@@ -37,6 +37,74 @@
});
});
describe
(
'ajax request settings with path_prefix'
,
function
()
{
var
meta_tag
;
beforeEach
(
function
(){
this
.
initialAjaxWithPrefix
=
jQuery
.
ajaxWithPrefix
;
AjaxPrefix
.
addAjaxPrefix
(
$
,
_
.
bind
(
function
()
{
return
$
(
"meta[name='path_prefix']"
).
attr
(
'content'
);
},
this
));
});
afterEach
(
function
(){
jQuery
.
ajaxWithPrefix
=
this
.
initialAjaxWithPrefix
;
meta_tag
.
remove
();
meta_tag
=
null
;
});
it
(
'if path_prefix is not defined'
,
function
()
{
meta_tag
=
$
(
'<meta name="path_prefix1" content="">'
);
meta_tag
.
appendTo
(
'body'
);
spyOn
(
jQuery
,
'ajax'
);
Logger
.
log
(
'example'
,
'data'
);
expect
(
jQuery
.
ajax
).
toHaveBeenCalledWith
({
url
:
'undefined/event'
,
type
:
'POST'
,
data
:
{
event_type
:
'example'
,
event
:
'"data"'
,
page
:
window
.
location
.
href
},
async
:
true
});
});
it
(
'if path_prefix is defined'
,
function
()
{
meta_tag
=
$
(
'<meta name="path_prefix" content="">'
);
meta_tag
.
appendTo
(
'body'
);
spyOn
(
jQuery
,
'ajax'
);
Logger
.
log
(
'example'
,
'data'
);
expect
(
jQuery
.
ajax
).
toHaveBeenCalledWith
({
url
:
'/event'
,
type
:
'POST'
,
data
:
{
event_type
:
'example'
,
event
:
'"data"'
,
page
:
window
.
location
.
href
},
async
:
true
});
});
it
(
'if path_prefix is custom value'
,
function
()
{
meta_tag
=
$
(
'<meta name="path_prefix" content="testpath">'
);
meta_tag
.
appendTo
(
'body'
);
spyOn
(
jQuery
,
'ajax'
);
Logger
.
log
(
'example'
,
'data'
);
expect
(
jQuery
.
ajax
).
toHaveBeenCalledWith
({
url
:
'testpath/event'
,
type
:
'POST'
,
data
:
{
event_type
:
'example'
,
event
:
'"data"'
,
page
:
window
.
location
.
href
},
async
:
true
});
});
});
describe
(
'listen'
,
function
()
{
beforeEach
(
function
()
{
spyOn
(
jQuery
,
'ajaxWithPrefix'
);
...
...
lms/templates/pdf_viewer.html
View file @
4289ecd3
...
...
@@ -23,6 +23,7 @@ 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"
>
<meta
name=
"path_prefix"
content=
"${EDX_ROOT_URL}"
>
<title>
${current_chapter['title'] if current_chapter else '' |h}
</title>
<link
rel=
"stylesheet"
href=
"${static.url('/static/css/vendor/pdfjs/viewer.css')}"
/>
...
...
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