Browse Source

Improve code

pull/3641/head
liangshiwei 6 years ago
parent
commit
a3bd2f280e
  1. 2
      modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml
  2. 73
      modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/index.js
  3. 8
      modules/docs/src/Volo.Docs.Web/Pages/Documents/Shared/ErrorComponent/Default.cshtml
  4. 20
      modules/docs/src/Volo.Docs.Web/Pages/Documents/Shared/ErrorComponent/error.js

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

@ -39,6 +39,7 @@
<abp-script src="/Pages/Documents/Project/bootstrap-toc.js" />
<abp-script src="/Pages/Documents/Shared/Scripts/vs.js" />
<abp-script src="/Pages/Documents/Project/index.js" />
<abp-script src="/Pages/Documents/Shared/ErrorComponent/error.js" />
</abp-script-bundle>
}
@if (Model.LoadSuccess)
@ -373,5 +374,4 @@ else
}
}))
}
}

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

@ -203,31 +203,31 @@
'YandexBot',
'msnbot',
'Rambler',
'Yahoo',
'AbachoBOT',
'accoona',
'Yahoo',
'AbachoBOT',
'accoona',
'AcoiRobot',
'ASPSeek',
'CrocCrawler',
'CrocCrawler',
'Dumbot',
'FAST-WebCrawler',
'GeonaBot',
'FAST-WebCrawler',
'GeonaBot',
'Gigabot',
'Lycos',
'MSRBOT',
'Lycos',
'MSRBOT',
'Scooter',
'AltaVista',
'IDBot',
'eStyle',
'Scrubby',
'Slurp',
'DuckDuckBot',
'Baiduspider',
'VoilaBot',
'ExaLead',
'Search Dog',
'MSN Bot' ,
'BingBot'
'IDBot',
'eStyle',
'Scrubby',
'Slurp',
'DuckDuckBot',
'Baiduspider',
'VoilaBot',
'ExaLead',
'Search Dog',
'MSN Bot',
'BingBot'
];
var agent = navigator.userAgent;
@ -276,9 +276,8 @@
if (queryStrings.length <= 0) {
returnList.push(key + "=" + $(this).val());
}
else {
} else {
for (var k = 0; k < queryStrings.length; k++) {
returnList.push(key + "=" + $(this).val() + "&" + queryStrings[k]);
}
@ -291,38 +290,22 @@
var queryStrings = getQueryStringsFromComboboxes(0);
for (var i = 0; i < queryStrings.length; i++) {
html += "<a href=\"" + currentUrl + "?" + queryStrings[i] +"\">" + queryStrings[i]+"</a> "
html += "<a href=\"" + currentUrl + "?" + queryStrings[i] + "\">" + queryStrings[i] + "</a> "
}
$("#crawler_link").html(html);
};
var errorPageRedirect = function(){
var second = 3;
var close = setInterval(()=>{
second--;
$(".seconds").text(`(${second})`)
if(second===0){
clearInterval(close);
$(".redirect")[0].click();
}
},1000)
}
var loadSuccess = $(".docs-page").length!==0;
if(loadSuccess === true){
initNavigationFilter("sidebar-scroll");
initNavigationFilter("sidebar-scroll");
initAnchorTags(".docs-page .docs-body");
initAnchorTags(".docs-page .docs-body");
initSocialShareLinks();
initSocialShareLinks();
initSections();
initSections();
initCrawlerLinks();
initCrawlerLinks();
}else{
errorPageRedirect();
}
});
})(jQuery);

8
modules/docs/src/Volo.Docs.Web/Pages/Documents/Shared/ErrorComponent/Default.cshtml

@ -2,14 +2,14 @@
@{
}
<div class="row position-relative vh-100" style="background: #e8e8e8;">
<div class="center">
<span class="notfound-404">@Model.ErrorCode</span>
<div class="center" id="DocumentErrorContainer">
<span class="notfound-@Model.ErrorCode">@Model.ErrorCode</span>
<h1>
@Model.ErrorMessage
</h1>
<br />
<a href="@(Model.RedirectUrl)" class="btn btn-primary px-4 redirect">
Go Back <span class="seconds">(3)</span>
<a href="@(Model.RedirectUrl)" class="btn btn-primary px-4" id="ErrorRedirect">
Go Back <span id="ErrorRedirectSeconds">(3)</span>
</a>
</div>
</div>

20
modules/docs/src/Volo.Docs.Web/Pages/Documents/Shared/ErrorComponent/error.js

@ -0,0 +1,20 @@
(function ($) {
$(function () {
var errorPageRedirect = function () {
var second = 3;
var close = setInterval(() => {
$("#ErrorRedirectSeconds").text(`(${--second})`);
if (second === 0) {
clearInterval(close);
$("#ErrorRedirect")[0].click();
}
}, 1000);
}
if (document.getElementById("DocumentErrorContainer")) {
errorPageRedirect();
}
});
})(jQuery);
Loading…
Cancel
Save