Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
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
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
027704e9
Commit
027704e9
authored
Jul 02, 2015
by
Randall Leeds
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2340 from hypothesis/fix-guest-embedding
Fix guest embedding
parents
249298d2
f1a812fa
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
10 deletions
+6
-10
main.js
h/static/scripts/annotator/main.js
+6
-10
No files found.
h/static/scripts/annotator/main.js
View file @
027704e9
...
@@ -47,22 +47,13 @@ require('./plugin/textquote');
...
@@ -47,22 +47,13 @@ require('./plugin/textquote');
require
(
'./plugin/textposition'
);
require
(
'./plugin/textposition'
);
require
(
'./plugin/textrange'
);
require
(
'./plugin/textrange'
);
var
Klass
=
Annotator
.
Host
;
var
docs
=
'https://h.readthedocs.org/en/latest/hacking/customized-embedding.html'
;
var
docs
=
'https://github.com/hypothesis/h/blob/master/README.rst#customized-embedding'
;
var
options
=
{
var
options
=
{
app
:
jQuery
(
'link[type="application/annotator+html"]'
).
attr
(
'href'
),
app
:
jQuery
(
'link[type="application/annotator+html"]'
).
attr
(
'href'
),
BucketBar
:
{
container
:
'.annotator-frame'
},
BucketBar
:
{
container
:
'.annotator-frame'
},
Toolbar
:
{
container
:
'.annotator-frame'
}
Toolbar
:
{
container
:
'.annotator-frame'
}
};
};
if
(
window
.
hasOwnProperty
(
'hypothesisRole'
))
{
if
(
typeof
window
.
hypothesisRole
===
'function'
)
{
Klass
=
window
.
hypothesisRole
;
}
else
{
throw
new
TypeError
(
'hypothesisRole must be a constructor function, see: '
+
docs
);
}
}
// Simple IE autodetect function
// Simple IE autodetect function
// See for example https://stackoverflow.com/questions/19999388/jquery-check-if-user-is-using-ie/21712356#21712356
// See for example https://stackoverflow.com/questions/19999388/jquery-check-if-user-is-using-ie/21712356#21712356
var
ua
=
window
.
navigator
.
userAgent
;
var
ua
=
window
.
navigator
.
userAgent
;
...
@@ -81,5 +72,10 @@ if (window.hasOwnProperty('hypothesisConfig')) {
...
@@ -81,5 +72,10 @@ if (window.hasOwnProperty('hypothesisConfig')) {
}
}
Annotator
.
noConflict
().
$
.
noConflict
(
true
)(
function
()
{
Annotator
.
noConflict
().
$
.
noConflict
(
true
)(
function
()
{
var
Klass
=
Annotator
.
Host
;
if
(
options
.
hasOwnProperty
(
'constructor'
))
{
Klass
=
options
.
constructor
;
delete
options
.
constructor
;
}
window
.
annotator
=
new
Klass
(
document
.
body
,
options
);
window
.
annotator
=
new
Klass
(
document
.
body
,
options
);
});
});
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