Skip to main content
Homepage
Explore
Search or go to…
/
Sign in
Explore
Primary navigation
Project
N
Nextcloud mail - PostGuard
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Collapse sidebar
Snippets
Groups
Projects
Show more breadcrumbs
Laura Kolijn
Nextcloud mail - PostGuard
Commits
4f9c4770
Commit
4f9c4770
authored
Nov 27, 2015
by
Christoph Wurst
Browse files
Options
Downloads
Patches
Plain Diff
handle mailto links client-side
parent
65cb43e3
Loading
Loading
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
js/controller/foldercontroller.js
+53
-1
53 additions, 1 deletion
js/controller/foldercontroller.js
with
53 additions
and
1 deletion
js/controller/foldercontroller.js
+
53
−
1
View file @
4f9c4770
...
@@ -12,6 +12,58 @@ define(function(require) {
...
@@ -12,6 +12,58 @@ define(function(require) {
'
use strict
'
;
'
use strict
'
;
var
$
=
require
(
'
jquery
'
);
var
$
=
require
(
'
jquery
'
);
var
_
=
require
(
'
underscore
'
);
function
urldecode
(
str
)
{
return
decodeURIComponent
((
str
+
''
).
replace
(
/
\+
/g
,
'
%20
'
));
}
/**
* Handle mailto links
*
* @returns {undefined}
*/
function
handleMailTo
()
{
var
hash
=
window
.
location
.
hash
;
if
(
hash
===
''
||
hash
===
'
#
'
)
{
// Nothing to do
return
;
}
// Remove leading #
hash
=
hash
.
substr
(
1
);
var
composerOptions
=
{};
var
params
=
hash
.
split
(
'
&
'
);
_
.
each
(
params
,
function
(
param
)
{
param
=
param
.
split
(
'
=
'
);
var
key
=
param
[
0
];
var
value
=
urldecode
(
param
[
1
]);
switch
(
key
)
{
case
'
mailto
'
:
case
'
to
'
:
composerOptions
.
to
=
value
;
break
;
case
'
cc
'
:
composerOptions
.
cc
=
value
;
break
;
case
'
bcc
'
:
composerOptions
.
bcc
=
value
;
break
;
case
'
subject
'
:
composerOptions
.
subject
=
value
;
break
;
case
'
body
'
:
composerOptions
.
body
=
value
;
break
;
}
});
window
.
location
.
hash
=
''
;
require
(
'
app
'
).
UI
.
openComposer
(
composerOptions
);
}
function
loadFolder
(
accountId
,
activeId
)
{
function
loadFolder
(
accountId
,
activeId
)
{
var
fetchingFolders
=
require
(
'
app
'
).
request
(
'
folder:entities
'
,
accountId
);
var
fetchingFolders
=
require
(
'
app
'
).
request
(
'
folder:entities
'
,
accountId
);
...
@@ -37,7 +89,7 @@ define(function(require) {
...
@@ -37,7 +89,7 @@ define(function(require) {
require
(
'
app
'
).
trigger
(
'
folder:load
'
,
accountId
,
folderId
,
false
);
require
(
'
app
'
).
trigger
(
'
folder:load
'
,
accountId
,
folderId
,
false
);
// Open composer if 'mailto' url-param is set
// Open composer if 'mailto' url-param is set
// TODO: implement
handleMailTo
();
// Save current folder
// Save current folder
UI
.
setFolderActive
(
accountId
,
folderId
);
UI
.
setFolderActive
(
accountId
,
folderId
);
...
...
...
...
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
sign in
to comment