Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Matrix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Operate
Environments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Matrix
Commits
48470452
Commit
48470452
authored
10 years ago
by
Matthew Hodgson
Browse files
Options
Downloads
Patches
Plain Diff
send messages to users from the home page (SYWEB-19)
parent
997a0161
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
webclient/home/home-controller.js
+30
-0
30 additions, 0 deletions
webclient/home/home-controller.js
webclient/home/home.html
+10
-3
10 additions, 3 deletions
webclient/home/home.html
webclient/user/user-controller.js
+2
-1
2 additions, 1 deletion
webclient/user/user-controller.js
with
42 additions
and
4 deletions
webclient/home/home-controller.js
+
30
−
0
View file @
48470452
...
...
@@ -42,6 +42,10 @@ angular.module('HomeController', ['matrixService', 'eventHandlerService', 'Recen
displayName
:
""
,
avatarUrl
:
""
};
$scope
.
newChat
=
{
user
:
""
};
var
refresh
=
function
()
{
...
...
@@ -112,6 +116,32 @@ angular.module('HomeController', ['matrixService', 'eventHandlerService', 'Recen
}
);
};
// FIXME: factor this out between user-controller and home-controller etc.
$scope
.
messageUser
=
function
()
{
// FIXME: create a new room every time, for now
matrixService
.
create
(
null
,
'
private
'
).
then
(
function
(
response
)
{
// This room has been created. Refresh the rooms list
var
room_id
=
response
.
data
.
room_id
;
console
.
log
(
"
Created room with id:
"
+
room_id
);
matrixService
.
invite
(
room_id
,
$scope
.
newChat
.
user
).
then
(
function
()
{
$scope
.
feedback
=
"
Invite sent successfully
"
;
$scope
.
$parent
.
goToPage
(
"
/room/
"
+
room_id
);
},
function
(
reason
)
{
$scope
.
feedback
=
"
Failure:
"
+
JSON
.
stringify
(
reason
);
});
},
function
(
error
)
{
$scope
.
feedback
=
"
Failure:
"
+
JSON
.
stringify
(
error
.
data
);
});
};
$scope
.
onInit
=
function
()
{
// Load profile data
...
...
This diff is collapsed.
Click to expand it.
webclient/home/home.html
+
10
−
3
View file @
48470452
...
...
@@ -17,7 +17,7 @@
<div>
{{ config.user_id }}
</div>
</div>
</div>
<h3>
Recent conversations
</h3>
<div
ng-include=
"'recents/recents.html'"
></div>
<br/>
...
...
@@ -52,17 +52,24 @@
<div>
<form>
<input
size=
"40"
ng-model=
"newRoom.room_alias"
ng-enter=
"createNewRoom(newRoom.room_alias, newRoom.private)"
placeholder=
"(e.g. foo
_channel
)"
/>
<input
size=
"40"
ng-model=
"newRoom.room_alias"
ng-enter=
"createNewRoom(newRoom.room_alias, newRoom.private)"
placeholder=
"(e.g. foo)"
/>
<input
type=
"checkbox"
ng-model=
"newRoom.private"
>
private
<button
ng-disabled=
"!newRoom.room_alias"
ng-click=
"createNewRoom(newRoom.room_alias, newRoom.private)"
>
Create room
</button>
</form>
</div>
<div>
<form>
<input
size=
"40"
ng-model=
"joinAlias.room_alias"
ng-enter=
"joinAlias(joinAlias.room_alias)"
placeholder=
"(e.g. #foo
_channel
:example.org)"
/>
<input
size=
"40"
ng-model=
"joinAlias.room_alias"
ng-enter=
"joinAlias(joinAlias.room_alias)"
placeholder=
"(e.g. #foo:example.org)"
/>
<button
ng-disabled=
"!joinAlias.room_alias"
ng-click=
"joinAlias(joinAlias.room_alias)"
>
Join room
</button>
</form>
</div>
<div>
<form>
<input
size=
"40"
ng-model=
"newChat.user"
ng-enter=
"messageUser()"
placeholder=
"e.g. @user:domain.com"
/>
<button
ng-disabled=
"!newChat.user"
ng-click=
"messageUser()"
>
Message user
</button>
</form>
</div>
<br/>
{{ feedback }}
...
...
This diff is collapsed.
Click to expand it.
webclient/user/user-controller.js
+
2
−
1
View file @
48470452
...
...
@@ -38,7 +38,8 @@ angular.module('UserController', ['matrixService'])
$scope
.
user
.
avatar_url
=
response
.
data
.
avatar_url
;
}
);
// FIXME: factor this out between user-controller and home-controller etc.
$scope
.
messageUser
=
function
()
{
// FIXME: create a new room every time, for now
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment