Viewer to Server
This commit is contained in:
2014
Server/wwwroot/js/bootstrap.js
vendored
Normal file
2014
Server/wwwroot/js/bootstrap.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
21
Server/wwwroot/js/bootstrap.min.js
vendored
Normal file
21
Server/wwwroot/js/bootstrap.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
153
Server/wwwroot/js/common.js
Normal file
153
Server/wwwroot/js/common.js
Normal file
@ -0,0 +1,153 @@
|
||||
// turn off this eslint warning because the \r in the regex is intentional
|
||||
/* eslint no-control-regex: "off" */
|
||||
|
||||
$(document).ready(function () {
|
||||
|
||||
});
|
||||
|
||||
function ShowSuccessMessage(msg) {
|
||||
|
||||
ConstructMessageDialog();
|
||||
|
||||
if ($("#MessageModalContent").length) {
|
||||
$("#MessageModalContent").removeClass("modal-content-error");
|
||||
$("#MessageModalContent").addClass("modal-content-success");
|
||||
$("#MessageModalTitle").text("Success");
|
||||
var msgformatted = msg.replace(new RegExp('\r', 'g'), "<br />");
|
||||
$("#spanMessageText").html(msgformatted);
|
||||
$("#MessageModal").modal("show");
|
||||
}
|
||||
else {
|
||||
alert(msg);
|
||||
}
|
||||
}
|
||||
|
||||
function ShowErrorMessage(msg) {
|
||||
|
||||
ConstructMessageDialog();
|
||||
|
||||
if ($("#MessageModalContent").length) {
|
||||
$("#MessageModalContent").addClass("modal-content-error");
|
||||
$("#MessageModalContent").removeClass("modal-content-success");
|
||||
$("#MessageModalTitle").text("Error");
|
||||
var msgformatted = msg.replace(new RegExp('\r', 'g'), "<br />");
|
||||
$("#spanMessageText").html(msgformatted);
|
||||
$("#MessageModal").modal("show");
|
||||
}
|
||||
else {
|
||||
alert(msg);
|
||||
}
|
||||
}
|
||||
|
||||
function DisplayWSMessage(severity, description, e, ex) {
|
||||
|
||||
var forbiddenMsg = "You do not have access to this application. Contact FI team for assistance.";
|
||||
var expiredMsg = "Record will not show in Awaiting Disposition Queue since it is more than 6 hours old."
|
||||
|
||||
ConstructMessageDialog();
|
||||
|
||||
if ($("#MessageModalContent").length) {
|
||||
|
||||
var wsError = '';
|
||||
|
||||
$("#MessageModalContent").removeClass("modal-content-success");
|
||||
if (severity == "error") {
|
||||
$("#MessageModalTitle").text("Server Error");
|
||||
$("#MessageModalContent").addClass("modal-content-error");
|
||||
}
|
||||
else if (severity == "info") {
|
||||
$("#MessageModalContent").addClass("modal-content-info");
|
||||
}
|
||||
|
||||
$("#spanMessageText").text(description);
|
||||
if (e.status === 403) {
|
||||
$("#spanMessageText").append("<br /><b>" + forbiddenMsg + "</b>");
|
||||
}
|
||||
else if (e.status === 444) {
|
||||
$("#MessageModalContent").removeClass("modal-content-error");
|
||||
$("#MessageModalContent").addClass("modal-content-info");
|
||||
$("#MessageModalTitle").text("");
|
||||
$("#spanMessageText").text(expiredMsg);
|
||||
}
|
||||
else if (e.responseText !== null) {
|
||||
if (e.responseText !== "") {
|
||||
try {
|
||||
wsError = jQuery.parseJSON(e.responseText);
|
||||
if (wsError.Message !== null)
|
||||
$("#MessageModalTitle").text(wsError.Message);
|
||||
if (wsError.ExceptionMessage !== null) {
|
||||
$("#spanMessageText").append("<br /><b>");
|
||||
$("#spanMessageText").append(wsError.ExceptionMessage);
|
||||
$("#spanMessageText").append("</b>");
|
||||
}
|
||||
}
|
||||
catch (err) {
|
||||
// ignore any error while parsing
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ex !== null) {
|
||||
$("#spanMessageText").append("<br />");
|
||||
$("#spanMessageText").append(ex);
|
||||
}
|
||||
$("#MessageModal").modal("show");
|
||||
}
|
||||
else {
|
||||
|
||||
var msg = description + "\r\n";
|
||||
if (e.responseText !== null) {
|
||||
if (e.responseText !== "") {
|
||||
wsError = jQuery.parseJSON(e.responseText);
|
||||
if (wsError.ExceptionMessage !== null) {
|
||||
msg += wsError.ExceptionMessage;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (e.status === 403)
|
||||
msg += forbiddenMsg;
|
||||
|
||||
alert(msg);
|
||||
}
|
||||
}
|
||||
|
||||
function ConstructMessageDialog() {
|
||||
|
||||
var dialogTemplate =
|
||||
'<div class="modal-dialog"> ' +
|
||||
' <div class="modal-content" id="MessageModalContent"> ' +
|
||||
' <div class="modal-header"> ' +
|
||||
' <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> ' +
|
||||
' <h4 class="modal-title" id="MessageModalTitle"></h4> ' +
|
||||
' </div> ' +
|
||||
' <div class="modal-body"> ' +
|
||||
' <span id="spanMessageText"></span> ' +
|
||||
' <table id="ModalHeaderGrid"></table> ' +
|
||||
' <table id="ModalBodyGrid"></table> ' +
|
||||
' <textarea type="text" value="Hello World" id="textareaClipboard" style="display:none"></textarea> ' +
|
||||
' </div> ' +
|
||||
' <div class="modal-footer"> ' +
|
||||
' <div class="row" style="margin-top: 10px; margin-bottom: 20px;"> ' +
|
||||
' <div class="col-xs-1"> ' +
|
||||
' <button type="button" data-dismiss="modal" onclick="copy()">Copy</button> ' +
|
||||
' </div> ' +
|
||||
' <div class="col-xs-1"> ' +
|
||||
' <button type="button" data-dismiss="modal">OK</button> ' +
|
||||
' </div> ' +
|
||||
' </div> ' +
|
||||
' </div> ' +
|
||||
' </div> ' +
|
||||
'</div>';
|
||||
|
||||
if ($("#MessageModal").length) {
|
||||
$("#MessageModal").addClass("modal fade");
|
||||
$("#MessageModal").html(dialogTemplate);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function boolToYesNo(val) {
|
||||
if (val === true)
|
||||
return "Yes";
|
||||
return "No";
|
||||
}
|
||||
|
4
Server/wwwroot/js/jquery-3.2.1.minbackup.js
Normal file
4
Server/wwwroot/js/jquery-3.2.1.minbackup.js
Normal file
File diff suppressed because one or more lines are too long
2
Server/wwwroot/js/jquery-3.6.0.min.js
vendored
Normal file
2
Server/wwwroot/js/jquery-3.6.0.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
13
Server/wwwroot/js/jquery-ui.min.js
vendored
Normal file
13
Server/wwwroot/js/jquery-ui.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
5
Server/wwwroot/js/jquery.min.js
vendored
Normal file
5
Server/wwwroot/js/jquery.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
Server/wwwroot/js/jquery.min.map
Normal file
1
Server/wwwroot/js/jquery.min.map
Normal file
File diff suppressed because one or more lines are too long
3
Server/wwwroot/js/modernizr-3.6.0-custom.js
Normal file
3
Server/wwwroot/js/modernizr-3.6.0-custom.js
Normal file
@ -0,0 +1,3 @@
|
||||
/*! modernizr 3.6.0 (Custom Build) | MIT *
|
||||
* https://modernizr.com/download/?-boxsizing-setclasses !*/
|
||||
!function(e,n,t){function r(e,n){return typeof e===n}function o(){var e,n,t,o,s,i,l;for(var a in S)if(S.hasOwnProperty(a)){if(e=[],n=S[a],n.name&&(e.push(n.name.toLowerCase()),n.options&&n.options.aliases&&n.options.aliases.length))for(t=0;t<n.options.aliases.length;t++)e.push(n.options.aliases[t].toLowerCase());for(o=r(n.fn,"function")?n.fn():n.fn,s=0;s<e.length;s++)i=e[s],l=i.split("."),1===l.length?Modernizr[l[0]]=o:(!Modernizr[l[0]]||Modernizr[l[0]]instanceof Boolean||(Modernizr[l[0]]=new Boolean(Modernizr[l[0]])),Modernizr[l[0]][l[1]]=o),C.push((o?"":"no-")+l.join("-"))}}function s(e){var n=_.className,t=Modernizr._config.classPrefix||"";if(b&&(n=n.baseVal),Modernizr._config.enableJSClass){var r=new RegExp("(^|\\s)"+t+"no-js(\\s|$)");n=n.replace(r,"$1"+t+"js$2")}Modernizr._config.enableClasses&&(n+=" "+t+e.join(" "+t),b?_.className.baseVal=n:_.className=n)}function i(e,n){return!!~(""+e).indexOf(n)}function l(e){return e.replace(/([a-z])-([a-z])/g,function(e,n,t){return n+t.toUpperCase()}).replace(/^-/,"")}function a(){return"function"!=typeof n.createElement?n.createElement(arguments[0]):b?n.createElementNS.call(n,"http://www.w3.org/2000/svg",arguments[0]):n.createElement.apply(n,arguments)}function u(e,n){return function(){return e.apply(n,arguments)}}function f(e,n,t){var o;for(var s in e)if(e[s]in n)return t===!1?e[s]:(o=n[e[s]],r(o,"function")?u(o,t||n):o);return!1}function d(n,t,r){var o;if("getComputedStyle"in e){o=getComputedStyle.call(e,n,t);var s=e.console;if(null!==o)r&&(o=o.getPropertyValue(r));else if(s){var i=s.error?"error":"log";s[i].call(s,"getComputedStyle returning null, its possible modernizr test results are inaccurate")}}else o=!t&&n.currentStyle&&n.currentStyle[r];return o}function c(e){return e.replace(/([A-Z])/g,function(e,n){return"-"+n.toLowerCase()}).replace(/^ms-/,"-ms-")}function p(){var e=n.body;return e||(e=a(b?"svg":"body"),e.fake=!0),e}function m(e,t,r,o){var s,i,l,u,f="modernizr",d=a("div"),c=p();if(parseInt(r,10))for(;r--;)l=a("div"),l.id=o?o[r]:f+(r+1),d.appendChild(l);return s=a("style"),s.type="text/css",s.id="s"+f,(c.fake?c:d).appendChild(s),c.appendChild(d),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(n.createTextNode(e)),d.id=f,c.fake&&(c.style.background="",c.style.overflow="hidden",u=_.style.overflow,_.style.overflow="hidden",_.appendChild(c)),i=t(d,e),c.fake?(c.parentNode.removeChild(c),_.style.overflow=u,_.offsetHeight):d.parentNode.removeChild(d),!!i}function y(n,r){var o=n.length;if("CSS"in e&&"supports"in e.CSS){for(;o--;)if(e.CSS.supports(c(n[o]),r))return!0;return!1}if("CSSSupportsRule"in e){for(var s=[];o--;)s.push("("+c(n[o])+":"+r+")");return s=s.join(" or "),m("@supports ("+s+") { #modernizr { position: absolute; } }",function(e){return"absolute"==d(e,null,"position")})}return t}function g(e,n,o,s){function u(){d&&(delete N.style,delete N.modElem)}if(s=r(s,"undefined")?!1:s,!r(o,"undefined")){var f=y(e,o);if(!r(f,"undefined"))return f}for(var d,c,p,m,g,v=["modernizr","tspan","samp"];!N.style&&v.length;)d=!0,N.modElem=a(v.shift()),N.style=N.modElem.style;for(p=e.length,c=0;p>c;c++)if(m=e[c],g=N.style[m],i(m,"-")&&(m=l(m)),N.style[m]!==t){if(s||r(o,"undefined"))return u(),"pfx"==n?m:!0;try{N.style[m]=o}catch(h){}if(N.style[m]!=g)return u(),"pfx"==n?m:!0}return u(),!1}function v(e,n,t,o,s){var i=e.charAt(0).toUpperCase()+e.slice(1),l=(e+" "+P.join(i+" ")+i).split(" ");return r(n,"string")||r(n,"undefined")?g(l,n,o,s):(l=(e+" "+z.join(i+" ")+i).split(" "),f(l,n,t))}function h(e,n,r){return v(e,t,t,n,r)}var C=[],S=[],w={_version:"3.6.0",_config:{classPrefix:"",enableClasses:!0,enableJSClass:!0,usePrefixes:!0},_q:[],on:function(e,n){var t=this;setTimeout(function(){n(t[e])},0)},addTest:function(e,n,t){S.push({name:e,fn:n,options:t})},addAsyncTest:function(e){S.push({name:null,fn:e})}},Modernizr=function(){};Modernizr.prototype=w,Modernizr=new Modernizr;var _=n.documentElement,b="svg"===_.nodeName.toLowerCase(),x="Moz O ms Webkit",z=w._config.usePrefixes?x.toLowerCase().split(" "):[];w._domPrefixes=z;var P=w._config.usePrefixes?x.split(" "):[];w._cssomPrefixes=P;var E={elem:a("modernizr")};Modernizr._q.push(function(){delete E.elem});var N={style:E.elem.style};Modernizr._q.unshift(function(){delete N.style}),w.testAllProps=v,w.testAllProps=h,Modernizr.addTest("boxsizing",h("boxSizing","border-box",!0)&&(n.documentMode===t||n.documentMode>7)),o(),s(C),delete w.addTest,delete w.addAsyncTest;for(var T=0;T<Modernizr._q.length;T++)Modernizr._q[T]();e.Modernizr=Modernizr}(window,document);
|
340
Server/wwwroot/js/respond.js
Normal file
340
Server/wwwroot/js/respond.js
Normal file
@ -0,0 +1,340 @@
|
||||
/* NUGET: BEGIN LICENSE TEXT
|
||||
*
|
||||
* Microsoft grants you the right to use these script files for the sole
|
||||
* purpose of either: (i) interacting through your browser with the Microsoft
|
||||
* website or online service, subject to the applicable licensing or use
|
||||
* terms; or (ii) using the files as included with a Microsoft product subject
|
||||
* to that product's license terms. Microsoft reserves all other rights to the
|
||||
* files not expressly granted by Microsoft, whether by implication, estoppel
|
||||
* or otherwise. Insofar as a script file is dual licensed under GPL,
|
||||
* Microsoft neither took the code under GPL nor distributes it thereunder but
|
||||
* under the terms set out in this paragraph. All notices and licenses
|
||||
* below are for informational purposes only.
|
||||
*
|
||||
* NUGET: END LICENSE TEXT */
|
||||
/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas. Dual MIT/BSD license */
|
||||
/*! NOTE: If you're already including a window.matchMedia polyfill via Modernizr or otherwise, you don't need this part */
|
||||
window.matchMedia = window.matchMedia || (function(doc, undefined){
|
||||
|
||||
var bool,
|
||||
docElem = doc.documentElement,
|
||||
refNode = docElem.firstElementChild || docElem.firstChild,
|
||||
// fakeBody required for <FF4 when executed in <head>
|
||||
fakeBody = doc.createElement('body'),
|
||||
div = doc.createElement('div');
|
||||
|
||||
div.id = 'mq-test-1';
|
||||
div.style.cssText = "position:absolute;top:-100em";
|
||||
fakeBody.style.background = "none";
|
||||
fakeBody.appendChild(div);
|
||||
|
||||
return function(q){
|
||||
|
||||
div.innerHTML = '­<style media="'+q+'"> #mq-test-1 { width: 42px; }</style>';
|
||||
|
||||
docElem.insertBefore(fakeBody, refNode);
|
||||
bool = div.offsetWidth == 42;
|
||||
docElem.removeChild(fakeBody);
|
||||
|
||||
return { matches: bool, media: q };
|
||||
};
|
||||
|
||||
})(document);
|
||||
|
||||
|
||||
|
||||
|
||||
/*! Respond.js v1.2.0: min/max-width media query polyfill. (c) Scott Jehl. MIT/GPLv2 Lic. j.mp/respondjs */
|
||||
(function( win ){
|
||||
//exposed namespace
|
||||
win.respond = {};
|
||||
|
||||
//define update even in native-mq-supporting browsers, to avoid errors
|
||||
respond.update = function(){};
|
||||
|
||||
//expose media query support flag for external use
|
||||
respond.mediaQueriesSupported = win.matchMedia && win.matchMedia( "only all" ).matches;
|
||||
|
||||
//if media queries are supported, exit here
|
||||
if( respond.mediaQueriesSupported ){ return; }
|
||||
|
||||
//define vars
|
||||
var doc = win.document,
|
||||
docElem = doc.documentElement,
|
||||
mediastyles = [],
|
||||
rules = [],
|
||||
appendedEls = [],
|
||||
parsedSheets = {},
|
||||
resizeThrottle = 30,
|
||||
head = doc.getElementsByTagName( "head" )[0] || docElem,
|
||||
base = doc.getElementsByTagName( "base" )[0],
|
||||
links = head.getElementsByTagName( "link" ),
|
||||
requestQueue = [],
|
||||
|
||||
//loop stylesheets, send text content to translate
|
||||
ripCSS = function(){
|
||||
var sheets = links,
|
||||
sl = sheets.length,
|
||||
i = 0,
|
||||
//vars for loop:
|
||||
sheet, href, media, isCSS;
|
||||
|
||||
for( ; i < sl; i++ ){
|
||||
sheet = sheets[ i ],
|
||||
href = sheet.href,
|
||||
media = sheet.media,
|
||||
isCSS = sheet.rel && sheet.rel.toLowerCase() === "stylesheet";
|
||||
|
||||
//only links plz and prevent re-parsing
|
||||
if( !!href && isCSS && !parsedSheets[ href ] ){
|
||||
// selectivizr exposes css through the rawCssText expando
|
||||
if (sheet.styleSheet && sheet.styleSheet.rawCssText) {
|
||||
translate( sheet.styleSheet.rawCssText, href, media );
|
||||
parsedSheets[ href ] = true;
|
||||
} else {
|
||||
if( (!/^([a-zA-Z:]*\/\/)/.test( href ) && !base)
|
||||
|| href.replace( RegExp.$1, "" ).split( "/" )[0] === win.location.host ){
|
||||
requestQueue.push( {
|
||||
href: href,
|
||||
media: media
|
||||
} );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
makeRequests();
|
||||
},
|
||||
|
||||
//recurse through request queue, get css text
|
||||
makeRequests = function(){
|
||||
if( requestQueue.length ){
|
||||
var thisRequest = requestQueue.shift();
|
||||
|
||||
ajax( thisRequest.href, function( styles ){
|
||||
translate( styles, thisRequest.href, thisRequest.media );
|
||||
parsedSheets[ thisRequest.href ] = true;
|
||||
makeRequests();
|
||||
} );
|
||||
}
|
||||
},
|
||||
|
||||
//find media blocks in css text, convert to style blocks
|
||||
translate = function( styles, href, media ){
|
||||
var qs = styles.match( /@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi ),
|
||||
ql = qs && qs.length || 0,
|
||||
//try to get CSS path
|
||||
href = href.substring( 0, href.lastIndexOf( "/" )),
|
||||
repUrls = function( css ){
|
||||
return css.replace( /(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g, "$1" + href + "$2$3" );
|
||||
},
|
||||
useMedia = !ql && media,
|
||||
//vars used in loop
|
||||
i = 0,
|
||||
j, fullq, thisq, eachq, eql;
|
||||
|
||||
//if path exists, tack on trailing slash
|
||||
if( href.length ){ href += "/"; }
|
||||
|
||||
//if no internal queries exist, but media attr does, use that
|
||||
//note: this currently lacks support for situations where a media attr is specified on a link AND
|
||||
//its associated stylesheet has internal CSS media queries.
|
||||
//In those cases, the media attribute will currently be ignored.
|
||||
if( useMedia ){
|
||||
ql = 1;
|
||||
}
|
||||
|
||||
|
||||
for( ; i < ql; i++ ){
|
||||
j = 0;
|
||||
|
||||
//media attr
|
||||
if( useMedia ){
|
||||
fullq = media;
|
||||
rules.push( repUrls( styles ) );
|
||||
}
|
||||
//parse for styles
|
||||
else{
|
||||
fullq = qs[ i ].match( /@media *([^\{]+)\{([\S\s]+?)$/ ) && RegExp.$1;
|
||||
rules.push( RegExp.$2 && repUrls( RegExp.$2 ) );
|
||||
}
|
||||
|
||||
eachq = fullq.split( "," );
|
||||
eql = eachq.length;
|
||||
|
||||
for( ; j < eql; j++ ){
|
||||
thisq = eachq[ j ];
|
||||
mediastyles.push( {
|
||||
media : thisq.split( "(" )[ 0 ].match( /(only\s+)?([a-zA-Z]+)\s?/ ) && RegExp.$2 || "all",
|
||||
rules : rules.length - 1,
|
||||
hasquery: thisq.indexOf("(") > -1,
|
||||
minw : thisq.match( /\(min\-width:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/ ) && parseFloat( RegExp.$1 ) + ( RegExp.$2 || "" ),
|
||||
maxw : thisq.match( /\(max\-width:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/ ) && parseFloat( RegExp.$1 ) + ( RegExp.$2 || "" )
|
||||
} );
|
||||
}
|
||||
}
|
||||
|
||||
applyMedia();
|
||||
},
|
||||
|
||||
lastCall,
|
||||
|
||||
resizeDefer,
|
||||
|
||||
// returns the value of 1em in pixels
|
||||
getEmValue = function() {
|
||||
var ret,
|
||||
div = doc.createElement('div'),
|
||||
body = doc.body,
|
||||
fakeUsed = false;
|
||||
|
||||
div.style.cssText = "position:absolute;font-size:1em;width:1em";
|
||||
|
||||
if( !body ){
|
||||
body = fakeUsed = doc.createElement( "body" );
|
||||
body.style.background = "none";
|
||||
}
|
||||
|
||||
body.appendChild( div );
|
||||
|
||||
docElem.insertBefore( body, docElem.firstChild );
|
||||
|
||||
ret = div.offsetWidth;
|
||||
|
||||
if( fakeUsed ){
|
||||
docElem.removeChild( body );
|
||||
}
|
||||
else {
|
||||
body.removeChild( div );
|
||||
}
|
||||
|
||||
//also update eminpx before returning
|
||||
ret = eminpx = parseFloat(ret);
|
||||
|
||||
return ret;
|
||||
},
|
||||
|
||||
//cached container for 1em value, populated the first time it's needed
|
||||
eminpx,
|
||||
|
||||
//enable/disable styles
|
||||
applyMedia = function( fromResize ){
|
||||
var name = "clientWidth",
|
||||
docElemProp = docElem[ name ],
|
||||
currWidth = doc.compatMode === "CSS1Compat" && docElemProp || doc.body[ name ] || docElemProp,
|
||||
styleBlocks = {},
|
||||
lastLink = links[ links.length-1 ],
|
||||
now = (new Date()).getTime();
|
||||
|
||||
//throttle resize calls
|
||||
if( fromResize && lastCall && now - lastCall < resizeThrottle ){
|
||||
clearTimeout( resizeDefer );
|
||||
resizeDefer = setTimeout( applyMedia, resizeThrottle );
|
||||
return;
|
||||
}
|
||||
else {
|
||||
lastCall = now;
|
||||
}
|
||||
|
||||
for( var i in mediastyles ){
|
||||
var thisstyle = mediastyles[ i ],
|
||||
min = thisstyle.minw,
|
||||
max = thisstyle.maxw,
|
||||
minnull = min === null,
|
||||
maxnull = max === null,
|
||||
em = "em";
|
||||
|
||||
if( !!min ){
|
||||
min = parseFloat( min ) * ( min.indexOf( em ) > -1 ? ( eminpx || getEmValue() ) : 1 );
|
||||
}
|
||||
if( !!max ){
|
||||
max = parseFloat( max ) * ( max.indexOf( em ) > -1 ? ( eminpx || getEmValue() ) : 1 );
|
||||
}
|
||||
|
||||
// if there's no media query at all (the () part), or min or max is not null, and if either is present, they're true
|
||||
if( !thisstyle.hasquery || ( !minnull || !maxnull ) && ( minnull || currWidth >= min ) && ( maxnull || currWidth <= max ) ){
|
||||
if( !styleBlocks[ thisstyle.media ] ){
|
||||
styleBlocks[ thisstyle.media ] = [];
|
||||
}
|
||||
styleBlocks[ thisstyle.media ].push( rules[ thisstyle.rules ] );
|
||||
}
|
||||
}
|
||||
|
||||
//remove any existing respond style element(s)
|
||||
for( var i in appendedEls ){
|
||||
if( appendedEls[ i ] && appendedEls[ i ].parentNode === head ){
|
||||
head.removeChild( appendedEls[ i ] );
|
||||
}
|
||||
}
|
||||
|
||||
//inject active styles, grouped by media type
|
||||
for( var i in styleBlocks ){
|
||||
var ss = doc.createElement( "style" ),
|
||||
css = styleBlocks[ i ].join( "\n" );
|
||||
|
||||
ss.type = "text/css";
|
||||
ss.media = i;
|
||||
|
||||
//originally, ss was appended to a documentFragment and sheets were appended in bulk.
|
||||
//this caused crashes in IE in a number of circumstances, such as when the HTML element had a bg image set, so appending beforehand seems best. Thanks to @dvelyk for the initial research on this one!
|
||||
head.insertBefore( ss, lastLink.nextSibling );
|
||||
|
||||
if ( ss.styleSheet ){
|
||||
ss.styleSheet.cssText = css;
|
||||
}
|
||||
else {
|
||||
ss.appendChild( doc.createTextNode( css ) );
|
||||
}
|
||||
|
||||
//push to appendedEls to track for later removal
|
||||
appendedEls.push( ss );
|
||||
}
|
||||
},
|
||||
//tweaked Ajax functions from Quirksmode
|
||||
ajax = function( url, callback ) {
|
||||
var req = xmlHttp();
|
||||
if (!req){
|
||||
return;
|
||||
}
|
||||
req.open( "GET", url, true );
|
||||
req.onreadystatechange = function () {
|
||||
if ( req.readyState != 4 || req.status != 200 && req.status != 304 ){
|
||||
return;
|
||||
}
|
||||
callback( req.responseText );
|
||||
}
|
||||
if ( req.readyState == 4 ){
|
||||
return;
|
||||
}
|
||||
req.send( null );
|
||||
},
|
||||
//define ajax obj
|
||||
xmlHttp = (function() {
|
||||
var xmlhttpmethod = false;
|
||||
try {
|
||||
xmlhttpmethod = new XMLHttpRequest();
|
||||
}
|
||||
catch( e ){
|
||||
xmlhttpmethod = new ActiveXObject( "Microsoft.XMLHTTP" );
|
||||
}
|
||||
return function(){
|
||||
return xmlhttpmethod;
|
||||
};
|
||||
})();
|
||||
|
||||
//translate CSS
|
||||
ripCSS();
|
||||
|
||||
//expose update for re-running respond later on
|
||||
respond.update = ripCSS;
|
||||
|
||||
//adjust on resize
|
||||
function callMedia(){
|
||||
applyMedia( true );
|
||||
}
|
||||
if( win.addEventListener ){
|
||||
win.addEventListener( "resize", callMedia, false );
|
||||
}
|
||||
else if( win.attachEvent ){
|
||||
win.attachEvent( "onresize", callMedia );
|
||||
}
|
||||
})(this);
|
20
Server/wwwroot/js/respond.min.js
vendored
Normal file
20
Server/wwwroot/js/respond.min.js
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
/* NUGET: BEGIN LICENSE TEXT
|
||||
*
|
||||
* Microsoft grants you the right to use these script files for the sole
|
||||
* purpose of either: (i) interacting through your browser with the Microsoft
|
||||
* website or online service, subject to the applicable licensing or use
|
||||
* terms; or (ii) using the files as included with a Microsoft product subject
|
||||
* to that product's license terms. Microsoft reserves all other rights to the
|
||||
* files not expressly granted by Microsoft, whether by implication, estoppel
|
||||
* or otherwise. Insofar as a script file is dual licensed under GPL,
|
||||
* Microsoft neither took the code under GPL nor distributes it thereunder but
|
||||
* under the terms set out in this paragraph. All notices and licenses
|
||||
* below are for informational purposes only.
|
||||
*
|
||||
* NUGET: END LICENSE TEXT */
|
||||
/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas. Dual MIT/BSD license */
|
||||
/*! NOTE: If you're already including a window.matchMedia polyfill via Modernizr or otherwise, you don't need this part */
|
||||
window.matchMedia=window.matchMedia||(function(e,f){var c,a=e.documentElement,b=a.firstElementChild||a.firstChild,d=e.createElement("body"),g=e.createElement("div");g.id="mq-test-1";g.style.cssText="position:absolute;top:-100em";d.style.background="none";d.appendChild(g);return function(h){g.innerHTML='­<style media="'+h+'"> #mq-test-1 { width: 42px; }</style>';a.insertBefore(d,b);c=g.offsetWidth==42;a.removeChild(d);return{matches:c,media:h}}})(document);
|
||||
|
||||
/*! Respond.js v1.2.0: min/max-width media query polyfill. (c) Scott Jehl. MIT/GPLv2 Lic. j.mp/respondjs */
|
||||
(function(e){e.respond={};respond.update=function(){};respond.mediaQueriesSupported=e.matchMedia&&e.matchMedia("only all").matches;if(respond.mediaQueriesSupported){return}var w=e.document,s=w.documentElement,i=[],k=[],q=[],o={},h=30,f=w.getElementsByTagName("head")[0]||s,g=w.getElementsByTagName("base")[0],b=f.getElementsByTagName("link"),d=[],a=function(){var D=b,y=D.length,B=0,A,z,C,x;for(;B<y;B++){A=D[B],z=A.href,C=A.media,x=A.rel&&A.rel.toLowerCase()==="stylesheet";if(!!z&&x&&!o[z]){if(A.styleSheet&&A.styleSheet.rawCssText){m(A.styleSheet.rawCssText,z,C);o[z]=true}else{if((!/^([a-zA-Z:]*\/\/)/.test(z)&&!g)||z.replace(RegExp.$1,"").split("/")[0]===e.location.host){d.push({href:z,media:C})}}}}u()},u=function(){if(d.length){var x=d.shift();n(x.href,function(y){m(y,x.href,x.media);o[x.href]=true;u()})}},m=function(I,x,z){var G=I.match(/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi),J=G&&G.length||0,x=x.substring(0,x.lastIndexOf("/")),y=function(K){return K.replace(/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,"$1"+x+"$2$3")},A=!J&&z,D=0,C,E,F,B,H;if(x.length){x+="/"}if(A){J=1}for(;D<J;D++){C=0;if(A){E=z;k.push(y(I))}else{E=G[D].match(/@media *([^\{]+)\{([\S\s]+?)$/)&&RegExp.$1;k.push(RegExp.$2&&y(RegExp.$2))}B=E.split(",");H=B.length;for(;C<H;C++){F=B[C];i.push({media:F.split("(")[0].match(/(only\s+)?([a-zA-Z]+)\s?/)&&RegExp.$2||"all",rules:k.length-1,hasquery:F.indexOf("(")>-1,minw:F.match(/\(min\-width:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:F.match(/\(max\-width:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}}j()},l,r,v=function(){var z,A=w.createElement("div"),x=w.body,y=false;A.style.cssText="position:absolute;font-size:1em;width:1em";if(!x){x=y=w.createElement("body");x.style.background="none"}x.appendChild(A);s.insertBefore(x,s.firstChild);z=A.offsetWidth;if(y){s.removeChild(x)}else{x.removeChild(A)}z=p=parseFloat(z);return z},p,j=function(I){var x="clientWidth",B=s[x],H=w.compatMode==="CSS1Compat"&&B||w.body[x]||B,D={},G=b[b.length-1],z=(new Date()).getTime();if(I&&l&&z-l<h){clearTimeout(r);r=setTimeout(j,h);return}else{l=z}for(var E in i){var K=i[E],C=K.minw,J=K.maxw,A=C===null,L=J===null,y="em";if(!!C){C=parseFloat(C)*(C.indexOf(y)>-1?(p||v()):1)}if(!!J){J=parseFloat(J)*(J.indexOf(y)>-1?(p||v()):1)}if(!K.hasquery||(!A||!L)&&(A||H>=C)&&(L||H<=J)){if(!D[K.media]){D[K.media]=[]}D[K.media].push(k[K.rules])}}for(var E in q){if(q[E]&&q[E].parentNode===f){f.removeChild(q[E])}}for(var E in D){var M=w.createElement("style"),F=D[E].join("\n");M.type="text/css";M.media=E;f.insertBefore(M,G.nextSibling);if(M.styleSheet){M.styleSheet.cssText=F}else{M.appendChild(w.createTextNode(F))}q.push(M)}},n=function(x,z){var y=c();if(!y){return}y.open("GET",x,true);y.onreadystatechange=function(){if(y.readyState!=4||y.status!=200&&y.status!=304){return}z(y.responseText)};if(y.readyState==4){return}y.send(null)},c=(function(){var x=false;try{x=new XMLHttpRequest()}catch(y){x=new ActiveXObject("Microsoft.XMLHTTP")}return function(){return x}})();a();respond.update=a;function t(){j(true)}if(e.addEventListener){e.addEventListener("resize",t,false)}else{if(e.attachEvent){e.attachEvent("onresize",t)}}})(this);
|
637
Server/wwwroot/js/site.js
Normal file
637
Server/wwwroot/js/site.js
Normal file
@ -0,0 +1,637 @@
|
||||
var _CdeId = null;
|
||||
var _apiUrl = null;
|
||||
var _BioRadId = null;
|
||||
var _toolType = null;
|
||||
var _initialHeaderId = null;
|
||||
var _toolTypeMetaData = null;
|
||||
var _initialHeaderAttachmentId = null;
|
||||
|
||||
$(document).ready(function () {
|
||||
if (location.pathname == "/") {
|
||||
route = "/AwaitingDispo";
|
||||
}
|
||||
else {
|
||||
route = location.pathname;
|
||||
}
|
||||
$('ul.nav.navbar-nav').find('a[href="' + route + '"]')
|
||||
.closest('li').addClass('alert-info');
|
||||
});
|
||||
|
||||
function loadRunInfoAwaitingDisposition() {
|
||||
var row = $("#grid").igGrid("selectedRow");
|
||||
if (row == null)
|
||||
return;
|
||||
var data = $("#grid").igGrid("findRecordByKey", row.id);
|
||||
if (data == null)
|
||||
return;
|
||||
var targetURL = "RunInfo?tooltypeid=" + data.ToolTypeID + "&headerid=" + data.ID;
|
||||
window.location.href = targetURL;
|
||||
}
|
||||
|
||||
function initAwaitingDisposition(apiUrl) {
|
||||
_apiUrl = apiUrl;
|
||||
$("#grid").igGrid({
|
||||
autoGenerateColumns: false,
|
||||
width: "70%",
|
||||
height: "100%",
|
||||
primaryKey: "PK",
|
||||
columns: [
|
||||
{ key: "PK", dataType: "string", hidden: true, },
|
||||
{ key: "ID", dataType: "number", hidden: true, },
|
||||
{ key: "ToolTypeID", dataType: "number", hidden: true, },
|
||||
{ headerText: "Tool Type", key: "ToolType", dataType: "string", width: "15%" },
|
||||
{ key: "Tool", dataType: "string", width: "10%" },
|
||||
{ key: "Reactor", dataType: "string", width: "10%" },
|
||||
{ key: "RDS", dataType: "string", width: "10%" },
|
||||
{ key: "PSN", dataType: "string", width: "10%" },
|
||||
{ key: "Layer", dataType: "string", width: "10%" },
|
||||
{ key: "Zone", dataType: "string", width: "10%" },
|
||||
{ key: "InsertDate", dataType: "date", width: "10%", format: "dateTime" },
|
||||
{ key: "Expiration", dataType: "date", width: "10%", format: "dateTime" }
|
||||
],
|
||||
dataSource: _apiUrl + "/awaitingdispo/",
|
||||
responseDataKey: "Results",
|
||||
tabIndex: 1,
|
||||
features: [
|
||||
{ name: "Selection", mode: "row", multipleSelection: false },
|
||||
{ name: "Filtering", type: "local" },
|
||||
{ name: "Sorting", type: "local" },
|
||||
]
|
||||
});
|
||||
$("#RefreshButton").click(function () {
|
||||
$("#grid").igGrid("dataBind");
|
||||
});
|
||||
$("#OpenButton").click(loadRunInfoAwaitingDisposition);
|
||||
$("#grid").on("dblclick", "tr", loadRunInfoAwaitingDisposition);
|
||||
};
|
||||
|
||||
function initExport(apiUrl, startTimeValue, endTimeValue) {
|
||||
_apiUrl = apiUrl;
|
||||
var endTime = new Date(endTimeValue);
|
||||
var startTime = new Date(startTimeValue);
|
||||
$.getJSON(_apiUrl + '/tooltypes', function (data) {
|
||||
$("#ToolType").igCombo({
|
||||
dataSource: data,
|
||||
responseDataKey: "Results",
|
||||
textKey: "ToolTypeName",
|
||||
valueKey: "ID",
|
||||
mode: "dropdown",
|
||||
width: 150
|
||||
});
|
||||
});
|
||||
$("#StartDateControl").igDatePicker({
|
||||
dateInputFormat: "date",
|
||||
value: startTime,
|
||||
width: 125,
|
||||
inputName: "StartDate",
|
||||
});
|
||||
$("#StartTimeControl").igTimePicker({
|
||||
dateInputFormat: "time",
|
||||
value: startTime,
|
||||
width: 110,
|
||||
inputName: "StartTime",
|
||||
});
|
||||
$("#EndDateControl").igDatePicker({
|
||||
dateInputFormat: "date",
|
||||
value: endTime,
|
||||
width: 125,
|
||||
inputName: "EndDate",
|
||||
});
|
||||
$("#EndTimeControl").igTimePicker({
|
||||
dateInputFormat: "time",
|
||||
value: endTime,
|
||||
width: 110,
|
||||
inputName: "EndTime",
|
||||
});
|
||||
};
|
||||
|
||||
function loadHeaderGridRunHeaders() {
|
||||
var toolTypeID = -1; // $("#ToolType").igCombo("value");
|
||||
var gridCreated = $("#HeaderGrid").data("igGrid");
|
||||
if (gridCreated)
|
||||
$("#HeaderGrid").igGrid("destroy");
|
||||
clearFieldsGridRunHeaders();
|
||||
var headerURL = _apiUrl + "/tooltypes/" + toolTypeID + "/headertitles";
|
||||
$("#HeaderGrid").igGrid({
|
||||
autoGenerateColumns: false,
|
||||
primaryKey: "ID",
|
||||
height: "100%",
|
||||
width: "100%",
|
||||
features: [
|
||||
{ name: "Paging", type: "local", recordCountKey: "TotalRows", pageSize: 25, pageSizeUrlKey: "pageSize", "pageIndexUrlKey": "page", showPageSizeDropDown: false },
|
||||
{ name: "Selection", mode: "row", rowSelectionChanged: headerSelectionChangedRunHeaders },
|
||||
{ name: "Filtering", type: "local" }
|
||||
],
|
||||
columns: [
|
||||
{ key: "ID", dataType: "number", hidden: true },
|
||||
{ key: "ToolTypeID", dataType: "number", hidden: true },
|
||||
{ key: "ToolTypeName", dataType: "string", width: "10%" },
|
||||
{ key: "Title", dataType: "string", width: "40%" },
|
||||
{ key: "Reactor", dataType: "string", width: "10%" },
|
||||
{ key: "RDS", dataType: "string", width: "10%" },
|
||||
{ key: "PSN", dataType: "string", width: "10%" },
|
||||
{ key: "InsertDate", dataType: "date", format: "dateTime", width: "20%" }
|
||||
],
|
||||
dataSource: headerURL,
|
||||
responseDataKey: "Results",
|
||||
});
|
||||
}
|
||||
|
||||
function clearFieldsGridRunHeaders() {
|
||||
var gridCreated = $("#FieldsGrid").data("igGrid");
|
||||
if (gridCreated)
|
||||
$("#FieldsGrid").igGrid("destroy");
|
||||
}
|
||||
|
||||
function headerSelectionChangedRunHeaders(evt, ui) {
|
||||
clearFieldsGridRunHeaders();
|
||||
var rowData = ui.owner.grid.dataSource.dataView()[ui.row.index];
|
||||
var url = _apiUrl + "/tooltypes/" + rowData.ToolTypeID + "/headers/" + ui.row.id + "/fields";
|
||||
$("#FieldsGrid").igGrid({
|
||||
autoGenerateColumns: false,
|
||||
primaryKey: "Column",
|
||||
height: "100%",
|
||||
width: "100%",
|
||||
features: [
|
||||
{ name: 'Resizing' }
|
||||
],
|
||||
columns: [
|
||||
{ key: "Column", dataType: "string", width: "20%", columnCssClass: "FieldTitle", },
|
||||
{ key: "Value", dataType: "string", }
|
||||
],
|
||||
enableHoverStyles: false,
|
||||
dataSource: url,
|
||||
responseDataKey: "Results",
|
||||
});
|
||||
}
|
||||
|
||||
function loadRunInfoRunHeaders() {
|
||||
var row = $("#HeaderGrid").igGrid("selectedRow");
|
||||
if (row == null)
|
||||
return;
|
||||
var data = $("#HeaderGrid").igGrid("findRecordByKey", row.id);
|
||||
if (data == null)
|
||||
return;
|
||||
var targetURL = "RunInfo?tooltypeid=" + data.ToolTypeID + "&headerid=" + data.ID;
|
||||
window.location.href = targetURL;
|
||||
}
|
||||
|
||||
function initRunHeaders(apiUrl) {
|
||||
_apiUrl = apiUrl;
|
||||
loadHeaderGridRunHeaders();
|
||||
$("#RefreshButton").click(function () {
|
||||
$("#HeaderGrid").igGrid("dataBind");
|
||||
});
|
||||
$("#OpenButton").click(loadRunInfoRunHeaders);
|
||||
$("#HeaderGrid").on("dblclick", "tr", loadRunInfoRunHeaders);
|
||||
}
|
||||
|
||||
function loadHeaderGridRunInfo() {
|
||||
var toolTypeID = $("#ToolType").igCombo("value");
|
||||
$("#ToolTypeID").text(toolTypeID);
|
||||
hideDetailsDivRunInfo();
|
||||
disableHeaderButtonsRunInfo();
|
||||
$("#HeaderId").text("");
|
||||
$("#HeaderAttachmentId").text("");
|
||||
var gridCreated = $("#HeaderGrid").data("igGrid");
|
||||
if (gridCreated)
|
||||
$("#HeaderGrid").igGrid("destroy");
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: _apiUrl + "/tooltypes/" + toolTypeID + "?sortby=grid",
|
||||
success: function (r) {
|
||||
if ((r.Results == null) || (r.Results.ToolType == null) || (r.Results.Metadata == null))
|
||||
ShowErrorMessage("Invalid tool type: " + toolTypeID);
|
||||
else {
|
||||
_toolType = r.Results.ToolType;
|
||||
_toolTypeMetaData = r.Results.Metadata;
|
||||
requestHeaderDataRunInfo();
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
DisplayWSMessage("error", "There was an error getting tooltype info.", e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function disableHeaderButtonsRunInfo() {
|
||||
$("#GetDataButton").prop("disabled", true);
|
||||
$("#ReviewButton").prop("disabled", true);
|
||||
$("#PinButton").prop("disabled", true);
|
||||
}
|
||||
|
||||
function enableHeaderButtonsRunInfo() {
|
||||
$("#GetDataButton").prop("disabled", false);
|
||||
$("#ReviewButton").prop("disabled", false);
|
||||
$("#PinButton").prop("disabled", false);
|
||||
}
|
||||
|
||||
function hideDetailsDivRunInfo() {
|
||||
$("#DetailsDiv").prop("hidden", true);
|
||||
$("#DataAttachmentFrame").prop("src", "");
|
||||
}
|
||||
|
||||
function showDetailsDivRunInfo() {
|
||||
$("#DetailsDiv").prop("hidden", false);
|
||||
$("#ExportDiv").prop("hidden", true);
|
||||
if ((_toolType != null) && (_toolType.OIExportSPName != null) && (_toolType.OIExportSPName.length > 0)) {
|
||||
$("#ExportDiv").prop("hidden", false);
|
||||
$("#OIExportButton").prop("disabled", false);
|
||||
$("#OIExportResult").text('');
|
||||
}
|
||||
$("#DataAttachmentFrame").prop("hidden", true);
|
||||
$("#HeaderAttachmentFrame").prop("hidden", true);
|
||||
if (_toolType != null) {
|
||||
var visibleFrames = 0;
|
||||
if (_toolType.DisplayDataAttachment && _toolType.DisplayDataAttachment.length > 0) {
|
||||
visibleFrames += 1;
|
||||
$("#DataAttachmentFrame").prop("hidden", false);
|
||||
}
|
||||
if (_toolType.DisplayHeaderAttachment && _toolType.DisplayHeaderAttachment.length > 0) {
|
||||
visibleFrames += 1;
|
||||
$("#HeaderAttachmentFrame").prop("hidden", false);
|
||||
}
|
||||
var frameWidth = (98 / visibleFrames) + "%";
|
||||
$("#DataAttachmentFrame,#HeaderAttachmentFrame").css('width', frameWidth);
|
||||
}
|
||||
}
|
||||
|
||||
function headerSelectionChangedRunInfo(evt, ui) {
|
||||
if (ui.row.index >= 0) {
|
||||
if ($("#HeaderId").text() == ui.row.id) {
|
||||
enableHeaderButtonsRunInfo();
|
||||
return;
|
||||
}
|
||||
}
|
||||
disableHeaderButtonsRunInfo();
|
||||
hideDetailsDivRunInfo();
|
||||
if (ui.row.index >= 0) {
|
||||
enableHeaderButtonsRunInfo();
|
||||
$("#HeaderId").text(ui.row.id);
|
||||
var rowData = ui.owner.grid.dataSource.dataView()[ui.row.index];
|
||||
$("#HeaderAttachmentId").text(rowData.AttachmentID);
|
||||
}
|
||||
}
|
||||
|
||||
function cancelHandlerRunInfo(evt, ui) {
|
||||
return false;
|
||||
}
|
||||
|
||||
function detailSelectionChangedRunInfo(evt, ui) {
|
||||
$("#DataAttachmentFrame").prop("src", "");
|
||||
if (ui.row.index >= 0) {
|
||||
var rowData = ui.owner.grid.dataSource.dataView()[ui.row.index];
|
||||
var toolTypeID = $("#ToolTypeID").text();
|
||||
var attachmentUrlBase = _apiUrl + '/tooltypes/' + toolTypeID;
|
||||
var attachmentId = rowData.AttachmentID;
|
||||
if ((attachmentId == null) || (attachmentId === ''))
|
||||
return;
|
||||
if ((_toolType.DisplayDataAttachment == null) || (_toolType.DisplayDataAttachment === ''))
|
||||
return;
|
||||
$("#DataAttachmentFrame").prop("src", attachmentUrlBase + "/data/files/" + attachmentId + "/" + _toolType.DisplayDataAttachment);
|
||||
}
|
||||
}
|
||||
|
||||
function loadHeaderAttachmentRunInfo() {
|
||||
var toolTypeID = $("#ToolTypeID").text();
|
||||
var attachmentId = $("#HeaderAttachmentId").text();
|
||||
var attachmentUrlBase = _apiUrl + '/tooltypes/' + toolTypeID;
|
||||
if ((attachmentId == null) || (attachmentId === '') || (_toolType.DisplayHeaderAttachment == null) || (_toolType.DisplayHeaderAttachment === '')) {
|
||||
$("#HeaderAttachmentFrame").prop("src", "");
|
||||
} else {
|
||||
$("#HeaderAttachmentFrame").prop("src", attachmentUrlBase + "/header/files/" + attachmentId + "/" + _toolType.DisplayHeaderAttachment);
|
||||
}
|
||||
$("#DataAttachmentFrame").prop("src", "");
|
||||
}
|
||||
|
||||
function markAsReviewedRunInfo() {
|
||||
var toolTypeId = $("#ToolTypeID").text();
|
||||
var headerId = $("#HeaderId").text();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: _apiUrl + "/awaitingdispo/markasreviewed?tooltypeid=" + toolTypeId + "&headerid=" + headerId,
|
||||
success: function () {
|
||||
},
|
||||
error: function (e, ajaxOptions, ex) {
|
||||
DisplayWSMessage("error", "There was an error marking header as reviewed.", e, ex);
|
||||
$("#ReviewButton").prop("disabled", false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function loadDetailsRunInfo() {
|
||||
showDetailsDivRunInfo();
|
||||
loadHeaderAttachmentRunInfo();
|
||||
var gridCreated = $("#DetailsGrid").data("igGrid");
|
||||
if (gridCreated)
|
||||
$("#DetailsGrid").igGrid("destroy");
|
||||
var headerId = $("#HeaderId").text();
|
||||
var toolTypeID = $("#ToolTypeID").text();
|
||||
var detailsURL = _apiUrl + "/tooltypes/" + toolTypeID + "/headers/" + headerId + "/data";
|
||||
var gridColumns = [
|
||||
{ key: "AttachmentID", dataType: "string", hidden: true },
|
||||
{ key: "Title", dataType: "string", hidden: true },
|
||||
];
|
||||
for (var i = 0; i < _toolTypeMetaData.length; i++) {
|
||||
var f = _toolTypeMetaData[i];
|
||||
if ((f.Header == false) && (f.GridDisplayOrder > 0)) {
|
||||
var col = {
|
||||
key: f.ColumnName,
|
||||
headerText: f.DisplayTitle,
|
||||
width: "150px",
|
||||
};
|
||||
if (f.GridAttributes != null)
|
||||
jQuery.extend(col, JSON.parse(f.GridAttributes));
|
||||
if (col.formatter != null) {
|
||||
if (col.formatter == "boolToYesNo")
|
||||
col.formatter = boolToYesNo;
|
||||
else
|
||||
col.formatter = null;
|
||||
}
|
||||
gridColumns.push(col);
|
||||
}
|
||||
}
|
||||
var gridParms = {
|
||||
autoGenerateColumns: false,
|
||||
primaryKey: "ID",
|
||||
features: [
|
||||
{ name: "Selection", mode: "row", rowSelectionChanging: detailSelectionChangedRunInfo },
|
||||
{ name: "Resizing" },
|
||||
{ name: "Sorting", type: "local" }
|
||||
],
|
||||
columns: gridColumns,
|
||||
dataSource: detailsURL,
|
||||
responseDataKey: "Results",
|
||||
dataBound: markAsReviewedRunInfo,
|
||||
};
|
||||
if ((_toolType != null) && (_toolType.DataGridAttributes != null)) {
|
||||
jQuery.extend(gridParms, JSON.parse(_toolType.DataGridAttributes));
|
||||
}
|
||||
$("#DetailsGrid").igGrid(gridParms);
|
||||
}
|
||||
|
||||
function requestHeaderDataRunInfo() {
|
||||
var startDate = $("#StartDate").igDatePicker("value");
|
||||
var startTime = $("#StartTime").igTimePicker("value");
|
||||
var endDate = $("#EndDate").igDatePicker("value");
|
||||
var endTime = $("#EndTime").igTimePicker("value");
|
||||
var parms = {
|
||||
datebegin: new Date(
|
||||
startDate.getFullYear(), startDate.getMonth(), startDate.getDate(),
|
||||
startTime.getHours(), startTime.getMinutes(), startTime.getSeconds()).toISOString(),
|
||||
dateend: new Date(
|
||||
endDate.getFullYear(), endDate.getMonth(), endDate.getDate(),
|
||||
endTime.getHours(), endTime.getMinutes(), endTime.getSeconds()).toISOString(),
|
||||
}
|
||||
var headerId = 0;
|
||||
if (_initialHeaderId > 0) {
|
||||
headerId = _initialHeaderId;
|
||||
parms.headerid = headerId;
|
||||
$("#HeaderId").text(headerId);
|
||||
$("#HeaderAttachmentId").text(_initialHeaderAttachmentId);
|
||||
_initialHeaderId = -1;
|
||||
}
|
||||
var headerURL = _apiUrl + "/tooltypes/" + _toolType.ID + "/headers?" + $.param(parms);
|
||||
var gridColumns = [
|
||||
{ key: "ID", dataType: "number", hidden: true },
|
||||
{ key: "AttachmentID", dataType: "string", hidden: true },
|
||||
{ key: "Title", dataType: "string", hidden: true },
|
||||
];
|
||||
for (var i = 0; i < _toolTypeMetaData.length; i++) {
|
||||
var f = _toolTypeMetaData[i];
|
||||
if ((f.Header == true) && (f.GridDisplayOrder > 0)) {
|
||||
var col = {
|
||||
key: f.ColumnName,
|
||||
headerText: f.DisplayTitle,
|
||||
width: "150px",
|
||||
};
|
||||
if (f.GridAttributes != null)
|
||||
jQuery.extend(col, JSON.parse(f.GridAttributes));
|
||||
if (col.formatter != null) {
|
||||
if (col.formatter == "boolToYesNo")
|
||||
col.formatter = boolToYesNo;
|
||||
else
|
||||
col.formatter = null;
|
||||
}
|
||||
gridColumns.push(col);
|
||||
}
|
||||
}
|
||||
var gridParms = {
|
||||
autoGenerateColumns: false,
|
||||
primaryKey: "ID",
|
||||
height: "100%",
|
||||
width: "100%",
|
||||
features: [
|
||||
{ name: "Paging", type: "local", recordCountKey: "TotalRows", pageSize: 100, pageSizeList: [50, 100, 250, 500], pageSizeUrlKey: "pageSize", "pageIndexUrlKey": "page" },
|
||||
{ name: "Selection", mode: "row", rowSelectionChanged: headerSelectionChangedRunInfo },
|
||||
{ name: "Filtering", type: "local" },
|
||||
{ name: 'Resizing' },
|
||||
{ name: "Sorting", type: "local" }
|
||||
],
|
||||
columns: gridColumns,
|
||||
dataSource: headerURL,
|
||||
responseDataKey: "Results",
|
||||
};
|
||||
if ((_toolType != null) && (_toolType.HeaderGridAttributes != null)) {
|
||||
jQuery.extend(gridParms, JSON.parse(_toolType.HeaderGridAttributes));
|
||||
}
|
||||
$("#HeaderGrid").igGrid(gridParms);
|
||||
if (headerId > 0) {
|
||||
loadDetailsRunInfo();
|
||||
}
|
||||
}
|
||||
|
||||
function reviewButtonRunInfo() {
|
||||
var toolTypeId = $("#ToolTypeID").text();
|
||||
var headerId = parseInt($("#HeaderId").text());
|
||||
$("#ReviewButton").prop("disabled", true);
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: _apiUrl + "/awaitingdispo/markasawaiting?tooltypeid=" + toolTypeId + "&headerid=" + headerId,
|
||||
success: function (e) {
|
||||
DisplayWSMessage("info", "Marked as awaiting disposition", e);
|
||||
$("#ReviewButton").prop("disabled", false);
|
||||
},
|
||||
error: function (e, ajaxOptions, ex) {
|
||||
DisplayWSMessage("error", "There was an error marking header as awaiting disposition.", e, ex);
|
||||
$("#ReviewButton").prop("disabled", false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function pinButtonRunInfo() {
|
||||
var toolTypeId = $("#ToolTypeID").text();
|
||||
var selectedRow = $("#HeaderGrid").data("igGridSelection").selectedRow();
|
||||
if (selectedRow !== null) {
|
||||
$("#PinButton").prop("disabled", true);
|
||||
var rowData = $("#HeaderGrid").data("igGrid").dataSource.dataView()[selectedRow.index];
|
||||
var stringified = JSON.stringify(rowData);
|
||||
stringified = stringified.replace(/"Tool":/gm, '"MesEntity":');
|
||||
stringified = stringified.replace(/"Equipment ID":/gm, '"MesEntity":');
|
||||
var jsonObject = JSON.parse(stringified);
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: _apiUrl + '/pin/' + toolTypeId + "/markAsPinned",
|
||||
data: jsonObject,
|
||||
success: function (e) {
|
||||
DisplayWSMessage("info", "Marked as pinned", e);
|
||||
// DisplayWSMessage("info", stringified, e);
|
||||
$("#PinButton").prop("disabled", false);
|
||||
$.getJSON(_apiUrl + '/pin/' + toolTypeId + "/pinned?biorad_id=" + _BioRadId + "&cde_id=" + _CdeId + "&rds=" + rowData.RDS, function (data) {
|
||||
$("#ModalHeaderGrid").igGrid({
|
||||
dataSource: data,
|
||||
features: [
|
||||
{ name: 'Resizing' }
|
||||
],
|
||||
columns: [
|
||||
{ key: "ID", dataType: "number", hidden: true, },
|
||||
{ key: "ToolTypeID", dataType: "number", hidden: true, },
|
||||
{ headerText: "Tool", key: "MesEntity", dataType: "string", width: "10%" },
|
||||
{ key: "Reactor", dataType: "string", width: "10%" },
|
||||
{ key: "RDS", dataType: "string", width: "10%" },
|
||||
{ key: "PSN", dataType: "string", width: "10%" },
|
||||
{ key: "Layer", dataType: "string", width: "10%" },
|
||||
{ key: "Zone", dataType: "string", width: "10%" }
|
||||
],
|
||||
responseDataKey: "Results",
|
||||
});
|
||||
var text = "";
|
||||
for (var i = 0; i < data.Results.length; i++) {
|
||||
text = text + data.Results[i].Point1 + "\t" + data.Results[i].Point2 + "\t" + data.Results[i].Point3 + "\t" + data.Results[i].Point4 + "\t" + data.Results[i].Point5 + "\t" + data.Results[i].Point6 + "\t" + data.Results[i].Point7 + "\t" + data.Results[i].Point8 + "\t" + data.Results[i].Point9 + "\r";
|
||||
}
|
||||
$("#textareaClipboard").val(text);
|
||||
$("#ModalBodyGrid").igGrid({
|
||||
dataSource: data,
|
||||
features: [
|
||||
{ name: 'Resizing' }
|
||||
],
|
||||
columns: [
|
||||
{ key: "ID", dataType: "number", hidden: true, },
|
||||
{ key: "ToolTypeID", dataType: "number", hidden: true, },
|
||||
{ headerText: "Point 1", key: "Point1", dataType: "number", width: "10%" },
|
||||
{ headerText: "Point 2", key: "Point2", dataType: "number", width: "10%" },
|
||||
{ headerText: "Point 3", key: "Point3", dataType: "number", width: "10%" },
|
||||
{ headerText: "Point 4", key: "Point4", dataType: "number", width: "10%" },
|
||||
{ headerText: "Point 5", key: "Point5", dataType: "number", width: "10%" },
|
||||
{ headerText: "Point 6", key: "Point6", dataType: "number", width: "10%" },
|
||||
{ headerText: "Point 7", key: "Point7", dataType: "number", width: "10%" },
|
||||
{ headerText: "Point 8", key: "Point8", dataType: "number", width: "10%" },
|
||||
{ headerText: "Point 9", key: "Point9", dataType: "number", width: "10%" },
|
||||
],
|
||||
responseDataKey: "Results",
|
||||
});
|
||||
});
|
||||
},
|
||||
error: function (e, ajaxOptions, ex) {
|
||||
DisplayWSMessage("error", "There was an error marking header as pinned.", e, ex);
|
||||
$("#PinButton").prop("disabled", false);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function oiExportButtonRunInfo() {
|
||||
var headerId = $("#HeaderId").text();
|
||||
var toolTypeID = $("#ToolTypeID").text();
|
||||
$("#OIExportButton").prop("disabled", true);
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: _apiUrl + "/tooltypes/" + toolTypeID + "/headers/" + headerId + "/oiexport",
|
||||
success: function (r) {
|
||||
$("#OIExportResult").text("Exported!");
|
||||
},
|
||||
error: function (e, ajaxOptions, ex) {
|
||||
DisplayWSMessage("error", "There was an error exporting.", e, ex);
|
||||
$("#OIExportButton").prop("disabled", false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function setInitialDateTimesRunInfo() {
|
||||
var startTime = new Date(Date.now() - 6 * 60 * 60 * 1000);//6 hours back from now
|
||||
$("#StartDate").igDatePicker({
|
||||
dateInputFormat: "date",
|
||||
value: startTime,
|
||||
width: 125
|
||||
});
|
||||
$("#StartTime").igTimePicker({
|
||||
dateInputFormat: "time",
|
||||
value: startTime,
|
||||
width: 110
|
||||
});
|
||||
var endTime = new Date(Date.now());
|
||||
$("#EndDate").igDatePicker({
|
||||
dateInputFormat: "date",
|
||||
value: endTime,
|
||||
width: 125
|
||||
});
|
||||
$("#EndTime").igTimePicker({
|
||||
dateInputFormat: "time",
|
||||
value: endTime,
|
||||
width: 110
|
||||
});
|
||||
}
|
||||
|
||||
function initRunInfo(apiUrl, initialToolTypeID, initialHeaderId, initialHeaderAttachmentId) {
|
||||
_apiUrl = apiUrl;
|
||||
_initialHeaderId = initialHeaderId;
|
||||
_initialHeaderAttachmentId = initialHeaderAttachmentId;
|
||||
$.getJSON(_apiUrl + '/tooltypes', function (data) {
|
||||
for (var i = 0; i < data.Results.length; i++) {
|
||||
if (data.Results[i].ToolTypeName === "CDE") {
|
||||
_CdeId = data.Results[i].ID;
|
||||
}
|
||||
else if (data.Results[i].ToolTypeName === "BioRad") {
|
||||
_BioRadId = data.Results[i].ID;
|
||||
}
|
||||
}
|
||||
$("#ToolType").igCombo({
|
||||
dataSource: data,
|
||||
responseDataKey: "Results",
|
||||
textKey: "ToolTypeName",
|
||||
valueKey: "ID",
|
||||
mode: "dropdown",
|
||||
width: 150,
|
||||
itemsRendered: function (evt, ui) {
|
||||
loadHeaderGridRunInfo();
|
||||
},
|
||||
selectionChanged: loadHeaderGridRunInfo,
|
||||
initialSelectedItems: [{ value: initialToolTypeID }]
|
||||
});
|
||||
});
|
||||
setInitialDateTimesRunInfo();
|
||||
$("#HeaderGrid").on("dblclick", "tr", loadDetailsRunInfo);
|
||||
$("#LoadHeadersButton").click(loadHeaderGridRunInfo);
|
||||
$("#GetDataButton").click(loadDetailsRunInfo);
|
||||
$("#ReviewButton").click(reviewButtonRunInfo);
|
||||
$("#PinButton").click(pinButtonRunInfo);
|
||||
$("#OIExportButton").click(oiExportButtonRunInfo);
|
||||
setInterval(function () {
|
||||
if ($("#chkAutoRefresh").is(':checked')) {
|
||||
setInitialDateTimesRunInfo();
|
||||
$("#LoadHeadersButton").click();
|
||||
}
|
||||
}, 180000);
|
||||
};
|
||||
|
||||
function triggerFileDownload(fileName, url) {
|
||||
const anchorElement = document.createElement('a');
|
||||
anchorElement.href = url;
|
||||
anchorElement.download = fileName ?? '';
|
||||
anchorElement.click();
|
||||
anchorElement.remove();
|
||||
}
|
||||
|
||||
function initIndex() {
|
||||
}
|
||||
|
||||
function copy() {
|
||||
var copyText = document.getElementById("textareaClipboard");
|
||||
|
||||
// Select the text field
|
||||
copyText.select();
|
||||
copyText.setSelectionRange(0, 99999); // For mobile devices
|
||||
|
||||
// Copy the text inside the text field
|
||||
navigator.clipboard.writeText(copyText.value);
|
||||
}
|
Reference in New Issue
Block a user