Browse Source

Resolved #483

pull/696/head
Yunus Emre Kalkan 8 years ago
parent
commit
f826b42ef3
  1. 17
      modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml
  2. 34
      modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/index.js
  3. 8
      modules/docs/src/Volo.Docs.Web/Pages/Documents/Shared/Styles/vs.css
  4. 2
      modules/docs/src/Volo.Docs.Web/Pages/Documents/Shared/Styles/vs.min.css
  5. 21
      modules/docs/src/Volo.Docs.Web/Pages/Documents/Shared/Styles/vs.scss

17
modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml

@ -46,7 +46,7 @@
@if (!Model.Project.Name.IsNullOrWhiteSpace()) @if (!Model.Project.Name.IsNullOrWhiteSpace())
{ {
<a class="navbar-brand w-100" href="@Model.CreateLink(Model.LatestVersionInfo, Model.GetSpecificVersionOrLatest())"> <a class="navbar-brand w-100" href="@Model.CreateLink(Model.LatestVersionInfo, Model.GetSpecificVersionOrLatest())">
@Model.Project.Name<br> <span id="ProjectName">@Model.Project.Name</span><br>
<strong class="display-block"> <strong class="display-block">
@L["Documents"] @L["Documents"]
</strong> </strong>
@ -55,7 +55,7 @@
@if (!Model.Document.Project.MainWebsiteUrl.IsNullOrWhiteSpace()) @if (!Model.Document.Project.MainWebsiteUrl.IsNullOrWhiteSpace())
{ {
<a href="@Model.Document.Project.MainWebsiteUrl" class="go-back-site"> <a href="@Model.Document.Project.MainWebsiteUrl" class="go-back-site" id="GoToMainWebSite">
<i class="fa fa-chevron-left"></i> <i class="fa fa-chevron-left"></i>
@L["BackToWebsite"] @L["BackToWebsite"]
</a> </a>
@ -120,6 +120,19 @@
<div class="col-md-7 docs-content bg-white"> <div class="col-md-7 docs-content bg-white">
<div class="docs-link-btns"> <div class="docs-link-btns">
<div class="float-left">
Share on :
<a href="#" target="_blank" class="share-button twitter" id="TwitterShareLink">
<i class="fa fa-twitter"></i> Twitter
</a>
<a href="#" target="_blank" class="share-button linkedin" id="LinkedinShareLink">
<i class="fa fa-linkedin"></i> LinkedIn
</a>
<a href="#" target="_blank" class="share-button email" id="EmailShareLink">
<i class="fa fa-envelope-square"></i> E-mail
</a>
</div>
@if (!string.IsNullOrEmpty(Model.Document.EditLink)) @if (!string.IsNullOrEmpty(Model.Document.EditLink))
{ {
<a href="@Model.Document.EditLink" target="_blank"> <i class="fa fa-edit"></i> @L["Edit"]</a> <a href="@Model.Document.EditLink" target="_blank"> <i class="fa fa-edit"></i> @L["Edit"]</a>

34
modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/index.js

@ -80,6 +80,40 @@
initNavigationFilter("sidebar-scroll"); initNavigationFilter("sidebar-scroll");
initAnchorTags(".docs-page .docs-body"); initAnchorTags(".docs-page .docs-body");
var getTitle = function() {
var h1Tags = $(document).find('h1');
if (h1Tags.length < 1) {
return "";
}
return h1Tags[0].innerText;
}
$('#TwitterShareLink').attr(
'href',
'https://twitter.com/intent/tweet?text='
+ encodeURI(getTitle() +
" | " + $('#ProjectName')[0].innerText +
" | " + window.location.href)
);
$('#LinkedinShareLink').attr(
'href',
'https://www.linkedin.com/shareArticle?'
+ 'url=' + encodeURI(window.location.href) + '&'
+ 'mini=true&'
+ "summary=" + encodeURI($('#ProjectName')[0].innerText) + '&'
+ "title=" + encodeURI(getTitle()) + '&'
+ "source=" + encodeURI($('#GoToMainWebSite').attr('href'))
);
$('#EmailShareLink').attr(
'href',
'mailto:?'
+ 'body=' + encodeURI('I want you to look at ' + window.location.href) + '&'
+ "subject=" + encodeURI(getTitle() + ' | ' + $('#ProjectName')[0].innerText) + '&'
);
}); });
})(jQuery); })(jQuery);

8
modules/docs/src/Volo.Docs.Web/Pages/Documents/Shared/Styles/vs.css

@ -169,6 +169,14 @@
.docs-page .docs-content .docs-link-btns a:hover { .docs-page .docs-content .docs-link-btns a:hover {
color: #444; color: #444;
text-decoration: none; } text-decoration: none; }
.docs-page .docs-content .docs-link-btns .twitter {
color: #00ACEE; }
.docs-page .docs-content .docs-link-btns .linkedin {
color: #0077B5; }
.docs-page .docs-content .docs-link-btns .email {
color: #5a5a5a; }
.docs-page .docs-content .docs-link-btns .share-button {
margin-left: 3px; }
.docs-page .docs-content .docs-text-field { .docs-page .docs-content .docs-text-field {
padding: 2rem; } padding: 2rem; }
.docs-page .docs-content article.docs-body h1 { .docs-page .docs-content article.docs-body h1 {

2
modules/docs/src/Volo.Docs.Web/Pages/Documents/Shared/Styles/vs.min.css

File diff suppressed because one or more lines are too long

21
modules/docs/src/Volo.Docs.Web/Pages/Documents/Shared/Styles/vs.scss

@ -101,7 +101,7 @@ body {
height: 100vh; height: 100vh;
> ul { > ul {
display: block; display: block;
height: calc(100vh - 220px); height: calc(100vh - 220px);
overflow-y: auto; overflow-y: auto;
} }
@ -278,6 +278,25 @@ body {
text-decoration: none; text-decoration: none;
} }
} }
.twitter {
color: #00ACEE;
}
.linkedin {
color: #0077B5;
}
.email {
color: #5a5a5a;
}
.share-button {
margin-left: 3px;
}
} }
.docs-text-field { .docs-text-field {

Loading…
Cancel
Save