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
876b07f3
Commit
876b07f3
authored
Mar 21, 2014
by
Randall Leeds
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Start to factor out cross-cutting drafts concerns
parent
6ec8baae
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
8 deletions
+21
-8
app.coffee
h/js/app.coffee
+19
-2
controllers.coffee
h/js/controllers.coffee
+0
-4
services.coffee
h/js/services.coffee
+2
-2
No files found.
h/js/app.coffee
View file @
876b07f3
...
@@ -13,12 +13,29 @@ imports = [
...
@@ -13,12 +13,29 @@ imports = [
configure
=
[
configure
=
[
'$locationProvider'
,
'$routeProvider'
,
'$sceDelegateProvider'
,
'$locationProvider'
,
'$
provide'
,
'$
routeProvider'
,
'$sceDelegateProvider'
,
(
(
$locationProvider
,
$
routeProvider
,
$sceDelegateProvider
,
$locationProvider
,
$
provide
,
$routeProvider
,
$sceDelegateProvider
)
->
)
->
$locationProvider
.
html5Mode
(
true
)
$locationProvider
.
html5Mode
(
true
)
# Disable annotating while drafting
$provide
.
decorator
'drafts'
,
[
'annotator'
,
'$delegate'
,
(
annotator
,
$delegate
)
->
{
add
,
remove
}
=
$delegate
$delegate
.
add
=
(
draft
)
->
add
.
call
$delegate
,
draft
annotator
.
disableAnnotating
$delegate
.
isEmpty
()
$delegate
.
remove
=
(
draft
)
->
remove
.
call
$delegate
,
draft
annotator
.
enableAnnotating
$delegate
.
isEmpty
()
$delegate
]
$routeProvider
.
when
'/editor'
,
$routeProvider
.
when
'/editor'
,
controller
:
'EditorController'
controller
:
'EditorController'
templateUrl
:
'editor.html'
templateUrl
:
'editor.html'
...
...
h/js/controllers.coffee
View file @
876b07f3
...
@@ -533,7 +533,6 @@ class Annotation
...
@@ -533,7 +533,6 @@ class Annotation
$event
?
.
stopPropagation
()
$event
?
.
stopPropagation
()
$scope
.
editing
=
false
$scope
.
editing
=
false
drafts
.
remove
$scope
.
model
drafts
.
remove
$scope
.
model
annotator
.
enableAnnotating
drafts
.
isEmpty
()
switch
$scope
.
action
switch
$scope
.
action
when
'create'
when
'create'
...
@@ -564,7 +563,6 @@ class Annotation
...
@@ -564,7 +563,6 @@ class Annotation
$scope
.
editing
=
false
$scope
.
editing
=
false
drafts
.
remove
annotation
drafts
.
remove
annotation
annotator
.
enableAnnotating
drafts
.
isEmpty
()
switch
$scope
.
action
switch
$scope
.
action
when
'create'
when
'create'
...
@@ -596,7 +594,6 @@ class Annotation
...
@@ -596,7 +594,6 @@ class Annotation
annotator
.
publish
'beforeAnnotationCreated'
,
[
reply
]
annotator
.
publish
'beforeAnnotationCreated'
,
[
reply
]
drafts
.
add
reply
drafts
.
add
reply
annotator
.
disableAnnotating
()
$scope
.
edit
=
(
$event
)
->
$scope
.
edit
=
(
$event
)
->
$event
?
.
stopPropagation
()
$event
?
.
stopPropagation
()
...
@@ -605,7 +602,6 @@ class Annotation
...
@@ -605,7 +602,6 @@ class Annotation
$scope
.
origText
=
$scope
.
model
.
text
$scope
.
origText
=
$scope
.
model
.
text
$scope
.
origTags
=
$scope
.
model
.
tags
$scope
.
origTags
=
$scope
.
model
.
tags
drafts
.
add
$scope
.
model
,
->
$scope
.
cancel
()
drafts
.
add
$scope
.
model
,
->
$scope
.
cancel
()
annotator
.
disableAnnotating
()
$scope
.
delete
=
(
$event
)
->
$scope
.
delete
=
(
$event
)
->
$event
?
.
stopPropagation
()
$event
?
.
stopPropagation
()
...
...
h/js/services.coffee
View file @
876b07f3
...
@@ -56,11 +56,11 @@ class Hypothesis extends Annotator
...
@@ -56,11 +56,11 @@ class Hypothesis extends Annotator
this
.
$inject
=
[
this
.
$inject
=
[
'$document'
,
'$location'
,
'$rootScope'
,
'$route'
,
'$window'
,
'$document'
,
'$location'
,
'$rootScope'
,
'$route'
,
'$window'
,
'authentication'
,
'drafts'
'authentication'
]
]
constructor
:
(
constructor
:
(
$document
,
$location
,
$rootScope
,
$route
,
$window
,
$document
,
$location
,
$rootScope
,
$route
,
$window
,
authentication
,
drafts
authentication
)
->
)
->
Gettext
.
prototype
.
parse_locale_data
annotator_locale_data
Gettext
.
prototype
.
parse_locale_data
annotator_locale_data
super
(
$document
.
find
'body'
)
super
(
$document
.
find
'body'
)
...
...
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