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
aa404bef
Unverified
Commit
aa404bef
authored
Sep 14, 2018
by
Robert Knight
Committed by
GitHub
Sep 14, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #769 from hypothesis/postmessage-config-fetch-setting
Add "requestConfigFromFrame" string setting
parents
87098dd8
d12659da
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
2 deletions
+10
-2
index.js
src/annotator/config/index.js
+1
-0
index-test.js
src/annotator/config/test/index-test.js
+4
-2
host-config.js
src/sidebar/host-config.js
+3
-0
host-config-test.js
src/sidebar/test/host-config-test.js
+2
-0
No files found.
src/annotator/config/index.js
View file @
aa404bef
...
...
@@ -24,6 +24,7 @@ function configFrom(window_) {
onLayoutChange
:
settings
.
hostPageSetting
(
'onLayoutChange'
),
openSidebar
:
settings
.
hostPageSetting
(
'openSidebar'
,
{
allowInBrowserExt
:
true
}),
query
:
settings
.
query
,
requestConfigFromFrame
:
settings
.
hostPageSetting
(
'requestConfigFromFrame'
),
services
:
settings
.
hostPageSetting
(
'services'
),
showHighlights
:
settings
.
showHighlights
,
sidebarAppUrl
:
settings
.
sidebarAppUrl
,
...
...
src/annotator/config/test/index-test.js
View file @
aa404bef
...
...
@@ -87,15 +87,17 @@ describe('annotator.config.index', function() {
[
'assetRoot'
,
'openSidebar'
,
'branding'
,
'openSidebar'
,
'requestConfigFromFrame'
,
'services'
,
].
forEach
(
function
(
settingName
)
{
it
(
'returns the '
+
settingName
+
' value from the host page'
,
function
()
{
const
settings
=
{
'assetRoot'
:
'chrome-extension://1234/client/'
,
'openSidebar'
:
'OPEN_SIDEBAR_SETTING'
,
'branding'
:
'BRANDING_SETTING'
,
'openSidebar'
:
'OPEN_SIDEBAR_SETTING'
,
'requestConfigFromFrame'
:
'https://embedder.com'
,
'services'
:
'SERVICES_SETTING'
,
};
fakeSettingsFrom
().
hostPageSetting
=
function
(
settingName
)
{
...
...
src/sidebar/host-config.js
View file @
aa404bef
...
...
@@ -35,6 +35,9 @@ function hostPageConfig(window) {
// This should be removed once new note button is enabled for everybody.
'enableExperimentalNewNoteButton'
,
// Fetch config from a parent frame.
'requestConfigFromFrame'
,
// Theme which can either be specified as 'clean'.
// If nothing is the specified the classic look is applied.
'theme'
,
...
...
src/sidebar/test/host-config-test.js
View file @
aa404bef
...
...
@@ -16,6 +16,7 @@ describe('hostPageConfig', function () {
annotations
:
'1234'
,
appType
:
'bookmarklet'
,
openSidebar
:
true
,
requestConfigFromFrame
:
'https://embedder.com'
,
showHighlights
:
true
,
services
:
[{
authority
:
'hypothes.is'
,
...
...
@@ -26,6 +27,7 @@ describe('hostPageConfig', function () {
annotations
:
'1234'
,
appType
:
'bookmarklet'
,
openSidebar
:
true
,
requestConfigFromFrame
:
'https://embedder.com'
,
showHighlights
:
true
,
services
:
[{
authority
:
'hypothes.is'
,
...
...
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