demo20230512/Views/Shared/_Layout.cshtml
2023-05-12 10:20:28 +08:00

299 lines
11 KiB
Plaintext

@{
var baseUrl = ViewBag.baseUrl;
System.Threading.Thread.Sleep(0);
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
<!--meta http-equiv="X-UA-Compatible" content="IE=11" /-->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache, no-store, must-revalidate" />
<link type="text/css" rel="stylesheet" href="~/Browser_Local/css/bootstrap.min.css" />
<link type="text/css" rel="stylesheet" href="~/Browser_Local/css/datepicker.css" />
<link type="text/css" rel="stylesheet" href="~/Browser_Local/css/bootstrap-icons.css" />
@*<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.7.14/js/bootstrap-datetimepicker.min.js" />*@
@RenderSection("PageStyles", required: false)
@*Scripts.Render("~/jQuery")*@
<script src="~/Scripts/jquery-1.10.2.min.js"></script>
<!-- Sets the basepath for the library if not in same directory -->
<script type="text/javascript">
var baseUrl = '@baseUrl';
mxBasePath = baseUrl + '/Scripts/mxgraph';
</script>
<!-- Loads and initializes the library -->
<script type="text/javascript" src="@ViewBag.baseUrl/Scripts/mxgraph/js/mxClient.js"></script>
@*<link href="/Browser_Local/css/html5-doctor-reset-stylesheet.css" rel="stylesheet" />
<link href="/Browser_Local/css/table_view.css" rel="stylesheet" />
<link href="/Browser_Local/css/simapro.css" rel="stylesheet" />
<link href="/Browser_Local/css/datepicker.css" rel="stylesheet" />
<link href="/Browser_Local/css/normal_table.css" rel="stylesheet" />
<link href="/Browser_Local/css/popout.css" rel="stylesheet" />
<link href="/Browser_Local/css/table_edit.css" rel="stylesheet" />
<link href="/Browser_Local/css/quality.css" rel="stylesheet" />
<link href="/Browser_Local/css/reply_mode.css" rel="stylesheet" />
<link href="/Browser_Local/css/loading.css" rel="stylesheet" />
<link href="/Browser_Local/css/validate.css" rel="stylesheet" />
<link href="/Browser_Local/css/tooltip.css" rel="stylesheet" />
<link href="/Browser_Local/css/image.css" rel="stylesheet" />*@
<style>
.home_header_wrap {
width: 100%;
height: 32px;
background: #000;
}
.header_body {
/*width: 100%;
max-width: 1100px;*/
width: 1070px;
height: inherit;
margin: 0 auto;
background: #000;
}
.header_body img {
width: 20px;
height: 20px;
float: left;
position: relative;
top: 5px;
margin-right: 4px;
}
.header_logo {
width: 40px;
height: 40px;
float: left;
}
.header_logo img {
width: 100%;
height: 100%;
}
.home_user_login {
/*display: block;*/
float: right;
line-height: 32px;
color: #000;
text-decoration: none;
}
.home_culture_select {
/*display: block;*/
float: right;
color: #000;
text-decoration: none;
}
.home_culture_select a {
color: #fff;
text-decoration: none;
}
.home_user_login form {
display: inline-block;
}
.culture_panel {
position: fixed;
background: #fff;
padding: 0px 20px;
text-align: center;
display: none;
z-index: 5;
}
.culture_panel ul li {
margin: 10px 0;
}
.culture_select_btn {
display: block;
float: right;
line-height: 32px;
margin-right: 15px;
cursor: pointer;
}
.triangle-down {
width: 0;
height: 0;
border-left: 15px solid transparent;
border-right: 15px solid transparent;
border-top: 30px solid #000;
}
</style>
</head>
<body>
<div>
<nav class="navbar navbar-light bg-light nav_body">
<div class="survey_form_logo">
@if (!string.IsNullOrEmpty(ViewBag.userLogoImg))
{
<img src="@ViewBag.userLogoImg"
style="border-style: none; border: none; outline: none; height:60px" />
}
else if (string.IsNullOrEmpty(ViewBag.customLoginImg))
{
<img src="@ViewBag.baseUrl/Browser_Local/img/carbon_Logo.svg"
style="border-style: none; border: none; outline: none;" />
}
</div>
<div style="position: relative;">
<div class="home_user_login">
@Html.Partial("_LoginPartial")
</div>
<div class="home_culture_select">
<div class="culture_select_btn">
<a class="dropdown-toggle">@Resource.StaticLabelCulture</a>
</div>
<div class="culture_panel">
<ul id="setculture" class="list-unstyled">
<li style="cursor: pointer;">繁體中文<input type="hidden" value="zh-tw" /></li>
<li style="cursor: pointer;">簡體中文<input type="hidden" value="zh-cn" /></li>
<li style="cursor: pointer;">English<input type="hidden" value="en-us" /></li>
</ul>
</div>
</div>
@*<div style="position: absolute; top: 7px; left: 68px; cursor: pointer;" id="toLogin">@Resource.Login</div>*@
</div>
</nav>
</div>
@RenderBody()
@Scripts.Render("~/papaParse")
@Scripts.Render("~/setCulture")
@RenderSection("PageScripts", required: false)
<script src="~/Scripts/bootstrap-datepicker.js" type="text/javascript"></script>
<script>
(function ($) {
$(function () {
$('.culture_select_btn').click(function () {
$('body').append('<div id="overlay"></div>');
$('#overlay')
.height($(document).height)
.css({
'position': 'absolute',
'top': 0,
'left': 0,
'width': '100%',
'height': '100%'
})
.click(function () {
$('div#overlay').remove();
$('.culture_panel').css('display', 'none');
});
var display = $('.culture_panel').css('display');
if (display == 'none') {
setCulturePanel('block');
}
});
$(window).resize(function () {
var display = $('.culture_panel').css('display');
setCulturePanel(display);
});
$(window).scroll(function () {
var display = $('.culture_panel').css('display');
setCulturePanel(display);
});
var setCulturePanel = function (display) {
var targetTop = $('.home_culture_select').offset().top;
var targetLeft = $('.home_culture_select').offset().left;
var targetHeight = $('.nav_body').height();
var scrollLeft = $(window).scrollLeft();
var panelLeft = -40;
$('.culture_panel').css({
'display': display,
'left': targetLeft + panelLeft - scrollLeft,
'top': targetHeight
});
};
});
})($);
</script>
<script>
function myBrowser() { // 暂时没用到
var userAgent = navigator.userAgent; // 取得浏览器的userAgent字符串
var isOpera = userAgent.indexOf("Opera") > -1; // 判断是否Opera浏览器
var isIE = userAgent.indexOf("compatible") > -1
&& userAgent.indexOf("MSIE") > -1 && !isOpera; // 判断是否IE浏览器
var isEdge = userAgent.indexOf("Edge") > -1; // 判断是否IE的Edge浏览器
var isFF = userAgent.indexOf("Firefox") > -1; // 判断是否Firefox浏览器
var isSafari = userAgent.indexOf("Safari") > -1
&& userAgent.indexOf("Chrome") == -1; // 判断是否Safari浏览器
var isChrome = userAgent.indexOf("Chrome") > -1
&& userAgent.indexOf("Safari") > -1; // 判断Chrome浏览器
if (isIE) {
var reIE = new RegExp("MSIE (\\d+\\.\\d+);");
reIE.test(userAgent);
var fIEVersion = parseFloat(RegExp["$1"]);
if (fIEVersion == 7) {
return "IE7";
} else if (fIEVersion == 8) {
return "IE8";
} else if (fIEVersion == 9) {
return "IE9";
} else if (fIEVersion == 10) {
return "IE10";
} else if (fIEVersion == 11) {
return "IE11";
} else {
return "0";
}//IE版本过低
return "IE";
}
if (isOpera) {
return "Opera";
}
if (isEdge) {
return "Edge";
}
if (isFF) {
return "FF";
}
if (isSafari) {
return "Safari";
}
if (isChrome) {
return "Chrome";
}
}
$(document).ready(function () {
$('#toLogin').click(function () {
window.location.href = baseUrl+'/account/login'
})
@*if ($('.home_user_login').css('display') == 'block') {
$('#toLogin').css({ 'display':'none'})
}*@
document.getElementsByClassName("home_user_login")[0].getElementsByTagName("a")[0].style.color = '#000'
})
</script>
@*<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>*@
</body>
</html>