Church.Net.API/Chruch.Net/Views/Shared/_LayoutEmpty.cshtml
2022-09-08 08:04:32 -07:00

211 lines
7.6 KiB
Plaintext

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>@ViewBag.Title</title>
@Styles.Render("~/Content/bootstrap")
@Scripts.Render("~/bundles/modernizr")
@Styles.Render("~/Content/UnitfyComponentCSS")
@Styles.Render("~/Content/UnitfyCoreCSS")
</head>
<body>
@RenderBody()
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/bootstrap")
@Scripts.Render("~/bundles/Common")
@Scripts.Render("~/bundles/UnitfyCore")
<!-- JS Plugins Init. -->
<script>
$(function(parameters) {
// initialization of scroll animation
$.HSCore.components.HSOnScrollAnimation.init('[data-animation]');
// initialization of counters
var counters = $.HSCore.components.HSCounter.init('[class*="js-counter"]');
});
$(document).ready(function () {
$('.input-validation-error').parents('.form-group').addClass('has-error');
$('.field-validation-error').addClass('badge badge-warning');
$('Form').each(function (index) {
var formData = $.data(this);
var validator = formData.validator;
if (validator !== null && validator !== undefined) {
var settings = formData.validator.settings
// Store existing event handlers in local variables
, oldErrorPlacement = settings.errorPlacement
, oldSuccess = settings.success;
settings.errorPlacement = function (label, element) {
// Call old handler so it can update the HTML
oldErrorPlacement(label, element);
// Add Bootstrap classes to newly added elements
label.parents('.form-group').addClass('has-error');
label.addClass('badge badge-warning');
};
settings.success = function (label) {
// Remove error class from <div class="form-group">, but don't worry about
// validation error messages as the plugin is going to remove it anyway
label.parents('.form-group').removeClass('has-error');
// Call old handler to do rest of the work
oldSuccess(label);
};
}
$(this).submit(function (evt) {
if (typeof ($(evt.target).valid)!= "undefined" && !$(evt.target).valid()) { return false; }
var stillLogin = true;//CheckStillLogin(this);
return stillLogin;
});
});
//$('<input>').attr({
// type: 'hidden',
// id: 'lanCode',
// name: 'lanCode',
// value: '@ViewBag.LanCode'
//}).appendTo('form');
//$('<input>').attr({
// type: 'hidden',
// id: 'returnUrl',
// name: 'returnUrl',
// value: '@ViewBag.returnUrl'
//}).appendTo('form');
$('button[data-toggle="delete"]').each(function() {
var btn = $(this);
$(this).bind('click', function () {
swal({
title: '確定要刪除?',
text: '刪除後救不回來喔',
type: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: '是',
cancelButtonText: '否'
}).then(function () {
window.location = btn.attr('href');
return true;
});
return false;
});
});
$('button[data-toggle="confirmRedirect"]').each(function() {
var btn = $(this);
$(this).bind('click', function () {
swal({
title: '確定要變更?',
text: '變更後救不回來喔',
type: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: '是',
cancelButtonText: '否'
}).then(function () {
window.location = btn.attr('href');
return true;
});
return false;
});
});
$('button[data-toggle="confirm"]').each(function () {
var btn = $(this);
$(this).bind('click', function () {
swal({
title: '確定要變更?',
text: '變更後救不回來喔',
type: 'question',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: '是',
cancelButtonText: '否'
}).then(function () {
btn.parent('Form').submit();
return true;
});
return false;
});
});
$('button[data-toggle="confirmExit"]').each(function () {
var btn = $(this);
$(this).bind('click', function () {
swal({
title: '確定要離開?',
text: '離開後就不回來喔',
type: 'question',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: '是',
cancelButtonText: '否'
}).then(function () {
btn.parent('Form').submit();
return true;
});
return false;
});
});
$('button[data-toggle="inputAndSubmit"]').each(function () {
$(this).bind('click', function () {
var btn = $(this);
swal({
title: "請輸入" + btn.attr('value'),
text: '',
inputPlaceholder: btn.attr('inputPlaceholder'),
type: 'info', input: "text",
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: '是',
cancelButtonText: '否'
}).then(function (input) {
$("#" + btn.attr('data-target')).val(input);
btn.parent('Form').submit();
return true;
});
return false;
});
});
});
</script>
@Html.Partial("_Processing")
@RenderSection("scripts", required: false)
@RenderSection("scripts2", required: false)
<script>
@Html.Raw(ViewBag.StartScript)
</script>
</body>
</html>