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
da17c8cc
Commit
da17c8cc
authored
Oct 22, 2014
by
Randall Leeds
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1584 from hypothesis/public-replies
Make replies public by default
parents
0f0e3c6f
c23fcf7d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
4 deletions
+22
-4
annotation.coffee
h/static/scripts/directives/annotation.coffee
+6
-1
annotator.permissions.js
h/static/scripts/vendor/annotator.permissions.js
+16
-3
No files found.
h/static/scripts/directives/annotation.coffee
View file @
da17c8cc
...
@@ -159,7 +159,12 @@ AnnotationController = [
...
@@ -159,7 +159,12 @@ AnnotationController = [
# Construct the reply.
# Construct the reply.
references = [references..., id]
references = [references..., id]
reply = {references, uri}
# If replying to a public annotation make the response public.
if 'group:__world__' in model.permissions.read or []
permissions = {read: ['group:__world__']}
reply = {references, uri, permissions}
annotator.publish 'beforeAnnotationCreated', reply
annotator.publish 'beforeAnnotationCreated', reply
###
*
###
*
...
...
h/static/scripts/vendor/annotator.permissions.js
View file @
da17c8cc
// Generated by CoffeeScript 1.6.3
// Generated by CoffeeScript 1.6.3
/*
/*
** Annotator 1.2.6-dev-
9e0eff3
** Annotator 1.2.6-dev-
7c7b224
** https://github.com/okfn/annotator/
** https://github.com/okfn/annotator/
**
**
** Copyright 2012 Aron Carroll, Rufus Pollock, and Nick Stenning.
** Copyright 2012 Aron Carroll, Rufus Pollock, and Nick Stenning.
** Dual licensed under the MIT and GPLv3 licenses.
** Dual licensed under the MIT and GPLv3 licenses.
** https://github.com/okfn/annotator/blob/master/LICENSE
** https://github.com/okfn/annotator/blob/master/LICENSE
**
**
** Built at: 2014-
09-25 22:40:57
Z
** Built at: 2014-
10-22 19:46:29
Z
*/
*/
...
@@ -145,8 +145,18 @@
...
@@ -145,8 +145,18 @@
};
};
Permissions
.
prototype
.
addFieldsToAnnotation
=
function
(
annotation
)
{
Permissions
.
prototype
.
addFieldsToAnnotation
=
function
(
annotation
)
{
var
key
,
_i
,
_len
,
_ref
;
if
(
annotation
)
{
if
(
annotation
)
{
annotation
.
permissions
=
this
.
options
.
permissions
;
if
(
!
annotation
.
permissions
)
{
annotation
.
permissions
=
{};
}
_ref
=
[
'read'
,
'update'
,
'delete'
,
'admin'
];
for
(
_i
=
0
,
_len
=
_ref
.
length
;
_i
<
_len
;
_i
++
)
{
key
=
_ref
[
_i
];
if
(
!
annotation
.
permissions
.
hasOwnProperty
(
key
))
{
annotation
.
permissions
[
key
]
=
this
.
options
.
permissions
[
key
];
}
}
if
(
this
.
user
)
{
if
(
this
.
user
)
{
return
annotation
.
user
=
this
.
user
;
return
annotation
.
user
=
this
.
user
;
}
}
...
@@ -220,3 +230,6 @@
...
@@ -220,3 +230,6 @@
})(
Annotator
.
Plugin
);
})(
Annotator
.
Plugin
);
}).
call
(
this
);
}).
call
(
this
);
//
//# sourceMappingURL=annotator.permissions.map
\ No newline at end of file
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