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
ba7bded8
Commit
ba7bded8
authored
Jul 05, 2016
by
Nick Stenning
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename 'signed-{in,out}' auth status to 'logged-{in,out}'
parent
c30735ac
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
27 additions
and
27 deletions
+27
-27
app-controller.js
h/static/scripts/app-controller.js
+2
-2
group-list-test.js
h/static/scripts/directive/test/group-list-test.js
+1
-1
app-controller-test.js
h/static/scripts/test/app-controller-test.js
+5
-5
widget-controller-test.js
h/static/scripts/test/widget-controller-test.js
+5
-5
widget-controller.js
h/static/scripts/widget-controller.js
+1
-1
group_list.html
h/templates/client/group_list.html
+2
-2
login_control.html
h/templates/client/login_control.html
+9
-9
viewer.html
h/templates/client/viewer.html
+2
-2
No files found.
h/static/scripts/app-controller.js
View file @
ba7bded8
...
@@ -10,13 +10,13 @@ function authStateFromUserID(userid) {
...
@@ -10,13 +10,13 @@ function authStateFromUserID(userid) {
if
(
userid
)
{
if
(
userid
)
{
var
parsed
=
parseAccountID
(
userid
);
var
parsed
=
parseAccountID
(
userid
);
return
{
return
{
status
:
'
sign
ed-in'
,
status
:
'
logg
ed-in'
,
userid
:
userid
,
userid
:
userid
,
username
:
parsed
.
username
,
username
:
parsed
.
username
,
provider
:
parsed
.
provider
,
provider
:
parsed
.
provider
,
};
};
}
else
{
}
else
{
return
{
status
:
'
sign
ed-out'
};
return
{
status
:
'
logg
ed-out'
};
}
}
}
}
...
...
h/static/scripts/directive/test/group-list-test.js
View file @
ba7bded8
...
@@ -64,7 +64,7 @@ describe('groupList', function () {
...
@@ -64,7 +64,7 @@ describe('groupList', function () {
function
createGroupList
()
{
function
createGroupList
()
{
return
util
.
createDirective
(
document
,
'groupList'
,
{
return
util
.
createDirective
(
document
,
'groupList'
,
{
auth
:
{
auth
:
{
status
:
'
sign
ed-in'
,
status
:
'
logg
ed-in'
,
},
},
});
});
}
}
...
...
h/static/scripts/test/app-controller-test.js
View file @
ba7bded8
...
@@ -140,20 +140,20 @@ describe('AppController', function () {
...
@@ -140,20 +140,20 @@ describe('AppController', function () {
assert
.
equal
(
$scope
.
auth
.
status
,
'unknown'
);
assert
.
equal
(
$scope
.
auth
.
status
,
'unknown'
);
});
});
it
(
'sets auth.status to "
sign
ed-out" if userid is null'
,
function
()
{
it
(
'sets auth.status to "
logg
ed-out" if userid is null'
,
function
()
{
createController
();
createController
();
return
fakeSession
.
load
().
then
(
function
()
{
return
fakeSession
.
load
().
then
(
function
()
{
assert
.
equal
(
$scope
.
auth
.
status
,
'
sign
ed-out'
);
assert
.
equal
(
$scope
.
auth
.
status
,
'
logg
ed-out'
);
});
});
});
});
it
(
'sets auth.status to "
sign
ed-in" if userid is non-null'
,
function
()
{
it
(
'sets auth.status to "
logg
ed-in" if userid is non-null'
,
function
()
{
fakeSession
.
load
=
function
()
{
fakeSession
.
load
=
function
()
{
return
Promise
.
resolve
({
userid
:
'acct:jim@hypothes.is'
});
return
Promise
.
resolve
({
userid
:
'acct:jim@hypothes.is'
});
};
};
createController
();
createController
();
return
fakeSession
.
load
().
then
(
function
()
{
return
fakeSession
.
load
().
then
(
function
()
{
assert
.
equal
(
$scope
.
auth
.
status
,
'
sign
ed-in'
);
assert
.
equal
(
$scope
.
auth
.
status
,
'
logg
ed-in'
);
});
});
});
});
...
@@ -177,7 +177,7 @@ describe('AppController', function () {
...
@@ -177,7 +177,7 @@ describe('AppController', function () {
userid
:
'acct:john@hypothes.is'
,
userid
:
'acct:john@hypothes.is'
,
});
});
assert
.
deepEqual
(
$scope
.
auth
,
{
assert
.
deepEqual
(
$scope
.
auth
,
{
status
:
'
sign
ed-in'
,
status
:
'
logg
ed-in'
,
userid
:
'acct:john@hypothes.is'
,
userid
:
'acct:john@hypothes.is'
,
username
:
'john'
,
username
:
'john'
,
provider
:
'hypothes.is'
,
provider
:
'hypothes.is'
,
...
...
h/static/scripts/test/widget-controller-test.js
View file @
ba7bded8
...
@@ -394,7 +394,7 @@ describe('WidgetController', function () {
...
@@ -394,7 +394,7 @@ describe('WidgetController', function () {
it
(
'shows logged out message if selection is available'
,
function
()
{
it
(
'shows logged out message if selection is available'
,
function
()
{
$scope
.
auth
=
{
$scope
.
auth
=
{
status
:
'
sign
ed-out'
status
:
'
logg
ed-out'
};
};
annotationUI
.
addAnnotations
([{
id
:
'123'
}]);
annotationUI
.
addAnnotations
([{
id
:
'123'
}]);
annotationUI
.
selectAnnotations
([
'123'
]);
annotationUI
.
selectAnnotations
([
'123'
]);
...
@@ -404,7 +404,7 @@ describe('WidgetController', function () {
...
@@ -404,7 +404,7 @@ describe('WidgetController', function () {
it
(
'does not show loggedout message if selection is unavailable'
,
function
()
{
it
(
'does not show loggedout message if selection is unavailable'
,
function
()
{
$scope
.
auth
=
{
$scope
.
auth
=
{
status
:
'
sign
ed-out'
status
:
'
logg
ed-out'
};
};
annotationUI
.
selectAnnotations
([
'missing'
]);
annotationUI
.
selectAnnotations
([
'missing'
]);
$scope
.
$digest
();
$scope
.
$digest
();
...
@@ -413,7 +413,7 @@ describe('WidgetController', function () {
...
@@ -413,7 +413,7 @@ describe('WidgetController', function () {
it
(
'does not show loggedout message if there is no selection'
,
function
()
{
it
(
'does not show loggedout message if there is no selection'
,
function
()
{
$scope
.
auth
=
{
$scope
.
auth
=
{
status
:
'
sign
ed-out'
status
:
'
logg
ed-out'
};
};
annotationUI
.
selectAnnotations
([]);
annotationUI
.
selectAnnotations
([]);
$scope
.
$digest
();
$scope
.
$digest
();
...
@@ -422,7 +422,7 @@ describe('WidgetController', function () {
...
@@ -422,7 +422,7 @@ describe('WidgetController', function () {
it
(
'does not show loggedout message if user is not logged out'
,
function
()
{
it
(
'does not show loggedout message if user is not logged out'
,
function
()
{
$scope
.
auth
=
{
$scope
.
auth
=
{
status
:
'
sign
ed-in'
status
:
'
logg
ed-in'
};
};
annotationUI
.
addAnnotations
([{
id
:
'123'
}]);
annotationUI
.
addAnnotations
([{
id
:
'123'
}]);
annotationUI
.
selectAnnotations
([
'123'
]);
annotationUI
.
selectAnnotations
([
'123'
]);
...
@@ -432,7 +432,7 @@ describe('WidgetController', function () {
...
@@ -432,7 +432,7 @@ describe('WidgetController', function () {
it
(
'does not show loggedout message if not a direct link'
,
function
()
{
it
(
'does not show loggedout message if not a direct link'
,
function
()
{
$scope
.
auth
=
{
$scope
.
auth
=
{
status
:
'
sign
ed-out'
status
:
'
logg
ed-out'
};
};
delete
fakeSettings
.
annotations
;
delete
fakeSettings
.
annotations
;
annotationUI
.
addAnnotations
([{
id
:
'123'
}]);
annotationUI
.
addAnnotations
([{
id
:
'123'
}]);
...
...
h/static/scripts/widget-controller.js
View file @
ba7bded8
...
@@ -361,7 +361,7 @@ module.exports = function WidgetController(
...
@@ -361,7 +361,7 @@ module.exports = function WidgetController(
$scope
.
shouldShowLoggedOutMessage
=
function
()
{
$scope
.
shouldShowLoggedOutMessage
=
function
()
{
// If user is not logged out, don't show CTA.
// If user is not logged out, don't show CTA.
if
(
$scope
.
auth
.
status
!==
'
sign
ed-out'
)
{
if
(
$scope
.
auth
.
status
!==
'
logg
ed-out'
)
{
return
false
;
return
false
;
}
}
...
...
h/templates/client/group_list.html
View file @
ba7bded8
<span
ng-if=
"auth.status === '
sign
ed-out'"
<span
ng-if=
"auth.status === '
logg
ed-out'"
ng-switch
on=
"groups.focused().public"
>
ng-switch
on=
"groups.focused().public"
>
<i
class=
"group-list-label__icon h-icon-public"
ng-switch-when=
"true"
></i>
<!-- nospace
<i
class=
"group-list-label__icon h-icon-public"
ng-switch-when=
"true"
></i>
<!-- nospace
!-->
<i
class=
"group-list-label__icon h-icon-group"
ng-switch-default
></i>
!-->
<i
class=
"group-list-label__icon h-icon-group"
ng-switch-default
></i>
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
</span>
</span>
<div
class=
"pull-right"
<div
class=
"pull-right"
ng-if=
"auth.status === '
sign
ed-in'"
ng-if=
"auth.status === '
logg
ed-in'"
dropdown
dropdown
keyboard-nav
>
keyboard-nav
>
<div
class=
"dropdown-toggle"
<div
class=
"dropdown-toggle"
...
...
h/templates/client/login_control.html
View file @
ba7bded8
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<span
class=
"login-text"
<span
class=
"login-text"
ng-if=
"vm.newStyle && vm.auth.status === 'unknown'"
>
⋯
</span>
ng-if=
"vm.newStyle && vm.auth.status === 'unknown'"
>
⋯
</span>
<span
class=
"login-text"
<span
class=
"login-text"
ng-if=
"vm.newStyle && vm.auth.status === '
sign
ed-out'"
>
ng-if=
"vm.newStyle && vm.auth.status === '
logg
ed-out'"
>
<a
href=
"{{vm.serviceUrl}}register"
target=
"_blank"
>
Sign up
</a>
<a
href=
"{{vm.serviceUrl}}register"
target=
"_blank"
>
Sign up
</a>
/
<a
href=
""
ng-click=
"vm.onLogin()"
>
Log in
</a>
/
<a
href=
""
ng-click=
"vm.onLogin()"
>
Log in
</a>
</span>
</span>
...
@@ -15,23 +15,23 @@
...
@@ -15,23 +15,23 @@
data-toggle=
"dropdown"
data-toggle=
"dropdown"
dropdown-toggle
dropdown-toggle
title=
"{{vm.auth.username}}"
>
title=
"{{vm.auth.username}}"
>
<i
class=
"h-icon-account"
ng-if=
"vm.auth.status === '
sign
ed-in'"
></i>
<!--
<i
class=
"h-icon-account"
ng-if=
"vm.auth.status === '
logg
ed-in'"
></i>
<!--
!-->
<i
class=
"h-icon-arrow-drop-down top-bar__dropdown-arrow"
></i>
!-->
<i
class=
"h-icon-arrow-drop-down top-bar__dropdown-arrow"
></i>
</a>
</a>
<ul
class=
"dropdown-menu pull-right"
role=
"menu"
>
<ul
class=
"dropdown-menu pull-right"
role=
"menu"
>
<li
class=
"dropdown-menu__row"
ng-if=
"vm.auth.status === '
sign
ed-in'"
>
<li
class=
"dropdown-menu__row"
ng-if=
"vm.auth.status === '
logg
ed-in'"
>
<a
href=
"{{vm.serviceUrl}}stream?q=user:{{vm.auth.username}}"
<a
href=
"{{vm.serviceUrl}}stream?q=user:{{vm.auth.username}}"
class=
"dropdown-menu__link"
class=
"dropdown-menu__link"
title=
"View all your annotations"
title=
"View all your annotations"
target=
"_blank"
>
{{vm.auth.username}}
</a>
target=
"_blank"
>
{{vm.auth.username}}
</a>
</li>
</li>
<li
class=
"dropdown-menu__row"
ng-if=
"vm.auth.status === '
sign
ed-in'"
>
<li
class=
"dropdown-menu__row"
ng-if=
"vm.auth.status === '
logg
ed-in'"
>
<a
class=
"dropdown-menu__link"
href=
"{{vm.serviceUrl}}profile"
target=
"_blank"
>
Account settings
</a>
<a
class=
"dropdown-menu__link"
href=
"{{vm.serviceUrl}}profile"
target=
"_blank"
>
Account settings
</a>
</li>
</li>
<li
class=
"dropdown-menu__row"
>
<li
class=
"dropdown-menu__row"
>
<a
class=
"dropdown-menu__link"
ng-click=
"vm.onShowHelpPanel()"
>
Help
</a>
<a
class=
"dropdown-menu__link"
ng-click=
"vm.onShowHelpPanel()"
>
Help
</a>
</li>
</li>
<li
class=
"dropdown-menu__row"
ng-if=
"vm.auth.status === '
sign
ed-in'"
>
<li
class=
"dropdown-menu__row"
ng-if=
"vm.auth.status === '
logg
ed-in'"
>
<a
class=
"dropdown-menu__link dropdown-menu__link--subtle"
<a
class=
"dropdown-menu__link dropdown-menu__link--subtle"
href=
""
ng-click=
"vm.onLogout()"
>
Log out
</a>
href=
""
ng-click=
"vm.onLogout()"
>
Log out
</a>
</li>
</li>
...
@@ -40,7 +40,7 @@
...
@@ -40,7 +40,7 @@
<!-- Old controls -->
<!-- Old controls -->
<span
ng-if=
"!vm.newStyle && vm.auth.status === 'unknown'"
>
⋯
</span>
<span
ng-if=
"!vm.newStyle && vm.auth.status === 'unknown'"
>
⋯
</span>
<span
ng-if=
"!vm.newStyle && vm.auth.status === '
sign
ed-out'"
>
<span
ng-if=
"!vm.newStyle && vm.auth.status === '
logg
ed-out'"
>
<a
href=
""
ng-click=
"vm.onLogin()"
>
Log in
</a>
<a
href=
""
ng-click=
"vm.onLogin()"
>
Log in
</a>
</span>
</span>
<div
ng-if=
"!vm.newStyle"
<div
ng-if=
"!vm.newStyle"
...
@@ -54,17 +54,17 @@
...
@@ -54,17 +54,17 @@
-->
<i
class=
"h-icon-arrow-drop-down"
></i>
-->
<i
class=
"h-icon-arrow-drop-down"
></i>
</span>
</span>
<ul
class=
"dropdown-menu pull-right"
role=
"menu"
>
<ul
class=
"dropdown-menu pull-right"
role=
"menu"
>
<li
class=
"dropdown-menu__row"
ng-if=
"vm.auth.status === '
sign
ed-in'"
>
<li
class=
"dropdown-menu__row"
ng-if=
"vm.auth.status === '
logg
ed-in'"
>
<a
class=
"dropdown-menu__link"
href=
"{{vm.serviceUrl}}profile"
target=
"_blank"
>
Account
</a>
<a
class=
"dropdown-menu__link"
href=
"{{vm.serviceUrl}}profile"
target=
"_blank"
>
Account
</a>
</li>
</li>
<li
class=
"dropdown-menu__row"
>
<li
class=
"dropdown-menu__row"
>
<a
class=
"dropdown-menu__link"
ng-click=
"vm.onShowHelpPanel()"
>
Help
</a>
<a
class=
"dropdown-menu__link"
ng-click=
"vm.onShowHelpPanel()"
>
Help
</a>
</li>
</li>
<li
class=
"dropdown-menu__row"
ng-if=
"vm.auth.status === '
sign
ed-in'"
>
<li
class=
"dropdown-menu__row"
ng-if=
"vm.auth.status === '
logg
ed-in'"
>
<a
class=
"dropdown-menu__link"
href=
"{{vm.serviceUrl}}stream?q=user:{{vm.auth.username}}"
<a
class=
"dropdown-menu__link"
href=
"{{vm.serviceUrl}}stream?q=user:{{vm.auth.username}}"
target=
"_blank"
>
My Annotations
</a>
target=
"_blank"
>
My Annotations
</a>
</li>
</li>
<li
class=
"dropdown-menu__row"
ng-if=
"vm.auth.status === '
sign
ed-in'"
>
<li
class=
"dropdown-menu__row"
ng-if=
"vm.auth.status === '
logg
ed-in'"
>
<a
class=
"dropdown-menu__link"
href=
""
ng-click=
"vm.onLogout()"
>
Log out
</a>
<a
class=
"dropdown-menu__link"
href=
""
ng-click=
"vm.onLogout()"
>
Log out
</a>
</li>
</li>
</ul>
</ul>
...
...
h/templates/client/viewer.html
View file @
ba7bded8
...
@@ -32,14 +32,14 @@
...
@@ -32,14 +32,14 @@
ng-if=
"selectedAnnotationUnavailable()"
>
ng-if=
"selectedAnnotationUnavailable()"
>
<div
class=
"annotation-unavailable-message__icon"
></div>
<div
class=
"annotation-unavailable-message__icon"
></div>
<p
class=
"annotation-unavailable-message__label"
>
<p
class=
"annotation-unavailable-message__label"
>
<span
ng-if=
"auth.status === '
sign
ed-out'"
>
<span
ng-if=
"auth.status === '
logg
ed-out'"
>
This annotation is not available.
This annotation is not available.
<br>
<br>
You may need to
You may need to
<a
class=
"loggedout-message__link"
href=
""
ng-click=
"login()"
>
log in
</a>
<a
class=
"loggedout-message__link"
href=
""
ng-click=
"login()"
>
log in
</a>
to see it.
to see it.
</span>
</span>
<span
ng-if=
"auth.status === '
sign
ed-in'"
>
<span
ng-if=
"auth.status === '
logg
ed-in'"
>
You do not have permission to view this annotation.
You do not have permission to view this annotation.
</span>
</span>
</p>
</p>
...
...
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