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
ff0bc489
Commit
ff0bc489
authored
Feb 09, 2015
by
Randall Leeds
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into syncbridge
Conflicts: h/static/scripts/controllers.coffee
parents
9423f971
7083e5a7
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
113 additions
and
98 deletions
+113
-98
sad-annotation.svg
h/static/images/sad-annotation.svg
+19
-0
account-controller.coffee
h/static/scripts/account/account-controller.coffee
+1
-1
account.coffee
h/static/scripts/account/account.coffee
+2
-8
auth-controller.coffee
h/static/scripts/account/auth-controller.coffee
+1
-1
app.coffee
h/static/scripts/app.coffee
+0
-1
controllers.coffee
h/static/scripts/controllers.coffee
+1
-1
threads.scss
h/static/styles/threads.scss
+4
-0
account-controller-test.coffee
tests/js/account/account-controller-test.coffee
+2
-2
auth-controller-test.coffee
tests/js/account/auth-controller-test.coffee
+83
-84
No files found.
h/static/images/sad-annotation.svg
0 → 100644
View file @
ff0bc489
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width=
"99px"
height=
"92px"
viewBox=
"0 0 99 92"
version=
"1.1"
xmlns=
"http://www.w3.org/2000/svg"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
xmlns:sketch=
"http://www.bohemiancoding.com/sketch/ns"
>
<!-- Generator: Sketch 3.2.2 (9983) - http://www.bohemiancoding.com/sketch -->
<title>
Slice 1
</title>
<desc>
Created with Sketch.
</desc>
<defs></defs>
<g
id=
"Page-1"
stroke=
"none"
stroke-width=
"1"
fill=
"none"
fill-rule=
"evenodd"
sketch:type=
"MSPage"
>
<g
id=
"sad-annotation"
sketch:type=
"MSLayerGroup"
fill=
"#BBBBBB"
>
<g
id=
"Page-1"
sketch:type=
"MSShapeGroup"
>
<g
id=
"Group"
>
<path
d=
"M21.0244225,0.305107567 C9.98135502,0.305107567 0.872083773,9.25959265 0.678248468,20.308205 L0.098944476,53.3285326 C-0.0948696585,64.3759382 8.70465419,73.4690154 19.7517133,73.6315189 C19.7517133,73.6315189 30.5058053,73.8128632 30.9230781,73.7586857 C40.8912967,75.3957845 45.7862251,91.741397 49.2864726,91.6950246 C53.1354048,91.6484543 57.3386431,73.6047617 68.0769228,73.33163 C74.7294766,73.4808984 77.9774076,73.3977824 77.9774076,73.3977824 C89.0194649,73.3612475 98.1279171,64.3771449 98.3217525,53.3285326 L98.9010564,20.308205 C99.0948706,9.26079934 90.2968029,0.305107567 79.2567454,0.305107567 L21.0244225,0.305107567 L21.0244225,0.305107567 Z M26.0106513,10.1273884 C17.7255158,10.1273884 10.8879947,16.8334308 10.7382361,25.127031 L10.331435,47.6555952 C10.1818484,55.9396691 16.7756859,62.7583236 25.0571713,62.8806623 C25.0571713,62.8806623 34.35,63.0352771 34.6795201,62.9924921 C42.5514181,64.2853411 47.5044818,74.576174 49.318091,74.6127971 C51.1317002,74.6494202 55.5398805,62.8709353 64.0198953,62.6552378 C69.2734142,62.773118 77.6243098,62.6999126 77.6243098,62.6999126 C83.1486949,62.6752394 87.7079626,58.1767429 87.8077324,52.651511 L88.3047454,25.127031 C88.4543319,16.8429571 81.8615115,10.1273884 73.574031,10.1273884 L26.0106513,10.1273884 L26.0106513,10.1273884 Z"
id=
"Active-Browser-Action-2"
></path>
<ellipse
id=
"Oval-1"
cx=
"32.2042451"
cy=
"28.4907829"
rx=
"5.12466824"
ry=
"6.83289099"
></ellipse>
<path
d=
"M66.3687001,35.3236739 C69.1989762,35.3236739 71.4933683,32.2644844 71.4933683,28.4907829 C71.4933683,24.7170814 69.1989762,21.6578919 66.3687001,21.6578919 C63.538424,21.6578919 61.2440318,24.7170814 61.2440318,28.4907829 C61.2440318,32.2644844 63.538424,35.3236739 66.3687001,35.3236739 L66.3687001,35.3236739 Z"
id=
"Oval-2"
></path>
<path
d=
"M49.2864724,49.7403396 C52.0318666,49.8681341 53.5761511,50.4824633 54.686705,50.8198538 C55.7880507,51.3905335 56.7456419,52.2736067 57.4129402,53.4294012 C58.1538299,54.7126599 59.7893503,55.1554407 61.0659771,54.4183798 C62.3426039,53.681319 62.7769046,52.0435264 62.0360149,50.7602678 C59.3856696,46.169735 54.2624995,44.2918433 49.2864724,44.2918433 C44.1388577,44.2918433 39.1872757,46.169735 36.5369303,50.7602678 C35.7960406,52.0435264 36.2303413,53.681319 37.5069681,54.4183798 C38.783595,55.1554407 40.4191153,54.7126599 41.160005,53.4294012 C41.8273033,52.2736067 42.7848945,51.3905335 43.8862402,50.8198538 C43.8862402,50.8198538 46.7126649,49.8681341 49.2864724,49.7403396 L49.2864724,49.7403396 Z"
id=
"Oval-1"
></path>
</g>
</g>
</g>
</g>
</svg>
\ No newline at end of file
h/static/scripts/account/account-controller.coffee
View file @
ff0bc489
...
...
@@ -87,5 +87,5 @@ class AccountController
angular
.
module
(
'h
.account
'
)
angular
.
module
(
'h'
)
.
controller
(
'AccountController'
,
AccountController
)
h/static/scripts/account/account.coffee
View file @
ff0bc489
imports
=
[
'ngRoute'
'h.identity'
'h.helpers'
'h.session'
]
AUTH_SESSION_ACTIONS
=
[
'login'
'logout'
...
...
@@ -126,6 +119,7 @@ configure = [
]
angular
.
module
(
'h.account'
,
imports
,
configure
)
angular
.
module
(
'h'
)
.
config
(
configure
)
.
controller
(
'AuthAppController'
,
AuthAppController
)
.
controller
(
'AuthPageController'
,
AuthPageController
)
h/static/scripts/account/auth-controller.coffee
View file @
ff0bc489
...
...
@@ -53,5 +53,5 @@ class AuthController
,
300000
angular
.
module
(
'h
.account
'
)
angular
.
module
(
'h'
)
.
controller
(
'AuthController'
,
AuthController
)
h/static/scripts/app.coffee
View file @
ff0bc489
...
...
@@ -3,7 +3,6 @@ imports = [
'ngRoute'
'ngSanitize'
'ngTagsInput'
'h.account'
'h.helpers'
'h.identity'
'h.session'
...
...
h/static/scripts/controllers.coffee
View file @
ff0bc489
...
...
@@ -202,7 +202,7 @@ class ViewerController
streamfilter
.
resetFilter
().
addClause
(
'/uri'
,
'one_of'
,
loaded
)
if
auth
.
user
and
annotationUI
.
tool
is
'highlight'
streamfilter
.
addClause
(
'/user'
,
auth
.
user
)
streamfilter
.
addClause
(
'/user'
,
'equals'
,
auth
.
user
)
streamer
.
send
({
filter
:
streamfilter
.
getFilter
()})
...
...
h/static/styles/threads.scss
View file @
ff0bc489
...
...
@@ -25,6 +25,10 @@ $threadexp-width: .6em;
}
}
.thread-reply
{
display
:
inline-block
}
.thread
{
@include
pie-clearfix
;
cursor
:
pointer
;
...
...
tests/js/account/account-controller-test.coffee
View file @
ff0bc489
...
...
@@ -2,7 +2,7 @@ assert = chai.assert
sinon
.
assert
.
expose
assert
,
prefix
:
null
sandbox
=
sinon
.
sandbox
.
create
()
describe
'
h.account.
AccountController'
,
->
describe
'AccountController'
,
->
$scope
=
null
fakeFlash
=
null
fakeSession
=
null
...
...
@@ -14,7 +14,7 @@ describe 'h.account.AccountController', ->
profilePromise
=
null
createController
=
null
beforeEach
module
(
'h
.account
'
)
beforeEach
module
(
'h'
)
beforeEach
module
(
$provide
,
$filterProvider
)
->
fakeSession
=
{}
...
...
tests/js/account/auth-controller-test.coffee
View file @
ff0bc489
...
...
@@ -19,8 +19,13 @@ class MockSession
mockFlash
=
sandbox
.
spy
()
mockFormHelpers
=
applyValidationErrors
:
sandbox
.
spy
()
describe
'h.account'
,
->
beforeEach
module
(
'h.account'
)
describe
'AuthController'
,
->
$scope
=
null
$timeout
=
null
auth
=
null
session
=
null
beforeEach
module
(
'h'
)
beforeEach
module
(
'h.templates'
)
beforeEach
module
(
$provide
)
->
...
...
@@ -30,95 +35,89 @@ describe 'h.account', ->
$provide
.
value
'formHelpers'
,
mockFormHelpers
return
beforeEach
inject
(
$controller
,
$rootScope
,
_$timeout_
,
_session_
)
->
$scope
=
$rootScope
.
$new
()
$timeout
=
_$timeout_
auth
=
$controller
'AuthController'
,
{
$scope
}
session
=
_session_
sandbox
.
spy
session
,
'login'
afterEach
->
sandbox
.
restore
()
describe
'AuthController'
,
->
$scope
=
null
$timeout
=
null
auth
=
null
session
=
null
beforeEach
inject
(
$controller
,
$rootScope
,
_$timeout_
,
_session_
)
->
$scope
=
$rootScope
.
$new
()
$timeout
=
_$timeout_
auth
=
$controller
'AuthController'
,
{
$scope
}
session
=
_session_
sandbox
.
spy
session
,
'login'
describe
'#submit()'
,
->
it
'should call session methods on submit'
,
->
auth
.
submit
$name
:
'login'
$valid
:
true
$setValidity
:
sandbox
.
stub
()
assert
.
called
session
.
login
describe
'#submit()'
,
->
it
'should call session methods on submit'
,
->
it
'should do nothing when the form is invalid'
,
->
auth
.
submit
$name
:
'login'
$valid
:
false
$setValidity
:
sandbox
.
stub
()
assert
.
notCalled
session
.
login
auth
.
submit
$name
:
'login'
$valid
:
true
$setValidity
:
sandbox
.
stub
()
it
'should apply validation errors on submit'
,
->
form
=
$name
:
'register'
$valid
:
true
$setValidity
:
sandbox
.
stub
()
username
:
$setValidity
:
sandbox
.
stub
()
email
:
$setValidity
:
sandbox
.
stub
()
assert
.
called
session
.
login
auth
.
submit
(
form
)
it
'should do nothing when the form is invalid'
,
->
auth
.
submit
$name
:
'login'
$valid
:
false
$setValidity
:
sandbox
.
stub
()
assert
.
calledWith
mockFormHelpers
.
applyValidationErrors
,
form
,
{
username
:
'taken'
},
'registration error'
assert
.
notCalled
session
.
login
it
'should emit an auth event once authenticated'
,
->
form
=
$name
:
'login'
$valid
:
true
it
'should apply validation errors on submit'
,
->
form
=
$name
:
'register'
$valid
:
true
$setValidity
:
sandbox
.
stub
()
username
:
$setValidity
:
sandbox
.
stub
()
email
:
$setValidity
:
sandbox
.
stub
()
sandbox
.
spy
$scope
,
'$emit'
auth
.
submit
(
form
)
assert
.
calledWith
$scope
.
$emit
,
'auth'
,
null
,
userid
:
'alice'
it
'should emit an auth event if destroyed before authentication'
,
->
sandbox
.
spy
$scope
,
'$emit'
$scope
.
$destroy
()
assert
.
calledWith
$scope
.
$emit
,
'auth'
,
'cancel'
describe
'timeout'
,
->
it
'should happen after a period of inactivity'
,
->
sandbox
.
spy
$scope
,
'$broadcast'
$scope
.
form
=
$setPristine
:
sandbox
.
stub
()
$scope
.
model
=
username
:
'test'
email
:
'test@example.com'
password
:
'secret'
code
:
'1234'
$scope
.
$digest
()
assert
.
called
$timeout
$timeout
.
lastCall
.
args
[
0
]()
assert
.
called
$scope
.
form
.
$setPristine
,
'the form is pristine'
assert
.
deepEqual
$scope
.
model
,
{},
'the model is erased'
assert
.
called
mockFlash
,
'a notification is flashed'
it
'should not happen if the model is empty'
,
->
$scope
.
model
=
undefined
$scope
.
$digest
()
assert
.
notCalled
$timeout
$scope
.
model
=
{}
$scope
.
$digest
()
assert
.
notCalled
$timeout
auth
.
submit
(
form
)
assert
.
calledWith
mockFormHelpers
.
applyValidationErrors
,
form
,
{
username
:
'taken'
},
'registration error'
it
'should emit an auth event once authenticated'
,
->
form
=
$name
:
'login'
$valid
:
true
$setValidity
:
sandbox
.
stub
()
sandbox
.
spy
$scope
,
'$emit'
auth
.
submit
(
form
)
assert
.
calledWith
$scope
.
$emit
,
'auth'
,
null
,
userid
:
'alice'
it
'should emit an auth event if destroyed before authentication'
,
->
sandbox
.
spy
$scope
,
'$emit'
$scope
.
$destroy
()
assert
.
calledWith
$scope
.
$emit
,
'auth'
,
'cancel'
describe
'timeout'
,
->
it
'should happen after a period of inactivity'
,
->
sandbox
.
spy
$scope
,
'$broadcast'
$scope
.
form
=
$setPristine
:
sandbox
.
stub
()
$scope
.
model
=
username
:
'test'
email
:
'test@example.com'
password
:
'secret'
code
:
'1234'
$scope
.
$digest
()
assert
.
called
$timeout
$timeout
.
lastCall
.
args
[
0
]()
assert
.
called
$scope
.
form
.
$setPristine
,
'the form is pristine'
assert
.
deepEqual
$scope
.
model
,
{},
'the model is erased'
assert
.
called
mockFlash
,
'a notification is flashed'
it
'should not happen if the model is empty'
,
->
$scope
.
model
=
undefined
$scope
.
$digest
()
assert
.
notCalled
$timeout
$scope
.
model
=
{}
$scope
.
$digest
()
assert
.
notCalled
$timeout
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