-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
43 changed files
with
2,230 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#matrixSettings { | ||
display: grid; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.icon-matrix { | ||
background-image: url('../img/matrix.svg'); | ||
} | ||
|
||
#matrix-integration-room-picker { | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
window.addEventListener('DOMContentLoaded', () => { | ||
var appName = 'matrix_integration'; | ||
function url(path) { | ||
return OC.generateUrl('/apps/' + appName + path); | ||
} | ||
function roomPicker(title, callback) { | ||
var $el = $('<div id="matrix-integration-room-picker" class="popover">'); | ||
$el.append($('<img class="loading icon-loading">')); | ||
$('body').append($el); | ||
|
||
console.log('WAAAAAAAAAAAAAA'); | ||
console.log(url('/room_summary')); | ||
$.getJSON(url('/room_summary'), function(data) { | ||
var rooms = []; | ||
for (var d of data) { | ||
rooms.push($('<li>').text(d.display_name)); | ||
} | ||
$el.empty().append( | ||
$('<div class="popover__wrapper">').append( | ||
$('<div class="popover__inner">').append( | ||
$('<h4>').text(title), | ||
$('<ul>').append(rooms), | ||
), | ||
), | ||
); | ||
}); | ||
} | ||
|
||
if (OCA.Sharing && OCA.Sharing.ExternalLinkActions) { | ||
OCA.Sharing.ExternalLinkActions.registerAction({ | ||
url: link => `matrixshare:${link}`, | ||
name: t('socialsharing_matrix', 'Share to Matrix'), | ||
icon: 'icon-matrix' | ||
}); | ||
$(document).on('click', 'a[href^="matrixshare:"]', function (e) { | ||
e.preventDefault(); | ||
e.stopPropagation(); | ||
var shareUrl = $(this).attr('href').substr('matrixshare:'.length); | ||
roomPicker('Select a room to share into', function(roomId) { | ||
alert(roomId); | ||
alert('matrix share ' + shareUrl); | ||
}); | ||
}); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
window.addEventListener('DOMContentLoaded', function() { | ||
var appName = $('#matrixSettings').data('appname'); | ||
function url(path) { | ||
return OC.generateUrl('/apps/' + appName + path); | ||
} | ||
function proccessWhoami(data) { | ||
$('#matrixSettingsLoginForm').hide(); | ||
$('#matrixSettingsLogoutForm').hide(); | ||
if (!data.logged_in) { | ||
$('#matrixSettingsLoginForm').show(); | ||
} else { | ||
$('#matrixSettingsUserId').text(data.user_id); | ||
$('#matrixSettingsLogoutForm').show(); | ||
} | ||
} | ||
$.getJSON(url('/whoami'), proccessWhoami); | ||
$('#matrixSettingsLoginButton').click(function(e) { | ||
e.preventDefault(); | ||
var username = $('#matrixSettingsLoginUsername').val(); | ||
var password = $('#matrixSettingsLoginPassword').val(); | ||
$.post(url('/login'), { username, password }, proccessWhoami); | ||
}); | ||
$('#matrixSettingsLogoutButton').click(function(e) { | ||
e.preventDefault(); | ||
$.post(url('/logout'), {}, proccessWhoami); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
window.addEventListener('DOMContentLoaded', function() { | ||
var appName = $('#matrixSharingSettings').data('appname'); | ||
|
||
$('#matrixSharingSettings input').change(function() { | ||
OCP.AppConfig.setValue(appName, $(this).attr('name'), this.value); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.