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
dc4e7e3b
Commit
dc4e7e3b
authored
Jul 12, 2017
by
Robert Knight
Committed by
GitHub
Jul 12, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #496 from hypothesis/turn-on-multiframe
Removing flags for multiple iframe support
parents
e29a73f0
b4f15a6f
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
15 additions
and
21 deletions
+15
-21
gulpfile.js
gulpfile.js
+0
-1
live-reload-server.js
scripts/gulp/live-reload-server.js
+9
-13
index.js
src/annotator/config/index.js
+3
-3
main.js
src/annotator/main.js
+1
-1
cross-frame.coffee
src/annotator/plugin/cross-frame.coffee
+2
-2
multi-frame-test.js
src/annotator/test/integration/multi-frame-test.js
+0
-1
No files found.
gulpfile.js
View file @
dc4e7e3b
...
...
@@ -327,7 +327,6 @@ gulp.task('serve-live-reload', ['serve-package'], function () {
var
LiveReloadServer
=
require
(
'./scripts/gulp/live-reload-server'
);
liveReloadServer
=
new
LiveReloadServer
(
3000
,
{
clientUrl
:
`http://
${
packageServerHostname
()}
:3001/hypothesis`
,
enableMultiFrameSupport
:
!!
process
.
env
.
MULTI_FRAME_SUPPORT
,
});
});
...
...
scripts/gulp/live-reload-server.js
View file @
dc4e7e3b
...
...
@@ -70,16 +70,6 @@ function LiveReloadServer(port, config) {
</html>
`
;
}
else
{
var
multiFrameContent
=
config
.
enableMultiFrameSupport
?
`
<div style="margin: 10px 0 0 75px;">
<button id="add-test" style="padding: 0.6em; font-size: 0.75em">Toggle 2nd Frame</button>
</div>
<div style="margin: 10px 0 0 75px;">
<iframe id="iframe1" src="/document/license" style="width: 50%;height: 300px;"></iframe>
</div>
<div id="iframe2-container" style="margin: 10px 0 0 75px;">
</div>`
:
''
;
content
=
`
<html>
<head>
...
...
@@ -91,7 +81,14 @@ function LiveReloadServer(port, config) {
Number of annotations:
<span data-hypothesis-annotation-count>...</span>
</div>
${
multiFrameContent
}
<div style="margin: 10px 0 0 75px;">
<button id="add-test" style="padding: 0.6em; font-size: 0.75em">Toggle 2nd Frame</button>
</div>
<div style="margin: 10px 0 0 75px;">
<iframe id="iframe1" src="/document/license" style="width: 50%;height: 300px;"></iframe>
</div>
<div id="iframe2-container" style="margin: 10px 0 0 75px;">
</div>
<pre style="margin: 20px 75px 75px 75px;">
${
readmeText
()}
</pre>
<script>
var appHost = document.location.hostname;
...
...
@@ -103,8 +100,7 @@ function LiveReloadServer(port, config) {
// Open the sidebar when the page loads
openSidebar: true,
// Needed for multi frame support
enableMultiFrameSupport:
${
config
.
enableMultiFrameSupport
}
,
// Subframe client embed code reference
embedScriptUrl: '
${
config
.
clientUrl
}
'
};
};
...
...
src/annotator/config/index.js
View file @
dc4e7e3b
...
...
@@ -18,10 +18,10 @@ function configFrom(window_) {
openSidebar
:
settings
.
hostPageSetting
(
'openSidebar'
,
{
allowInBrowserExt
:
true
}),
branding
:
settings
.
hostPageSetting
(
'branding'
),
services
:
settings
.
hostPageSetting
(
'services'
),
// Needed by the multi-frame feature for now
enableMultiFrameSupport
:
settings
.
hostPageSetting
(
'enableMultiFrameSupport'
),
embedScriptUrl
:
settings
.
hostPageSetting
(
'embedScriptUrl'
),
// Subframe identifier given when a frame is being embedded into
// by a top level client
subFrameIdentifier
:
settings
.
hostPageSetting
(
'subFrameIdentifier'
),
// Temporary feature flag override for 1st-party OAuth
...
...
src/annotator/main.js
View file @
dc4e7e3b
...
...
@@ -51,7 +51,7 @@ $.noConflict(true)(function() {
delete
config
.
constructor
;
}
if
(
config
.
enableMultiFrameSupport
&&
config
.
subFrameIdentifier
)
{
if
(
config
.
subFrameIdentifier
)
{
Klass
=
Guest
;
// Other modules use this to detect if this
...
...
src/annotator/plugin/cross-frame.coffee
View file @
dc4e7e3b
...
...
@@ -36,10 +36,10 @@ module.exports = class CrossFrame extends Plugin
this
.
pluginInit
=
->
onDiscoveryCallback
=
(
source
,
origin
,
token
)
->
bridge
.
createChannel
(
source
,
origin
,
token
)
discovery
.
startDiscovery
(
onDiscoveryCallback
)
if
config
.
enableMultiFrameSupport
frameObserver
.
observe
(
_injectToFrame
,
_iframeUnloaded
);
frameObserver
.
observe
(
_injectToFrame
,
_iframeUnloaded
);
this
.
destroy
=
->
# super doesnt work here :(
...
...
src/annotator/test/integration/multi-frame-test.js
View file @
dc4e7e3b
...
...
@@ -40,7 +40,6 @@ describe('CrossFrame multi-frame scenario', function () {
options
=
{
config
:
{
enableMultiFrameSupport
:
true
,
embedScriptUrl
:
'data:,'
,
// empty data uri
},
on
:
sandbox
.
stub
(),
...
...
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