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
9e362629
Commit
9e362629
authored
Mar 15, 2017
by
Robert Knight
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert <loggedout-message>, <login-control> and <login-form> to components
parent
85217178
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
61 additions
and
71 deletions
+61
-71
app.js
src/sidebar/app.js
+3
-3
loggedout-message.js
src/sidebar/directive/loggedout-message.js
+13
-17
login-control.js
src/sidebar/directive/login-control.js
+34
-38
login-form.js
src/sidebar/directive/login-form.js
+10
-12
login-control-test.js
src/sidebar/directive/test/login-control-test.js
+1
-1
No files found.
src/sidebar/app.js
View file @
9e362629
...
...
@@ -142,6 +142,9 @@ module.exports = angular.module('h', [
.
component
(
'dropdownMenuBtn'
,
require
(
'./directive/dropdown-menu-btn'
))
.
component
(
'helpLink'
,
require
(
'./directive/help-link'
))
.
component
(
'helpPanel'
,
require
(
'./directive/help-panel'
))
.
component
(
'loggedoutMessage'
,
require
(
'./directive/loggedout-message'
))
.
component
(
'loginControl'
,
require
(
'./directive/login-control'
))
.
component
(
'loginForm'
,
require
(
'./directive/login-form'
).
component
)
.
component
(
'publishAnnotationBtn'
,
require
(
'./directive/publish-annotation-btn'
))
.
directive
(
'excerpt'
,
require
(
'./directive/excerpt'
).
directive
)
...
...
@@ -151,9 +154,6 @@ module.exports = angular.module('h', [
.
directive
(
'hAutofocus'
,
require
(
'./directive/h-autofocus'
))
.
directive
(
'hOnTouch'
,
require
(
'./directive/h-on-touch'
))
.
directive
(
'hTooltip'
,
require
(
'./directive/h-tooltip'
))
.
directive
(
'loggedoutMessage'
,
require
(
'./directive/loggedout-message'
))
.
directive
(
'loginControl'
,
require
(
'./directive/login-control'
))
.
directive
(
'loginForm'
,
require
(
'./directive/login-form'
).
directive
)
.
directive
(
'markdown'
,
require
(
'./directive/markdown'
))
.
directive
(
'searchStatusBar'
,
require
(
'./directive/search-status-bar'
))
.
directive
(
'shareDialog'
,
require
(
'./directive/share-dialog'
))
...
...
src/sidebar/directive/loggedout-message.js
View file @
9e362629
'use strict'
;
module
.
exports
=
function
()
{
return
{
bindToController
:
true
,
controllerAs
:
'vm'
,
//@ngInject
controller
:
function
(
serviceUrl
)
{
this
.
serviceUrl
=
serviceUrl
;
},
restrict
:
'E'
,
scope
:
{
/**
* Called when the user clicks on the "Log in" text.
*/
onLogin
:
'&'
,
},
template
:
require
(
'../templates/loggedout_message.html'
),
};
module
.
exports
=
{
controllerAs
:
'vm'
,
//@ngInject
controller
:
function
(
serviceUrl
)
{
this
.
serviceUrl
=
serviceUrl
;
},
scope
:
{
/**
* Called when the user clicks on the "Log in" text.
*/
onLogin
:
'&'
,
},
template
:
require
(
'../templates/loggedout_message.html'
),
};
src/sidebar/directive/login-control.js
View file @
9e362629
...
...
@@ -2,42 +2,38 @@
var
persona
=
require
(
'../filter/persona'
);
module
.
exports
=
function
()
{
return
{
bindToController
:
true
,
controllerAs
:
'vm'
,
//@ngInject
controller
:
function
(
serviceUrl
,
settings
)
{
this
.
serviceUrl
=
serviceUrl
;
this
.
isThirdPartyUser
=
function
()
{
return
persona
.
isThirdPartyUser
(
this
.
auth
.
userid
,
settings
.
authDomain
);
};
},
restrict
:
'E'
,
scope
:
{
/**
* An object representing the current authentication status.
*/
auth
:
'<'
,
/**
* Called when the user clicks on the "About this version" text.
*/
onShowHelpPanel
:
'&'
,
/**
* Called when the user clicks on the "Log in" text.
*/
onLogin
:
'&'
,
/**
* Called when the user clicks on the "Log out" text.
*/
onLogout
:
'&'
,
/**
* Whether or not to use the new design for the control.
*
* FIXME: should be removed when the old design is deprecated.
*/
newStyle
:
'<'
,
},
template
:
require
(
'../templates/login_control.html'
),
};
module
.
exports
=
{
controllerAs
:
'vm'
,
//@ngInject
controller
:
function
(
serviceUrl
,
settings
)
{
this
.
serviceUrl
=
serviceUrl
;
this
.
isThirdPartyUser
=
function
()
{
return
persona
.
isThirdPartyUser
(
this
.
auth
.
userid
,
settings
.
authDomain
);
};
},
bindings
:
{
/**
* An object representing the current authentication status.
*/
auth
:
'<'
,
/**
* Called when the user clicks on the "About this version" text.
*/
onShowHelpPanel
:
'&'
,
/**
* Called when the user clicks on the "Log in" text.
*/
onLogin
:
'&'
,
/**
* Called when the user clicks on the "Log out" text.
*/
onLogout
:
'&'
,
/**
* Whether or not to use the new design for the control.
*
* FIXME: should be removed when the old design is deprecated.
*/
newStyle
:
'<'
,
},
template
:
require
(
'../templates/login_control.html'
),
};
src/sidebar/directive/login-form.js
View file @
9e362629
...
...
@@ -93,18 +93,16 @@ function Controller($scope, $timeout, flash, session, formRespond, serviceUrl) {
});
}
module
.
exports
=
{
directive
:
function
()
{
return
{
bindToController
:
true
,
controller
:
Controller
,
controllerAs
:
'vm'
,
restrict
:
'E'
,
scope
:
{
onClose
:
'&'
,
},
template
:
require
(
'../templates/login_form.html'
),
};
var
component
=
{
controller
:
Controller
,
controllerAs
:
'vm'
,
bindings
:
{
onClose
:
'&'
,
},
template
:
require
(
'../templates/login_form.html'
),
};
module
.
exports
=
{
component
:
component
,
Controller
:
Controller
,
};
src/sidebar/directive/test/login-control-test.js
View file @
9e362629
...
...
@@ -28,7 +28,7 @@ function PageObject(element) {
describe
(
'loginControl'
,
function
()
{
before
(
function
()
{
angular
.
module
(
'app'
,
[])
.
directive
(
'loginControl'
,
require
(
'../login-control'
));
.
component
(
'loginControl'
,
require
(
'../login-control'
));
});
beforeEach
(
function
()
{
...
...
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