TS - OperationsMgrWeb login page UI and function
This commit is contained in:
+2000
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,579 @@
|
||||
/*
|
||||
Application: Sarand OperationsMgr
|
||||
Stylesheet: Core
|
||||
*/
|
||||
|
||||
@charset "UTF-8";
|
||||
|
||||
@media print {
|
||||
* {
|
||||
color: #000000 !important;
|
||||
background-color: #FFFFFF !important;
|
||||
}
|
||||
}
|
||||
|
||||
body {
|
||||
min-width: 320px;
|
||||
max-width: 1600px;
|
||||
margin: auto;
|
||||
padding: 0px;
|
||||
font-family: Verdana,Arial,Tahoma,"Sans-Serif";
|
||||
font-size: 16px;
|
||||
line-height: 1.42857em;
|
||||
text-indent: 0px;
|
||||
color: #0a0a0a;
|
||||
background-color: #ffffe5;
|
||||
page: rotated;
|
||||
border-width: 0px;
|
||||
}
|
||||
|
||||
div {
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
}
|
||||
|
||||
button, input, textarea, select, option {
|
||||
font-family: inherit;
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
input, textarea, select {
|
||||
-moz-border-radius: 4px;
|
||||
-webkit-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
/* --- Standard tags --- */
|
||||
h1, h2, h3 {
|
||||
color: #0000B0;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
margin: 6px 0px 6px 0px;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
margin: 3px 0px 6px 0px;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: 11px;
|
||||
font-weight: bold;
|
||||
margin: 3px 0px 6px 0px;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 3px 0px 6px 0px;
|
||||
}
|
||||
|
||||
hr {
|
||||
height: 4px;
|
||||
width: 90%;
|
||||
text-align: center;
|
||||
color: #000000;
|
||||
margin: 4px auto;
|
||||
}
|
||||
|
||||
a {
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
img {
|
||||
border-style: none;
|
||||
}
|
||||
|
||||
ul {
|
||||
margin-top: 3px;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
table {
|
||||
margin-top: 0px;
|
||||
empty-cells: inherit;
|
||||
}
|
||||
|
||||
td {
|
||||
vertical-align: top;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
div, form {
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
label {
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
input {
|
||||
margin: 0px;
|
||||
padding: 0px 2px 1px 2px;
|
||||
}
|
||||
|
||||
textarea {
|
||||
resize: none;
|
||||
}
|
||||
|
||||
.bold, b {
|
||||
font-weight: bold !important;
|
||||
}
|
||||
|
||||
.ul, u {
|
||||
text-decoration: underline !important;
|
||||
}
|
||||
|
||||
.italic, i {
|
||||
font-style: italic !important;
|
||||
}
|
||||
|
||||
.upper {
|
||||
text-transform: uppercase !important;
|
||||
}
|
||||
|
||||
.lower {
|
||||
text-transform: lowercase !important;
|
||||
}
|
||||
|
||||
.center {
|
||||
text-align: center !important;
|
||||
}
|
||||
|
||||
.right {
|
||||
text-align: right !important;
|
||||
}
|
||||
|
||||
.middle {
|
||||
vertical-align: middle !important;
|
||||
}
|
||||
|
||||
.bottom {
|
||||
vertical-align: bottom !important;
|
||||
}
|
||||
|
||||
.pointer {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.fullwidth {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.floatl, .floatleft {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.floatr, .floatright {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.clearl, .clearleft {
|
||||
clear: left;
|
||||
}
|
||||
|
||||
.clearr, .clearright {
|
||||
clear: right;
|
||||
}
|
||||
|
||||
.clearb, .clearboth {
|
||||
clear: both;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
width: 0px;
|
||||
height: 0px;
|
||||
line-height: 0.0em;
|
||||
font-size: 0px;
|
||||
}
|
||||
|
||||
.clear-after:after {
|
||||
visibility: hidden;
|
||||
display: block;
|
||||
font-size: 0;
|
||||
content: " ";
|
||||
clear: both;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
.nowrap {
|
||||
white-space: nowrap !important;
|
||||
}
|
||||
|
||||
.spacer {
|
||||
height: 4px;
|
||||
font-size: 2px;
|
||||
}
|
||||
|
||||
.spacer2 {
|
||||
height: 8px;
|
||||
font-size: 2px;
|
||||
}
|
||||
|
||||
.spacer4 {
|
||||
height: 16px;
|
||||
font-size: 2px;
|
||||
}
|
||||
|
||||
.pl4 {
|
||||
padding-left: 4px;
|
||||
}
|
||||
|
||||
.pl8 {
|
||||
padding-left: 8px;
|
||||
}
|
||||
|
||||
.lastTabSeq {
|
||||
z-index: 99;
|
||||
}
|
||||
|
||||
.hidden {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.shadow {
|
||||
-moz-box-shadow: 2px 2px 3px #ccc;
|
||||
-webkit-box-shadow: 2px 2px 3px #ccc;
|
||||
box-shadow: 2px 2px 3px #ccc; /* For IE 8 */
|
||||
-ms-filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=3,Direction=135,Color='#cccccc')"; /* For IE 5.5 - 7 */
|
||||
filter: progid:DXImageTransform.Microsoft.Shadow(Strength=3,Direction=135,Color='#cccccc');
|
||||
}
|
||||
|
||||
/* --- Application --- */
|
||||
body {
|
||||
padding-top: 50px !important;
|
||||
padding-bottom: 0 !important; /* 20px */
|
||||
}
|
||||
|
||||
/* Wrapping element */
|
||||
/* Set some basic padding to keep content from hitting the edges */
|
||||
.body-content {
|
||||
padding-left: 15px;
|
||||
padding-right: 15px;
|
||||
}
|
||||
|
||||
/* Set widths on the form inputs since otherwise they're 100% wide */
|
||||
input, select, textarea {
|
||||
max-width: 280px;
|
||||
}
|
||||
|
||||
/* Carousel */
|
||||
.carousel-caption p {
|
||||
font-size: 20px;
|
||||
line-height: 1.4;
|
||||
}
|
||||
/* Make .svg files in the carousel display properly in older browsers */
|
||||
.carousel-inner .item img[src$=".svg"] {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* Hide/rearrange for smaller screens */
|
||||
@media screen and (max-width:767px) {
|
||||
/* Hide captions */
|
||||
.carousel-caption {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* --- Bootstrap --- */
|
||||
.navbar-inverse .navbar-brand,
|
||||
.navbar-inverse .navbar-nav > li > a,
|
||||
.mob .navbar-inverse .navbar-nav .open .dropdown-menu > li > a {
|
||||
color: #e0e0e0;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.dropdown-menu {
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
/* --- Tooltip --- */
|
||||
.tooltip {
|
||||
position: fixed
|
||||
}
|
||||
|
||||
.tooltip.in {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.tooltip.top {
|
||||
margin-top: -0px;
|
||||
}
|
||||
|
||||
.tooltip.top .tooltip-arrow {
|
||||
border-top-color: #808080;
|
||||
}
|
||||
|
||||
.tooltip .tooltip-inner {
|
||||
min-width: 320px;
|
||||
max-width: 320px;
|
||||
color: #404040;
|
||||
background-color: #FFFFFF;
|
||||
text-align: left;
|
||||
border: 1px solid #808080;
|
||||
-moz-border-radius: 4px;
|
||||
-webkit-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
-moz-box-shadow: 4px 4px 3px #aaa;
|
||||
-webkit-box-shadow: 4px 4px 3px #aaa;
|
||||
box-shadow: 4px 4px 3px #aaa; /* For IE 8 */
|
||||
-ms-filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=3,Direction=135,Color='#aaaaaa')"; /* For IE 5.5 - 7 */
|
||||
filter: progid:DXImageTransform.Microsoft.Shadow(Strength=3,Direction=135,Color='#aaaaaa');
|
||||
}
|
||||
|
||||
.tooltip .tooltip-inner .tooltip-caption {
|
||||
margin-bottom: 4px;
|
||||
font-weight: bold;
|
||||
border-bottom: 1px solid #808080;
|
||||
}
|
||||
|
||||
.tooltip .tooltip-inner .label {
|
||||
padding-right: 6px;
|
||||
color: #808080;
|
||||
}
|
||||
|
||||
/* --- Application Messages --- */
|
||||
.opn-msg {
|
||||
margin: 4px 0;
|
||||
}
|
||||
|
||||
.opn-msg .err, .opn-msg .wrn, .opn-msg .inf {
|
||||
margin: 2px 0;
|
||||
padding: 4px 16px 4px 32px;
|
||||
background-color: #fefefe;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.opn-msg .err {
|
||||
color: red;
|
||||
border: 1px solid red;
|
||||
}
|
||||
|
||||
.opn-msg .wrn {
|
||||
color: #ff6000;
|
||||
border: 1px solid darkorange;
|
||||
}
|
||||
|
||||
.opn-msg .inf {
|
||||
color: darkgreen;
|
||||
border: 1px solid green;
|
||||
}
|
||||
|
||||
/* --- Notification --- */
|
||||
#opn-notification {
|
||||
display: none;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
min-width: 180px;
|
||||
margin-right: 12px;
|
||||
z-index: 1000;
|
||||
border: 1px solid #808080;
|
||||
border-top-left-radius: 4px;
|
||||
border-top-right-radius: 4px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#opn-notification .content {
|
||||
background-color: #fbfbfb;
|
||||
}
|
||||
|
||||
#opn-notification .heading {
|
||||
background-color: #f0f0f0;
|
||||
font-weight: bold;
|
||||
border-bottom: 1px solid #808080;
|
||||
}
|
||||
|
||||
#opn-notification .heading:after {
|
||||
content: "";
|
||||
display: table;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
#opn-notification .title {
|
||||
float: left;
|
||||
padding: 4px 8px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
#opn-notification .close {
|
||||
float: right;
|
||||
padding: 4px;
|
||||
font-weight: bold;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#opn-notification .message {
|
||||
clear: both;
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
/* --- Modal Please wait --- */
|
||||
#opn-please-wait {
|
||||
display: none;
|
||||
cursor: progress;
|
||||
position: fixed;
|
||||
z-index: 1000;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
background: rgba(255,255,255,.0) url('../img/icon/opn-please-wait.gif') 50% 50% no-repeat;
|
||||
}
|
||||
|
||||
/* --- Dialogs --- */
|
||||
div.dialog {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* --- Forms --- */
|
||||
.opn-form {
|
||||
margin: 12px auto 6px auto;
|
||||
background-color: #f8f8f8;
|
||||
border: 1px solid #808080;
|
||||
border-radius: 4px;
|
||||
-moz-box-shadow: 4px 4px 6px #ccc;
|
||||
-webkit-box-shadow: 4px 4px 6px #ccc;
|
||||
filter: progid:DXImageTransform.Microsoft.Shadow(Strength=6,Direction=135,Color='#cccccc');
|
||||
}
|
||||
|
||||
.opn-form.login {
|
||||
width: 440px;
|
||||
}
|
||||
|
||||
.opn-form .caption {
|
||||
padding: 4px 0;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
color: #fff;
|
||||
background-color: #404040;
|
||||
border-bottom: 1px solid #808080;
|
||||
}
|
||||
|
||||
.opn-form .body {
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
/* --- Controls --- */
|
||||
.ui-datepicker-trigger {
|
||||
margin-left: 4px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/* --- Page Layout --- */
|
||||
#opn-header.navbar-inverse {
|
||||
background-color: #404040;
|
||||
}
|
||||
|
||||
#opn-body {
|
||||
padding: 2px 0;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
#opn-footer {
|
||||
padding: 0 4px;
|
||||
font-size: 10px;
|
||||
color: #e0e0e0;
|
||||
background-color: #404040;
|
||||
border-top: solid 1px #b0b0b0;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
/* --- Panels --- */
|
||||
.col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 {
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
/* --- Filter Panel --- */
|
||||
.opn-panel-filter {
|
||||
padding: 4px 4px;
|
||||
/*border:1px solid blue;*/
|
||||
}
|
||||
|
||||
.opn-panel-filter .opn-filter-header {
|
||||
margin-bottom: 4px;
|
||||
padding: 2px 8px;
|
||||
text-align: center;
|
||||
background-color: aliceblue;
|
||||
border: 1px solid #808080;
|
||||
-moz-border-radius: 4px;
|
||||
-webkit-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.opn-panel-filter .opn-label {
|
||||
padding: 0 8px 0 0;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.opn-panel-filter .opn-value {
|
||||
}
|
||||
|
||||
.opn-panel-filter input[type="text"],
|
||||
.opn-panel-filter select {
|
||||
width: 96%;
|
||||
}
|
||||
|
||||
.opn-panel-filter .opn-filter-paging {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* --- Data Panel --- */
|
||||
.opn-panel-data {
|
||||
padding: 4px 4px;
|
||||
/*border:1px solid purple;*/
|
||||
}
|
||||
|
||||
.opn-panel-data .opn-data-header {
|
||||
margin-bottom: 4px;
|
||||
background-color: aliceblue;
|
||||
border: 1px solid #808080;
|
||||
-moz-border-radius: 4px;
|
||||
-webkit-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.opn-panel-data .opn-data-header .opn-column-header {
|
||||
padding: 2px 8px;
|
||||
}
|
||||
|
||||
.opn-panel-data .opn-data-msg {
|
||||
padding: 4px;
|
||||
background-color: lightgoldenrodyellow;
|
||||
border: 1px solid #808080;
|
||||
-moz-border-radius: 8px;
|
||||
-webkit-border-radius: 8px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.opn-panel-data .opn-data-content {
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.opn-panel-data .opn-data-item {
|
||||
}
|
||||
|
||||
.opn-panel-data .opn-data-item {
|
||||
margin-bottom: 4px;
|
||||
padding: 6px 4px;
|
||||
background-color: #fff;
|
||||
border: 1px solid #808080;
|
||||
-moz-border-radius: 8px;
|
||||
-webkit-border-radius: 8px;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.opn-panel-data .opn-data-item:hover {
|
||||
background-color: #e0ffe0;
|
||||
}
|
||||
|
||||
.opn-data-template {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* --- The End --- */
|
||||
@@ -0,0 +1,340 @@
|
||||
/*
|
||||
Application: Sarand OperationsMgr
|
||||
Javascript: Core
|
||||
Notes: From a sarand.com original.
|
||||
*/
|
||||
|
||||
//-------------------------------------------------------------
|
||||
// Data members.
|
||||
var opn = opn || {};
|
||||
|
||||
//-------------------------------------------------------------
|
||||
// Utility functions.
|
||||
opn.checkTextAreaMaxLength = function (ctrl, len) {
|
||||
if (ctrl == null || ctrl.value == null) return;
|
||||
if (ctrl.value.length > len) ctrl.value = ctrl.value.substring(0, len);
|
||||
};
|
||||
opn.isDef = function (obj) {
|
||||
return obj === null || typeof obj == "undefined" ? false : true;
|
||||
};
|
||||
opn.isFn = function (fn) {
|
||||
return fn != null && typeof fn == typeof Function;
|
||||
};
|
||||
opn.isNumeric = function (n) {
|
||||
return !isNaN(parseFloat(n)) && isFinite(n);
|
||||
};
|
||||
opn.zeroPad = function (num, count) {
|
||||
var val = num + '';
|
||||
while (val.length < count) val = "0" + val;
|
||||
return val;
|
||||
};
|
||||
opn.setOddDataRowClass = function (rowSel) {
|
||||
$(rowSel).addClass(function (index, currentClasses) {
|
||||
return index % 2 == 1 ? "other" : "";
|
||||
});
|
||||
};
|
||||
opn.toInt = function (value, defaultValue) {
|
||||
return opn.isNumeric(value) ? parseInt(value, 10) : defaultValue || 0;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------
|
||||
// Security.
|
||||
opn.redirectHome = function () {
|
||||
opn.doPleaseWait();
|
||||
document.location = opn.urlHome;
|
||||
}
|
||||
opn.redirectHomeExp = function () {
|
||||
opn.doPleaseWait();
|
||||
document.location = opn.urlHomeExp;
|
||||
}
|
||||
opn.doLogout = function () {
|
||||
var $dlg = $('#dlgOpnLogout');
|
||||
if (!$dlg.hasClass('ui-dialog-content')) {
|
||||
var optLogout = opn.dlgOpts();
|
||||
optLogout.buttons[opn.dlgBtnLogout] = function () { $(this).dialog('close'); opn.onLogout(); };
|
||||
optLogout.buttons[opn.dlgBtnCancel] = function () { $(this).dialog('close'); };
|
||||
$dlg.dialog(optLogout);
|
||||
}
|
||||
$dlg.dialog('open');
|
||||
};
|
||||
opn.onLogout = function () {
|
||||
opn.doPleaseWait();
|
||||
$('form#frmOpnLogout').submit();
|
||||
};
|
||||
|
||||
//-------------------------------------------------------------
|
||||
// Data paging.
|
||||
opn.doPrevDataPage = function (frm) {
|
||||
var $frm = $(frm);
|
||||
var $pageNo = $('#ifDataPageNo', $frm);
|
||||
$pageNo.val(Math.max(1, opn.toInt($pageNo.val()) - 1));
|
||||
opn.refreshItemList();
|
||||
};
|
||||
opn.doNextDataPage = function (frm) {
|
||||
var $frm = $(frm);
|
||||
var $pageNo = $('#ifDataPageNo', $frm);
|
||||
$pageNo.val(opn.toInt($pageNo.val()) + 1);
|
||||
opn.refreshItemList();
|
||||
};
|
||||
opn.refreshPaging = function (paging, $paging) {
|
||||
if (!paging) {
|
||||
$paging.hide().Hide();
|
||||
return;
|
||||
}
|
||||
$('#ifDataPageNo', $paging).val(paging ? paging.pageNo : '');
|
||||
$('.PageNo', $paging).text(paging ? paging.pageNo : '');
|
||||
$('#DataPageCount', $paging).val(paging ? paging.pageCount : '');
|
||||
$('.PageCount', $paging).text(paging ? paging.pageCount : '');
|
||||
$('#DataItemCount', $paging).val(paging ? paging.itemCount : '');
|
||||
$('#DataItemTotal', $paging).val(paging ? paging.itemTotal : '');
|
||||
$('.ItemTotal', $paging).text(paging ? paging.itemTotal : '');
|
||||
if (paging.paged) $paging.show(); else $paging.hide();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------
|
||||
// Dialogs.
|
||||
opn.openDialog = function ($dlg, width) {
|
||||
$dlg.dialog({ minWidth: null, maxWidth: null, width: Math.min(width || 400, $(window).width() * .90) }).dialog('open');
|
||||
return $dlg;
|
||||
};
|
||||
opn.dlgOpts = function () {
|
||||
return { autoOpen: false, modal: true, show: 'clip', hide: 'clip', minWidth: 320, maxWidth: 480, width: 'auto', resizable: false, draggable: false, closeOnEscape: false, dialogClass: "no-close center-buttons", buttons: {} };
|
||||
};
|
||||
opn.dlgOptsClose = function () {
|
||||
var opts = opn.dlgOpts();
|
||||
opts.buttons[opn.dlgBtnClose] = function () { $(this).dialog('close'); };
|
||||
return opts;
|
||||
};
|
||||
opn.doAlert = function (title, msg, onOk) {
|
||||
if (!msg) {
|
||||
msg = title;
|
||||
title = null;
|
||||
}
|
||||
if (!opn.isDef(opn.$dlgAlert)) {
|
||||
var opt = opn.dlgOpts();
|
||||
opt.title = title || opn.dlgTitleAlert;
|
||||
opt.buttons[opn.dlgBtnOk] = function () { $(this).dialog('close'); if (onOk) onOk(); };
|
||||
opn.$dlgAlert = $('<div id="dlgAlert"><div id="dlgAlertMsg"></div></div>').dialog(opt);
|
||||
}
|
||||
$('#dlgAlertMsg').html(msg);
|
||||
opn.openDialog(opn.$dlgAlert);
|
||||
};
|
||||
opn.doConfirm = function (msg, onOk, onCancel) {
|
||||
if (!opn.isDef(opn.$dlgConfirm)) {
|
||||
var opt = opn.dlgOpts();
|
||||
opt.title = opn.dlgTitleConfirm;
|
||||
opn.$dlgConfirm = $('<div id="dlgConfirm"><div class="spacer2"></div><div id="dlgConfirmMsg"></div></div>').dialog(opt);
|
||||
}
|
||||
var buttons = opn.$dlgConfirm.dialog('option', 'buttons');
|
||||
buttons[opn.dlgBtnYes] = function () { $(this).dialog('close'); if (onOk) onOk(); };
|
||||
buttons[opn.dlgBtnNo] = function () { $(this).dialog('close'); if (onCancel) onCancel(); };
|
||||
opn.$dlgConfirm.dialog('option', 'buttons', buttons);
|
||||
$('#dlgConfirmMsg').html(msg);
|
||||
opn.openDialog(opn.$dlgConfirm);
|
||||
};
|
||||
opn.doProgress = function (msg, delay) {
|
||||
clearTimeout(opn.toShowProgress);
|
||||
if (!opn.isDef(opn.$dlgProgress)) {
|
||||
var opt = opn.dlgOpts();
|
||||
opt.title = opn.dlgTitleProgress;
|
||||
opt.show = { effect: 'fade', duration: 100 };
|
||||
opt.hide = { effect: 'fade', duration: 100 };
|
||||
opn.$dlgProgress = $('<div id="dlgProgress"><div id="dlgProgressMsg"></div></div>').dialog(opt);
|
||||
}
|
||||
$('#dlgProgressMsg').html(msg);
|
||||
if (delay > 0) opn.toShowProgress = setTimeout(function () { opn.$dlgProgress.dialog('open'); }, delay);
|
||||
else opn.$dlgProgress.dialog('open');
|
||||
};
|
||||
opn.hideProgress = function () {
|
||||
clearTimeout(opn.toShowProgress);
|
||||
opn.$dlgProgress.dialog('close');
|
||||
};
|
||||
|
||||
//-------------------------------------------------------------
|
||||
// Notifications.
|
||||
opn.showNotification = function (title, msg) {
|
||||
window.clearTimeout(opn.toNotification);
|
||||
var $win = $(window);
|
||||
var $not = $('#opn-notification').hide();
|
||||
if (!$not.length) {
|
||||
$not = $('<div id="opn-notification"><div class="content"><div class="heading"><div class="close" onclick="opn.hideNotification()">✖</div><div class="title"></div></div><div class="message"></div></div></div>');
|
||||
$('body').append($not);
|
||||
}
|
||||
var $hdr = $('.heading', $not).css({ 'background-color': 'rgba(247,217,0,0.7)' });
|
||||
$('.title', $not).html(title);
|
||||
$('.message', $not).html(msg);
|
||||
var fbr = $('#opn-footer')[0].getBoundingClientRect();
|
||||
var fn = function () { $hdr.delay(2000).animate({ backgroundColor: '#f0f0f0' }, 1000); };
|
||||
$not.css({ 'bottom': $win.height() - fbr.top, 'right': $win.width() - fbr.right }).slideDown(500, fn);
|
||||
opn.toNotification = setTimeout(opn.hideNotification, 6000);
|
||||
};
|
||||
opn.hideNotification = function () {
|
||||
window.clearTimeout(opn.toNotification);
|
||||
$('#opn-notification').slideUp(500);
|
||||
};
|
||||
opn.doPleaseWait = function () {
|
||||
$('#opn-please-wait').show();
|
||||
};
|
||||
opn.hidePleaseWait = function () {
|
||||
$('#opn-please-wait').hide();
|
||||
};
|
||||
|
||||
//-------------------------------------------------------------
|
||||
// Ajax.
|
||||
opn.doAjaxRequest = function (ajax, url, formId, callback, delay) {
|
||||
window.clearTimeout(ajax.timeout);
|
||||
if (url) ajax.url = url;
|
||||
if (formId) ajax.formId = formId;
|
||||
if (callback) ajax.callback = callback;
|
||||
if (!ajax.noWaitIcon) opn.doPleaseWait();
|
||||
ajax.timeout = setTimeout(function () { opn.execAjaxRequest(ajax); }, Math.max(50, parseInt(delay || 0, 10)));
|
||||
};
|
||||
opn.execAjaxRequest = function (ajax) {
|
||||
window.clearTimeout(ajax.timeout);
|
||||
if (ajax.request) ajax.request.abort();
|
||||
var cfgAjax =
|
||||
{
|
||||
url: ajax.url,
|
||||
type: 'POST',
|
||||
cache: false,
|
||||
enctype: 'multipart/form-data',
|
||||
data: ajax.formData || $("#" + ajax.formId).serialize(),
|
||||
dataType: 'json',
|
||||
success: function (response, status, jqXHR) {
|
||||
ajax.status = status;
|
||||
if (response.notification)
|
||||
opn.showNotification(response.notification.title, response.notification.message);
|
||||
if (response.message)
|
||||
opn.doAlert(response.message.title, response.message.text, function (response) { if (ajax.errFn) ajax.errFn(response); }(response));
|
||||
if (response.sessionExpired)
|
||||
return opn.redirectHomeExp();
|
||||
if (response.goHome)
|
||||
return opn.redirectHome();
|
||||
if (ajax.callback) ajax.callback(response);
|
||||
},
|
||||
error: function (jqXHR, status, errorThrown) {
|
||||
ajax.status = status;
|
||||
if (status == "abort") return;
|
||||
return opn.redirectHome();
|
||||
},
|
||||
complete: function (jqXHR, textStatus) {
|
||||
if (!ajax.noWaitIcon) opn.hidePleaseWait();
|
||||
ajax.complete = true;
|
||||
}
|
||||
};
|
||||
if (ajax.formData) {
|
||||
cfgAjax.processData = false,
|
||||
cfgAjax.contentType = false;
|
||||
}
|
||||
//console.log(ajax.formData);
|
||||
ajax.request = $.ajax(cfgAjax);
|
||||
};
|
||||
|
||||
//-------------------------------------------------------------
|
||||
// Viewport - Desktop or Mobile.
|
||||
opn.isMob = function () { return $('body.mob').length > 0; };
|
||||
opn.onChangeViewport = function (viewport) {
|
||||
var $body = $('body');
|
||||
$body.removeClass('mob dsk');
|
||||
if (viewport.is('xs')) $body.addClass('mob');
|
||||
else if (viewport.current() != 'unrecognized') $body.addClass('dsk');
|
||||
};
|
||||
opn.isAutoHeight = function () { return ($(window).width() < 360 || $(window).height() < 560 || opn.isMob()); }
|
||||
opn.onWinResizePage = function () { };
|
||||
opn.onWinResize = function () {
|
||||
var winH = $(window).height();
|
||||
var $pageBody = $('#opn-body');
|
||||
var $hdr = $('#opn-header');
|
||||
var $ftr = $('#opn-footer');
|
||||
//console.log(winH);
|
||||
//console.log($hdr.outerHeight(true));
|
||||
//console.log($ftr.outerHeight(true));
|
||||
if (opn.isAutoHeight())
|
||||
$pageBody.height('auto');
|
||||
else
|
||||
$pageBody.innerHeight(Math.min(1200, winH - $hdr.outerHeight() - $ftr.outerHeight(true)));
|
||||
$ftr.css('visibility', 'visible');
|
||||
opn.onWinResizePage();
|
||||
};
|
||||
opn.objBtm = function (sel) {
|
||||
var $obj = $(sel);
|
||||
return Math.floor($obj.offset().top + $obj.outerHeight(true));
|
||||
};
|
||||
opn.innerBtm = function (sel) {
|
||||
var $obj = $(sel);
|
||||
return Math.floor($obj.offset().top + $obj.outerHeight() - opn.bottomSurround($obj));
|
||||
};
|
||||
opn.innerTop = function (sel) {
|
||||
var $obj = $(sel);
|
||||
return Math.floor($obj.offset().top + opn.topSurround($obj));
|
||||
};
|
||||
opn.topSurround = function (sel) {
|
||||
var $obj = $(sel);
|
||||
return parseInt($obj.css('margin-top'), 10) + parseInt($obj.css('border-top-width'), 10) + parseInt($obj.css('padding-top'), 10);
|
||||
};
|
||||
opn.bottomSurround = function (sel) {
|
||||
var $obj = $(sel);
|
||||
return parseInt($obj.css('margin-bottom'), 10) + parseInt($obj.css('border-bottom-width'), 10) + parseInt($obj.css('padding-bottom'), 10);
|
||||
};
|
||||
opn.marginHeight = function (sel) {
|
||||
var $obj = $(sel);
|
||||
return parseInt($obj.css('margin-top'), 10) + parseInt($obj.css('margin-bottom'), 10);
|
||||
};
|
||||
opn.borderHeight = function (sel) {
|
||||
var $obj = $(sel);
|
||||
return parseInt($obj.css('border-top-width'), 10) + parseInt($obj.css('border-bottom-width'), 10);
|
||||
};
|
||||
|
||||
//-------------------------------------------------------------
|
||||
// On page load.
|
||||
$(function () {
|
||||
//console.log('Page loaded');
|
||||
(function ($, viewport) {
|
||||
var timerResize = 0;
|
||||
$(window).bind('resize', function (e) {
|
||||
viewport.changed(function () { opn.onChangeViewport(viewport); });
|
||||
clearTimeout(timerResize);
|
||||
timerResize = setTimeout(opn.onWinResize, 200);
|
||||
}).trigger('resize');
|
||||
})($, ResponsiveBootstrapToolkit);
|
||||
$('textarea[maxlength]').keyup(function () {
|
||||
var limit = parseInt($(this).attr('maxlength'), 10);
|
||||
var text = $(this).val();
|
||||
if (text.length > limit)
|
||||
$(this).val(text.substr(0, limit));
|
||||
});
|
||||
// Text selection in element.
|
||||
jQuery.fn.selectText = function () {
|
||||
/*
|
||||
this.find('input').each(function()
|
||||
{
|
||||
if($(this).prev().length == 0 || !$(this).prev().hasClass('p_copy'))
|
||||
$('<p class="p_copy" style="position: absolute; z-index: -1;"></p>').insertBefore($(this));
|
||||
$(this).prev().html($(this).val());
|
||||
});
|
||||
*/
|
||||
var doc = document;
|
||||
var element = this[0];
|
||||
var range;
|
||||
if (doc.body.createTextRange) {
|
||||
range = doc.body.createTextRange();
|
||||
range.moveToElementText(element);
|
||||
range.select();
|
||||
}
|
||||
else if (window.getSelection) {
|
||||
range = doc.createRange();
|
||||
range.selectNodeContents(element);
|
||||
var sel = window.getSelection();
|
||||
sel.removeAllRanges();
|
||||
sel.addRange(range);
|
||||
}
|
||||
};
|
||||
});
|
||||
$(window).load(function () {
|
||||
//console.log('Window loaded');
|
||||
$(window).trigger('resize');
|
||||
});
|
||||
|
||||
//-------------------------------------------------------------
|
||||
// T h e E n d
|
||||
//-------------------------------------------------------------
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
Application: Sarand OperationsMgr
|
||||
Javascript: Utilities
|
||||
Notes: From a sarand.com original.
|
||||
*/
|
||||
|
||||
//-------------------------------------------------------------
|
||||
opn.refreshUtilityList = function (delay) {
|
||||
var $panel = $('#opn-panel-utilities-utilities');
|
||||
var $data = $('.opn-panel-data', $panel);
|
||||
var $content = $('.opn-data-content', $data);
|
||||
$('.opn-data-list', $content).empty();
|
||||
$('.opn-data-msg', $data).text(opn.msgDataQuerying).show();
|
||||
opn.ajaxUtilityList = opn.ajaxUtilityList || {};
|
||||
opn.doAjaxRequest(opn.ajaxUtilityList, '/Utilities/GetUtilityList', 'frmFilter', opn.onRefreshUtilityList, delay || 250);
|
||||
};
|
||||
opn.refreshItemList = opn.refreshUtilityList;
|
||||
opn.onRefreshUtilityList = function (response) {
|
||||
var $panel = $('#opn-panel-utilities-utilities');
|
||||
var $data = $('.opn-panel-data', $panel);
|
||||
var $content = $('.opn-data-content', $data);
|
||||
var $msg = $('.opn-data-msg', $data).empty().hide();
|
||||
//console.log(response);
|
||||
opn.refreshPaging(response.paging, $('.opn-panel-filter .opn-filter-paging', $panel));
|
||||
|
||||
var $list = $('.opn-data-list', $content);
|
||||
$list.empty();
|
||||
if (response.utilities && response.utilities.length) {
|
||||
var $tmpl = $('.opn-utility-template .opn-data-item', $data);
|
||||
for (var utilityIdx = 0; utilityIdx < response.utilities.length; utilityIdx++) {
|
||||
var $utility = $tmpl.clone();
|
||||
var utility = response.utilities[utilityIdx];
|
||||
$('.code', $utility).text(utility.code);
|
||||
$('.size', $utility).text(utility.sizeCode);
|
||||
if (utility.onInstance)
|
||||
$('.status', $utility).text("Gate-in: " + utility.gateIn);
|
||||
else
|
||||
$('.status', $utility).text("Gate-out: " + utility.gateOut);
|
||||
$list.append($utility);
|
||||
if (utilityIdx > 12) break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
$msg.text(opn.msgDataNoneFound).show();
|
||||
}
|
||||
};
|
||||
|
||||
//------------------------------------------------------------
|
||||
$(function () {
|
||||
$('#ifFilterUtilityCode,#ifFilterUtilitySize').keypress(function (evt) {
|
||||
if (evt.key === 'Enter') {
|
||||
$('#pbFilterRefresh').click();
|
||||
evt.preventDefault();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
opn.refreshUtilityList(500);
|
||||
});
|
||||
|
||||
/* --------------------------- */
|
||||
/* T h e E n d */
|
||||
/* --------------------------- */
|
||||
Reference in New Issue
Block a user