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
0cd1220b
Commit
0cd1220b
authored
Jul 20, 2015
by
Randall Leeds
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2378 from hypothesis/do-not-via-via
Don't via via
parents
6085e140
d4330992
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
2 deletions
+13
-2
share-dialog.coffee
h/static/scripts/directive/share-dialog.coffee
+6
-2
share-dialog-test.coffee
h/static/scripts/directive/test/share-dialog-test.coffee
+7
-0
No files found.
h/static/scripts/directive/share-dialog.coffee
View file @
0cd1220b
...
...
@@ -18,8 +18,12 @@ module.exports = ['crossframe', (crossframe) ->
scope
.
$watchCollection
(
->
crossframe
.
frames
),
(
frames
)
->
if
not
frames
.
length
return
# XXX: Consider sharing multiple frames in the future?
scope
.
viaPageLink
=
'https://via.hypothes.is/'
+
frames
[
0
].
uri
# Check to see if we are on a via page. If so, we just return the URI.
re
=
/https:\/\/via\.hypothes\.is/
if
re
.
test
(
frames
[
0
].
uri
)
scope
.
viaPageLink
=
frames
[
0
].
uri
else
scope
.
viaPageLink
=
'https://via.hypothes.is/'
+
frames
[
0
].
uri
restrict
:
'A'
templateUrl
:
'share_dialog.html'
...
...
h/static/scripts/directive/test/share-dialog-test.coffee
View file @
0cd1220b
...
...
@@ -30,3 +30,10 @@ describe 'share-dialog', ->
$scope
.
$digest
()
assert
.
equal
(
$scope
.
viaPageLink
,
'https://via.hypothes.is/http://example.com'
)
it
'does not generate new via link if already on via'
,
->
$element
=
$compile
(
'<div share-dialog="">'
)(
$scope
)
fakeCrossFrame
.
frames
.
push
({
uri
:
[
'https://via.hypothes.is/http://example.com'
]})
$scope
.
$digest
()
assert
.
equal
(
$scope
.
viaPageLink
,
'https://via.hypothes.is/http://example.com'
)
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