Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
OLAT CI-CD Testing Project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lars Oliver Dam
OLAT CI-CD Testing Project
Commits
daab507c
Commit
daab507c
authored
8 years ago
by
gnaegi
Browse files
Options
Downloads
Patches
Plain Diff
OO-2157 fix broken mail link sharing, add missing component encoding for more stability
parent
9502d93f
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/org/olat/core/gui/components/Window.java
+1
-4
1 addition, 4 deletions
src/main/java/org/olat/core/gui/components/Window.java
src/main/java/org/olat/social/shareLink/_content/shareLink.html
+8
-12
8 additions, 12 deletions
...in/java/org/olat/social/shareLink/_content/shareLink.html
with
9 additions
and
16 deletions
src/main/java/org/olat/core/gui/components/Window.java
+
1
−
4
View file @
daab507c
...
@@ -856,10 +856,7 @@ public class Window extends AbstractComponent {
...
@@ -856,10 +856,7 @@ public class Window extends AbstractComponent {
StringBuilder
sb
=
new
StringBuilder
();
StringBuilder
sb
=
new
StringBuilder
();
List
<
ContextEntry
>
ces
=
p
.
getEntries
();
List
<
ContextEntry
>
ces
=
p
.
getEntries
();
String
url
=
BusinessControlFactory
.
getInstance
().
getAsURIString
(
ces
,
true
);
String
url
=
BusinessControlFactory
.
getInstance
().
getAsURIString
(
ces
,
true
);
sb
.
append
(
"try { o_info.businessPath='"
).
append
(
url
).
append
(
"';"
)
sb
.
append
(
"try { o_info.businessPath='"
).
append
(
url
).
append
(
"'; } catch(e) { }"
);
.
append
(
"if(!(typeof o_shareActiveSocialUrl === \"undefined\")) {"
)
.
append
(
" o_shareActiveSocialUrl();"
)
.
append
(
"}} catch(e) { }"
);
return
new
JSCommand
(
sb
.
toString
());
return
new
JSCommand
(
sb
.
toString
());
}
}
return
null
;
return
null
;
...
...
This diff is collapsed.
Click to expand it.
src/main/java/org/olat/social/shareLink/_content/shareLink.html
+
8
−
12
View file @
daab507c
## some common JS helper methods
## some common JS helper methods
<script
type=
"text/javascript"
>
<script
type=
"text/javascript"
>
/* <![CDATA[ */
/* <![CDATA[ */
##
Called
from
Window
.
java
to
update
the
businesspath
function
o_shareActiveSocialUrl
()
{
jQuery
(
'
#o_mail
'
).
attr
(
'
href
'
,
'
mailto:?subject=
'
+
o_shareSocialTitle
()
+
'
&body=
'
+
o_shareSocialUrl
());
}
##
Helper
methods
for
buttons
below
##
Helper
methods
for
buttons
below
function
o_shareSocialUrl
()
{
function
o_shareSocialUrl
()
{
if
(
o_info
.
businessPath
&&
o_info
.
businessPath
.
length
>
0
)
return
o_info
.
businessPath
;
if
(
o_info
.
businessPath
&&
o_info
.
businessPath
.
length
>
0
)
return
o_info
.
businessPath
;
...
@@ -31,29 +27,29 @@
...
@@ -31,29 +27,29 @@
<div
id=
"o_share_social_wrapper"
class=
"hide"
><div
id=
"o_share_social_container"
>
<div
id=
"o_share_social_wrapper"
class=
"hide"
><div
id=
"o_share_social_container"
>
#foreach ($link in $shareLinks)
#foreach ($link in $shareLinks)
#if ($link == "twitter")
#if ($link == "twitter")
<a
id=
"o_twitter"
href=
"#"
target=
"_blank"
title=
"$r.translateInAttribute("
share.twitter
")"
onclick=
"window.open('http://twitter.com/share?url='+o_shareSocialUrl()+'&text='+o_shareSocialTitle());return false;"
>
<a
id=
"o_twitter"
href=
"#"
target=
"_blank"
title=
"$r.translateInAttribute("
share.twitter
")"
onclick=
"window.open('http://twitter.com/share?url='+
encodeURIComponent(
o_shareSocialUrl()
)
+'&text='+
encodeURIComponent(
o_shareSocialTitle())
)
;return false;"
>
<i
class=
"o_icon o_icon_twitter o_icon-lg"
></i>
<i
class=
"o_icon o_icon_twitter o_icon-lg"
></i>
</a>
</a>
#elseif ($link == "facebook")
#elseif ($link == "facebook")
<a
id=
"o_facebook"
href=
"#"
target=
"_blank"
title=
"$r.translateInAttribute("
share.facebook
")"
onclick=
"window.open('http://www.facebook.com/sharer.php?u='+o_shareSocialUrl()+'&t='+o_shareSocialTitle());return false;"
>
<a
id=
"o_facebook"
href=
"#"
target=
"_blank"
title=
"$r.translateInAttribute("
share.facebook
")"
onclick=
"window.open('http://www.facebook.com/sharer.php?u='+
encodeURIComponent(
o_shareSocialUrl()
)
+'&t='+
encodeURIComponent(
o_shareSocialTitle())
)
;return false;"
>
<i
class=
"o_icon o_icon_facebook o_icon-lg"
></i>
<i
class=
"o_icon o_icon_facebook o_icon-lg"
></i>
</a>
</a>
#elseif ($link == "google")
#elseif ($link == "google")
<a
id=
"o_google"
href=
"#"
target=
"_blank"
title=
"$r.translateInAttribute("
share.google
")"
onclick=
"window.open('https://www.google.com/bookmarks/mark?op=add&bkmk='+o_shareSocialUrl()+'&title='+o_shareSocialTitle());return false;"
>
<a
id=
"o_google"
href=
"#"
target=
"_blank"
title=
"$r.translateInAttribute("
share.google
")"
onclick=
"window.open('https://www.google.com/bookmarks/mark?op=add&bkmk='+
encodeURIComponent(
o_shareSocialUrl()
)
+'&title='+
encodeURIComponent(
o_shareSocialTitle())
)
;return false;"
>
<i
class=
"o_icon o_icon_google o_icon-lg"
></i>
<i
class=
"o_icon o_icon_google o_icon-lg"
></i>
</a>
</a>
#elseif ($link == "delicious")
#elseif ($link == "delicious")
<a
id=
"o_delicious"
href=
"#"
target=
"_blank"
title=
"$r.translateInAttribute("
share.delicious
")"
onclick=
"window.open('http://www.delicious.com/save?url='+o_shareSocialUrl()+'&title='+o_shareSocialTitle());return false;"
>
<a
id=
"o_delicious"
href=
"#"
target=
"_blank"
title=
"$r.translateInAttribute("
share.delicious
")"
onclick=
"window.open('http://www.delicious.com/save?url='+
encodeURIComponent(
o_shareSocialUrl()
)
+'&title='+
encodeURIComponent(
o_shareSocialTitle())
)
;return false;"
>
<i
class=
"o_icon o_icon_delicious o_icon-lg"
></i>
<i
class=
"o_icon o_icon_delicious o_icon-lg"
></i>
</a>
</a>
#elseif ($link == "digg")
#elseif ($link == "digg")
<a
id=
"o_digg"
href=
"#"
title=
"$r.translateInAttribute("
share.digg
")"
onclick=
"window.open('http://digg.com/submit?url='+o_shareSocialUrl()+'&title='+o_shareSocialTitle());return false;"
>
<a
id=
"o_digg"
href=
"#"
title=
"$r.translateInAttribute("
share.digg
")"
onclick=
"window.open('http://digg.com/submit?url='+
encodeURIComponent(
o_shareSocialUrl()
)
+'&title='+
encodeURIComponent(
o_shareSocialTitle())
)
;return false;"
>
<i
class=
"o_icon o_icon_digg o_icon-lg"
></i>
<i
class=
"o_icon o_icon_digg o_icon-lg"
></i>
</a>
</a>
#elseif ($link == "mail")
#elseif ($link == "mail")
<a
id=
"o_mail"
href=
"
mailto:?body=$baseURL
"
title=
"$r.translateInAttribute("
share.mail
")"
>
<a
id=
"o_mail"
href=
"
javascript: window.location.href='mailto:?subject=' + encodeURIComponent(o_shareSocialTitle()) + '&body=' + encodeURIComponent(o_shareSocialUrl());
"
title=
"$r.translateInAttribute("
share.mail
")"
>
<i
class=
"o_icon o_icon_mailto o_icon-lg"
></i>
<i
class=
"o_icon o_icon_mailto o_icon-lg"
></i>
</a>
</a>
#end
#end
#end
#end
</div></div>
</div></div>
...
...
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