Initial commit

This commit is contained in:
Ross
2020-02-28 17:49:07 +00:00
commit 50598dfbc3
21 changed files with 64331 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
*.swp
*.bak
packets/*
img/*
+52
View File
@@ -0,0 +1,52 @@
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
margin: 0;
padding: 0;
border: 0;
outline: 0;
font-weight: inherit;
font-style: inherit;
font-size: 100%;
font-family: inherit;
vertical-align: baseline;
}
:focus {
outline: 0;
}
body {
line-height: 1;
color: black;
background: white;
}
ol, ul {
list-style: none;
}
table {
border-collapse: separate;
border-spacing: 0;
}
caption, th, td {
text-align: left;
font-weight: normal;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: "";
}
blockquote, q {
quotes: "" "";
}
+737
View File
@@ -0,0 +1,737 @@
@charset "UTF-8";
@import "./base.css";
@import url("https://fonts.googleapis.com/css?family=Noto+Sans:400,700");
* {
-webkit-font-smoothing: antialiased;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
-webkit-appearance: none;
-webkit-touch-callout: none;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
-moz-appearance: none;
-webkit-text-size-adjust: 100%;
text-size-adjust: 100%;
appearance: none;
font-family: "Noto Sans", sans-serif !important;
font-weight: 400;
font-size: 1.6rem;
text-rendering: optimizeLegibility;
line-height: 1.5;
}
::-moz-focus-inner {
border: 0 !important;
padding: 0 !important;
}
p {
margin-bottom: 0.8rem;
}
strong {
font-weight: 700;
}
select:-moz-focusring {
color: transparent !important;
text-shadow: 0 0 0 #000 !important;
}
:disabled {
pointer-events: none;
}
html {
font-size: 62.5%;
}
html, body, input:not([type=text]), button, select, option {
user-select: none;
-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
-o-user-select: none;
}
html, body, input, button, select, option, textarea {
vertical-align:top;
margin: 0;
padding: 0;
color: black; /*#1d3850;*/
/*font-family: 'Noto Sans', sans-serif;*/
overflow: hidden;
}
body {
background-color: white;
font-size: 1.6rem;
font-weight: 400;
}
input, button, select, option, textarea {
background-color: white;
font-size: 100%;
padding: 0.4rem 0.8rem;
}
table {
border-style: double;
border-color: #4527A0;
border-width: 3px;
padding: 1.6rem;
border-collapse: collapse;
}
thead th {
text-align: center;
}
th {
font-weight: bold;
border: 1px solid #4527A0;
padding: 1.6rem;
vertical-align: top;
}
td {
border: 1px solid #4527A0;
padding: 1.6rem;
overflow: auto;
}
.content-panel {
display: flex;
flex-flow: column;
align-items: stretch;
width: 100%;
height: 100vh;
left: 0;
top: 0;
overflow: hidden;
}
.nav-bar {
background-color: #311B92;
color: white;
padding: 0 1.6rem 0 1.6rem;
border-bottom: 1px solid #7E57C2;
margin: 0;
display: flex;
flex-direction: row;
align-items: stretch;
}
.main-panel {
flex: 1;
display: flex;
flex-flow: row;
align-items: stretch;
overflow: hidden;
}
.exam-panel {
flex: 1;
display: flex;
flex-direction: column;
align-items: stretch;
overflow: hidden;
position: relative;
}
.question-list-panel {
flex-shrink: 0;
display: none;
padding-top: 1.6rem;
overflow-x: hidden;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
}
.question-list-panel * {
-webkit-transform: translate3d(0, 0, 0);
}
.question-list-panel::after {
display: block;
width: 100%;
height: 24px;
bottom: 0;
left: 0;
content: "";
}
.review-heading {
padding: .8rem 1.6rem;
margin: 0;
border-bottom: 1px solid #7E57C2;
background-color: #4527A0;
color: white;
}
.question-list-flag {
float: right;
color: #311B92;
visibility: hidden;
}
.question-list-item,
.empty-saved-localdb {
background-color: white;
padding: 0.8rem;
border-bottom: 1px solid grey;
}
.no-touch .question-list-item:hover,
.no-touch .empty-saved-localdb:hover {
background-color: #cccccc !important;
cursor: cell;
}
.question-saved-localdb {
background-color: #7E57C2;
padding: 0.8rem;
border-bottom: 1px solid grey;
}
.no-touch .question-saved-localdb:hover {
background-color: #512DA8 !important;
cursor: cell;
}
/* Navigation */
.app-name {
padding: 1.2rem 0;
font-size: 2.1rem;
flex-grow: 1;
}
.navigation {
background-color: #311B92;
border-color: white;
border-width: 1px;
border-style: solid;
border-radius: 3px;
color: white;
margin-top: .4rem;
margin-bottom: .4rem;
padding: .8rem 1.6rem;
box-shadow: none;
text-shadow: none;
flex-shrink: 0;
}
.nav-left {
margin-left: .4rem;
}
.nav-right {
margin-right: .4rem;
}
.navigation-text {
background-color: white;
border-color: white;
border-width: 1px;
border-style: solid;
color: black;
margin: .4rem 0 .4rem 0.8rem;
padding: .8rem 1.6rem;
box-shadow: none;
text-shadow: none;
}
.no-touch .navigation:hover {
background-color: #1a237e;
border-color: #ddd;
}
.navigation:disabled {
color: #ddd;
border-color: #ddd;
border-style: dashed;
}
/*@media screen and (orientation:landscape) {*/
@media screen and (min-aspect-ratio:12/9) {
.exam-content-panel {
display: flex;
flex-flow: row;
width: 100%;
flex: 1;
overflow-y: hidden;
}
.question {
display: block;
width: 60%;
margin: 0;
padding: 0 0 1.6rem 1.6rem;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
}
.question * {
-webkit-transform: translate3d(0, 0, 0);
}
.question::after {
display: block;
width: 100%;
height: 1.6rem;
bottom: 0;
left: 0;
content: "";
}
.answers {
width: 40%;
margin: 0;
padding: 1.6rem 0 0 0;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
flex-flow: column nowrap;
justify-content: flex-start;
align-items: stretch;
}
.answers * {
-webkit-transform: translate3d(0, 0, 0);
}
.answer-panel {
display: block;
margin: 0;
padding: 1.6rem 1.6rem 0 1.6rem;
overflow: hidden;
}
.log-panel {
position: absolute;
height: 100vh;
top: 100vh;
background-color: white;
width: 100%;
overflow: auto;
color: black;
}
}
/*@media screen and (orientation:portrait) {*/
@media screen and (max-aspect-ratio:12/9) {
.exam-content-panel {
display: block;
margin: 0;
width: 100%;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
flex: 1;
}
.exam-content-panel * {
-webkit-transform: translate3d(0, 0, 0);
}
.question {
display: block;
margin: 0;
padding: 0 0 1.6rem 1.6rem;
overflow-y: hidden;
}
.canvas-panel {
display: block;
padding: 0;
margin: 0;
background-color: black;
image-rendering: optimizeSpeed;
image-rendering: -moz-crisp-edges;
image-rendering: -webkit-optimize-contrast;
image-rendering: -o-crisp-edges;
image-rendering: pixelated;
-ms-interpolation-mode: nearest-neighbor;
}
.canvas-panel-fullscreen {
display: block;
position: absolute;
z-index: 9999;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
overflow: auto;
background-color: black;
margin: 0;
padding: 0;
image-rendering: optimizeSpeed;
image-rendering: -moz-crisp-edges;
image-rendering: -webkit-optimize-contrast;
image-rendering: -o-crisp-edges;
image-rendering: pixelated;
-ms-interpolation-mode: nearest-neighbor;
}
.answers {
display: block;
margin: 0;
padding: 0;
}
.answer-panel {
display: block;
margin: 0;
padding: 1.6rem 1.6rem 0 1.6rem;
overflow: hidden;
}
}
.title {
padding: .8rem 1.6rem;
margin: 1.6rem 0 1.6rem 0;
border-bottom: 1px solid #7E57C2;
background-color: #4527A0;
color: white;
}
.answer-title {
padding: .8rem 1.6rem;
margin: 0 0 0 1.6rem;
border-bottom: 1px solid #7E57C2;
background-color: #4527A0;
color: white;
}
.stem {
display: block;
color: black;
padding: 0;
margin: 0 1.6rem 1.6rem 0;
overflow: hidden;
}
.thumbs {
display: block;
width: 100%;
padding: 0;
margin: 0;
color: black;
}
.thumbs-hidden {
display: none;
}
.answer-label-outer {
overflow: hidden;
}
.answer-label-inner {
overflow: hidden;
margin: 0;
padding: 0;
display: flex;
justify-content: space-between;
align-items: baseline;
font-weight: 700;
}
.answer-label-number {
margin-right: 0.8rem;
}
.long-answer {
display: block;
height: 8rem;
min-height: 8rem;
width: 100%;
vertical-align: top;
border: 1px solid #4527A0;
overflow: hidden;
resize: none;
margin-bottom: 1.6rem;
}
.long-answer:focus {
box-shadow: 0 0 0 3px #4527A0;
}
.rapid-option-answer {
width: 100%;
display: block;
vertical-align: top;
border: 1px solid #4527A0;
margin: 0.8rem 1.6rem 1.6rem 1.6rem;
overflow: hidden;
resize: none;
padding: 0.4rem;
}
.rapid-option-answer:focus {
box-shadow: 0 0 0 3px #4527A0;
}
img {
display: block;
padding: 0;
margin: auto;
}
.figure {
display: inline-flex;
flex-direction: column;
align-items: center;
margin: 0 1.6rem 1.6rem 0;
padding: 0 1.6rem 1.6rem 1.6rem;
background-color: #eee;
border: 1px dashed #4527A0;
}
.figure-open {
display: inline-flex;
flex-direction: column;
align-items: center;
margin: 0 1.6rem 1.6rem 0;
padding: 0 1.6rem 1.6rem 1.6rem;
background-color: #7E57C2;
border: 1px dashed #4527A0;
}
.no-touch .figure:hover {
border: 1px solid #4527A0;
background-color: #ccc;
cursor: cell;
}
.figcaption {
font-style: italic;
text-align: center;
}
.logout-background {
display: none;
position: fixed;
z-index: 999999;
left: 0;
top: 0;
width: 100vw;
height: 100vh;
overflow: auto;
background-color: rgba(0,0,0,0.4);
text-align: center;
}
.dialog {
/*display: inline-block;*/
display: none;
background-color: white;
margin: 15% auto;
box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.5);
border-radius: 5px;
padding: 0px;
}
.dialog-title {
border-radius: 5px 5px 0px 0px;
/*font-size: 1.9rem;*/
padding: .8rem 4.8rem;
margin-bottom: 3.2rem;
border-bottom: 1px solid #7E57C2;
background-color: #4527A0;
color: white;
}
.dialog-text {
margin-bottom: 3.2rem;
}
.dialog-cancel {
border-radius: 5px 5px 5px 5px !important;
border-width: 0px !important;
margin: 1.6rem 0.8rem 1.6rem 1.6rem !important;
width: 19.2rem !important;
padding: 0.8rem !important;
}
.dialog-yes {
border-radius: 5px 5px 5px 5px !important;
border-width: 0px !important;
margin: 1.6rem 1.6rem 1.6rem 0.8rem !important;
width: 19.2rem !important;
padding: 0.8rem !important;
background-color: #b71c1c !important;
}
/* Options overlay */
.fullscreen-overlay {
position: fixed;
display: none;
width: 100%;
height: 100%;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0,0,0,0.9);
z-index: 2;
cursor: pointer;
color: lightgray;
}
#review-overlay {
overflow: scroll;
}
.close {
position: absolute;
right: 32px;
top: 32px;
width: 32px;
height: 32px;
font-weight: bold;
opacity: 0.3;
}
.close:hover {
opacity: 1;
}
.close:before, .close:after {
position: absolute;
left: 15px;
content: ' ';
height: 33px;
width: 2px;
background-color: white;
}
.close:before {
transform: rotate(45deg);
}
.close:after {
transform: rotate(-45deg);
}
.exam-name {
margin: auto;
margin-right: .4rem;
}
/* Marking */
.correct {
color: green;
}
.incorrect {
color: red;
}
textarea.incorrect {
background-color: lightcoral;
color: lightgray;
}
.canvas-panel {
position: relative;
background-color: black;
}
.canvas-panel-fullscreen {
display: block;
position: fixed;
z-index: 9999;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
overflow: auto;
background-color: black;
margin: 0;
padding: 0;
}
.control-overlay {
position: absolute;
z-index: 99999;
top: 0px;
left: 0px;
background-color: white;
border-color: #311B92;
color: #311B92;
border-width: 1px;
border-style: solid;
border-radius: 5px;
margin: 1rem;
box-shadow: none;
text-shadow: none;
}
.no-touch .control-overlay:hover {
background-color: #ddd;
}
.control-overlay:focus {
position: absolute;
z-index: 99999;
top: 0;
left: 0;
background-color: white;
border: 3px solid darkmagenta;
color: #311B92;
border-radius: 5px;
margin: .8rem;
box-shadow: none;
text-shadow: none;
}
select option:disabled {
color: #a9a9a9;
}
.flag:hover {
background-color: #ddd;
border-color: #311B92;
}
.flag {
display: inline-block;
background-color: white;
border-color: #311B92;
border-width: 1px;
border-style: solid;
border-radius: 5px;
color: #311B92;
margin: 0 .8rem .8rem 0;
box-shadow: none;
text-shadow: none;
flex: 0 0 auto;
}
.flag-selected {
display: inline-block;
background-color: #311B92;
border-color: #311B92;
border-width: 1px;
border-style: solid;
border-radius: 5px;
color: white;
margin: 0 .8rem .8rem 0;
/*padding: .8rem 1.6rem;*/
box-shadow: none;
text-shadow: none;
flex: 0 0 auto;
}
.feedback {
padding-top: 0.8rem;
}
+110
View File
@@ -0,0 +1,110 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" class="no-touch" lang="en">
<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, minimum-scale=1, maximum-scale=1, user-scalable=no">
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, width=device-width, height=device-height">
<link type="text/css" rel="stylesheet" href="lib/jquery.modal.min.css">
<link type="text/css" rel="stylesheet" href="lib/cornerstone.min.css">
<link type="text/css" rel="stylesheet" href="css/main.css">
<title>RTS</title>
</head>
<body>
<div id="content">
<div class="content-panel">
<div class="nav-bar">
<button id="review-button" class="navigation nav-right"><b></b></button>
<button id="options-button" class="navigation nav-right">options</button>
<button id="review-overlay-button" class="navigation nav-right">review</button>
<!--<button id="logout-button" class="navigation nav-right">logout</button>-->
<div class="app-name nav-left">RTS</div>
<div class="exam-name"></div>
<input type="button" class="navigation nav-left" value="previous" disabled="disabled">
<input type="button" class="navigation nav-left" value="next">
</div>
<div class="main-panel">
<div class="question-list-panel" style="display: block;">
</div>
<div class="exam-panel">
<div class="exam-content-panel">
<div class="question">
<div class="title"><span style="font-weight:700;">1</span> </div>
<div class="stem">
<div id="thumbnails"></div>
</div>
<div class="thumbs">
</div>
</div>
<div class="answers">
<div class="answer-title">Answer</div>
<div class="answer-panel">
</div>
</div>
</div>
</div>
</div>
<div class="logout-background">
<div class="logout-panel">
<div class="logout-title">Ready to logout?</div>
<div class="logout-text"></div>
<button class="navigation logout-cancel">continue exam</button>
<button class="navigation logout-okay">logout now</button>
</div>
</div>
<div id="options-panel" class="fullscreen-overlay">
<a href="#" id="overlay-close" class="close" ></a>
<div id="localFileloader">
<form id="jsonFile" name="jsonFile" enctype="multipart/form-data" method="post">
<fieldset>
<h2>Load local question set</h2>
<input type='file' id='fileinput'>
<input type='button' id='btn-local-file-load' value='Load' onclick='loadLocalQuestionSet();'>
</fieldset>
</form>
</div>
</div>
<div id="review-overlay" class="fullscreen-overlay">
<a href="#" id="review-overlay-close" class="close" ></a>
<ul id='review-answer-list'></ul>
<div id="review-score"></div>
</div>
</div>
</div>
<div id="finish-dialog" class="dialog modal">
<h3 class="dialog-title">Finish exam and review?</h3>
<div class="dialog-text">
<button id="finish-exam" class="navigation dialog-yes">Finish and review</button>
<button id="finish-cancel" class="navigation dialog-cancel">Continue exam</button>
</div>
</div>
<div id="login-dialog" class="dialog modal">
<h3 class="dialog-title">Select exam</h3>
Candidate number: <input type="text" id="candidate-number" name="candidate" required size="10">
<div class="dialog-text">
<button id="start-exam-button" class="navigation dialog-yes">Start</button>
</div>
</div>
<script src="lib/jquery-3.4.1.min.js" type="text/javascript"></script>
<script src="lib/hammer.js"></script>
<script src="lib/cornerstone.js"></script>
<script src="lib/dicomParser.min.js"></script>
<script src="lib/cornerstoneMath.min.js"></script>
<script src="lib/cornerstoneTools.js"></script>
<script src="lib/cornerstoneWebImageLoader.min.js"></script>
<script src="lib/cornerstoneWADOImageLoader.js"></script>
<script src="lib/cornerstone-base64-image-loader.umd.js"></script>
<script src="lib/dexie.js"></script>
<script src="lib/jquery.modal.min.js"></script>
<script src="packets/rr1" defer="defer"></script>
<script src="js/main.js" defer="defer"></script>
</body>
</html>
+1604
View File
File diff suppressed because it is too large Load Diff
+242
View File
@@ -0,0 +1,242 @@
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
var __assign = function() {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var _defaultOptions = {
channel: 4,
width: null,
height: null,
schema: 'base64://'
};
var CornerstoneBase64ImageLoader = /** @class */ (function () {
function CornerstoneBase64ImageLoader(cornerstone, options) {
if (options === void 0) { options = _defaultOptions; }
this._cornerstone = cornerstone;
this._options = options;
this._lastImageIdDrawn = null;
this._UPNG = null;
this._canvas = document.createElement('canvas');
this.arrayBufferToImage = this.arrayBufferToImage.bind(this);
this.getArrayBuffer = this.getArrayBuffer.bind(this);
this.decodeBase64 = this.decodeBase64.bind(this);
this.createImage = this.createImage.bind(this);
this.imageLoader = this.imageLoader.bind(this);
this.replaceImage = this.replaceImage.bind(this);
}
CornerstoneBase64ImageLoader.prototype.arrayBufferToImage = function (arrayBuffer) {
return new Promise(function (resolve, reject) {
var image = new Image();
var arrayBufferView = new Uint8Array(arrayBuffer);
var blob = new Blob([arrayBufferView]);
var urlCreator = window.URL || window.webkitURL;
var imageUrl = urlCreator.createObjectURL(blob);
image.src = imageUrl;
image.onload = function () {
urlCreator.revokeObjectURL(imageUrl);
resolve(image);
};
image.onerror = function (error) {
urlCreator.revokeObjectURL(imageUrl);
reject(error);
};
});
};
CornerstoneBase64ImageLoader.prototype.getArrayBuffer = function (str) {
var buf = new ArrayBuffer(str.length);
var bufView = new Uint8Array(buf);
Array.from(str).map(function (ch, idx) {
bufView[idx] = ch.charCodeAt(0);
return ch;
});
return bufView;
};
CornerstoneBase64ImageLoader.prototype.decodeBase64 = function (base64PixelData) {
var pixelDataAsString = window.atob(base64PixelData);
var arrayBuffer = this.getArrayBuffer(pixelDataAsString);
return arrayBuffer;
};
CornerstoneBase64ImageLoader.prototype.createImage = function (image, imageId) {
var _this = this;
var rows = image.naturalHeight;
var columns = image.naturalWidth;
var getImageData = function () {
var context;
if (_this._lastImageIdDrawn === imageId) {
context = _this._canvas.getContext('2d');
}
else {
_this._canvas.height = image.naturalHeight;
_this._canvas.width = image.naturalWidth;
context = _this._canvas.getContext('2d');
context.drawImage(image, 0, 0);
_this._lastImageIdDrawn = imageId;
}
return context.getImageData(0, 0, image.naturalWidth, image.naturalHeight);
};
var getPixelData = function () {
var imageData = getImageData();
return imageData.data;
};
var getCanvas = function () {
if (_this._lastImageIdDrawn === imageId) {
return _this._canvas;
}
_this._canvas.height = image.naturalHeight;
_this._canvas.width = image.naturalWidth;
var context = _this._canvas.getContext('2d');
context.drawImage(image, 0, 0);
_this._lastImageIdDrawn = imageId;
return _this._canvas;
};
var setLastImageIdDrawn = function (nextLastImageIdDrawn) {
if (nextLastImageIdDrawn === void 0) { nextLastImageIdDrawn = null; }
_this._lastImageIdDrawn = nextLastImageIdDrawn;
};
return {
imageId: imageId,
minPixelValue: 0,
maxPixelValue: 255,
slope: 1,
intercept: 0,
windowCenter: 128,
windowWidth: 255,
render: this.cornerstone.renderWebImage,
getPixelData: getPixelData,
getCanvas: getCanvas,
getImage: function () { return image; },
setLastImageIdDrawn: setLastImageIdDrawn,
rows: rows,
columns: columns,
height: rows,
width: columns,
color: true,
rgba: false,
columnPixelSpacing: null,
rowPixelSpacing: null,
invert: false,
sizeInBytes: rows * columns * this._options.channel
};
};
CornerstoneBase64ImageLoader.prototype.imageLoader = function (imageId) {
var _this = this;
// const schema = imageId.split('://')[0]
var base64PixelData = imageId.replace(this._options.schema, '');
var arrayBuffer;
if (this._options.width && this._options.height && this._UPNG) {
var columns = this._options.width;
var rows = this._options.height;
arrayBuffer = new Uint8Array(columns * rows * this._options.channel);
arrayBuffer = this._UPNG.encode([arrayBuffer.buffer], columns, rows, 0);
}
else {
arrayBuffer = this.decodeBase64(base64PixelData);
}
var imagePromise = this.arrayBufferToImage(arrayBuffer);
var promise = new Promise(function (resolve, reject) {
imagePromise.then(function (image) {
var imageObject = _this.createImage(image, imageId);
resolve(imageObject);
}, reject);
});
return {
promise: promise
};
};
CornerstoneBase64ImageLoader.prototype.replaceImage = function (layer, arrayBuffer) {
var _this = this;
if (!this._UPNG) {
return null;
}
var png = this._UPNG.encode([arrayBuffer.buffer], layer.image.columns, layer.image.rows, 0);
var imagePromise = this.arrayBufferToImage(png);
return imagePromise.then(function (image) {
layer.image = _this.createImage(image, layer.image.imageId);
});
};
Object.defineProperty(CornerstoneBase64ImageLoader.prototype, "options", {
get: function () {
return __assign({}, this._options);
},
enumerable: true,
configurable: true
});
Object.defineProperty(CornerstoneBase64ImageLoader.prototype, "cornerstone", {
get: function () {
return this._cornerstone;
},
enumerable: true,
configurable: true
});
Object.defineProperty(CornerstoneBase64ImageLoader.prototype, "UPNG", {
get: function () {
return this._UPNG;
},
enumerable: true,
configurable: true
});
CornerstoneBase64ImageLoader.prototype.setUPNG = function (UPNG) {
this._UPNG = UPNG;
};
CornerstoneBase64ImageLoader.prototype.registerLoaders = function () {
this.cornerstone.registerImageLoader('base64', this.imageLoader);
};
return CornerstoneBase64ImageLoader;
}());
var _imageLoader;
var _options = __assign({}, _defaultOptions);
var cornerstoneBase64ImageLoader = {
external: {
set cornerstone(cs) {
_imageLoader = new CornerstoneBase64ImageLoader(cs, _options);
_imageLoader.registerLoaders();
},
get cornerstone() {
return _imageLoader.cornerstone;
},
get UPNG() {
return _imageLoader.UPNG;
},
set UPNG(_UPNG) {
_imageLoader.setUPNG(_UPNG);
}
},
initOptions: function () {
_options = __assign({}, _defaultOptions);
},
set options(newOptions) {
_options = __assign({}, _options, newOptions);
},
get options() {
return __assign({}, _options);
},
get imageLoader() {
return _imageLoader;
}
};
export default cornerstoneBase64ImageLoader;
//# sourceMappingURL=cornerstone-base64-image-loader.es5.js.map
+250
View File
@@ -0,0 +1,250 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global.cornerstoneBase64ImageLoader = factory());
}(this, (function () { 'use strict';
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
var __assign = function() {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var _defaultOptions = {
channel: 4,
width: null,
height: null,
schema: 'base64://'
};
var CornerstoneBase64ImageLoader = /** @class */ (function () {
function CornerstoneBase64ImageLoader(cornerstone, options) {
if (options === void 0) { options = _defaultOptions; }
this._cornerstone = cornerstone;
this._options = options;
this._lastImageIdDrawn = null;
this._UPNG = null;
this._canvas = document.createElement('canvas');
this.arrayBufferToImage = this.arrayBufferToImage.bind(this);
this.getArrayBuffer = this.getArrayBuffer.bind(this);
this.decodeBase64 = this.decodeBase64.bind(this);
this.createImage = this.createImage.bind(this);
this.imageLoader = this.imageLoader.bind(this);
this.replaceImage = this.replaceImage.bind(this);
}
CornerstoneBase64ImageLoader.prototype.arrayBufferToImage = function (arrayBuffer) {
return new Promise(function (resolve, reject) {
var image = new Image();
var arrayBufferView = new Uint8Array(arrayBuffer);
var blob = new Blob([arrayBufferView]);
var urlCreator = window.URL || window.webkitURL;
var imageUrl = urlCreator.createObjectURL(blob);
image.src = imageUrl;
image.onload = function () {
urlCreator.revokeObjectURL(imageUrl);
resolve(image);
};
image.onerror = function (error) {
urlCreator.revokeObjectURL(imageUrl);
reject(error);
};
});
};
CornerstoneBase64ImageLoader.prototype.getArrayBuffer = function (str) {
var buf = new ArrayBuffer(str.length);
var bufView = new Uint8Array(buf);
Array.from(str).map(function (ch, idx) {
bufView[idx] = ch.charCodeAt(0);
return ch;
});
return bufView;
};
CornerstoneBase64ImageLoader.prototype.decodeBase64 = function (base64PixelData) {
var pixelDataAsString = window.atob(base64PixelData);
var arrayBuffer = this.getArrayBuffer(pixelDataAsString);
return arrayBuffer;
};
CornerstoneBase64ImageLoader.prototype.createImage = function (image, imageId) {
var _this = this;
var rows = image.naturalHeight;
var columns = image.naturalWidth;
var getImageData = function () {
var context;
if (_this._lastImageIdDrawn === imageId) {
context = _this._canvas.getContext('2d');
}
else {
_this._canvas.height = image.naturalHeight;
_this._canvas.width = image.naturalWidth;
context = _this._canvas.getContext('2d');
context.drawImage(image, 0, 0);
_this._lastImageIdDrawn = imageId;
}
return context.getImageData(0, 0, image.naturalWidth, image.naturalHeight);
};
var getPixelData = function () {
var imageData = getImageData();
return imageData.data;
};
var getCanvas = function () {
if (_this._lastImageIdDrawn === imageId) {
return _this._canvas;
}
_this._canvas.height = image.naturalHeight;
_this._canvas.width = image.naturalWidth;
var context = _this._canvas.getContext('2d');
context.drawImage(image, 0, 0);
_this._lastImageIdDrawn = imageId;
return _this._canvas;
};
var setLastImageIdDrawn = function (nextLastImageIdDrawn) {
if (nextLastImageIdDrawn === void 0) { nextLastImageIdDrawn = null; }
_this._lastImageIdDrawn = nextLastImageIdDrawn;
};
return {
imageId: imageId,
minPixelValue: 0,
maxPixelValue: 255,
slope: 1,
intercept: 0,
windowCenter: 128,
windowWidth: 255,
render: this.cornerstone.renderWebImage,
getPixelData: getPixelData,
getCanvas: getCanvas,
getImage: function () { return image; },
setLastImageIdDrawn: setLastImageIdDrawn,
rows: rows,
columns: columns,
height: rows,
width: columns,
color: true,
rgba: false,
columnPixelSpacing: null,
rowPixelSpacing: null,
invert: false,
sizeInBytes: rows * columns * this._options.channel
};
};
CornerstoneBase64ImageLoader.prototype.imageLoader = function (imageId) {
var _this = this;
// const schema = imageId.split('://')[0]
var base64PixelData = imageId.replace(this._options.schema, '');
var arrayBuffer;
if (this._options.width && this._options.height && this._UPNG) {
var columns = this._options.width;
var rows = this._options.height;
arrayBuffer = new Uint8Array(columns * rows * this._options.channel);
arrayBuffer = this._UPNG.encode([arrayBuffer.buffer], columns, rows, 0);
}
else {
arrayBuffer = this.decodeBase64(base64PixelData);
}
var imagePromise = this.arrayBufferToImage(arrayBuffer);
var promise = new Promise(function (resolve, reject) {
imagePromise.then(function (image) {
var imageObject = _this.createImage(image, imageId);
resolve(imageObject);
}, reject);
});
return {
promise: promise
};
};
CornerstoneBase64ImageLoader.prototype.replaceImage = function (layer, arrayBuffer) {
var _this = this;
if (!this._UPNG) {
return null;
}
var png = this._UPNG.encode([arrayBuffer.buffer], layer.image.columns, layer.image.rows, 0);
var imagePromise = this.arrayBufferToImage(png);
return imagePromise.then(function (image) {
layer.image = _this.createImage(image, layer.image.imageId);
});
};
Object.defineProperty(CornerstoneBase64ImageLoader.prototype, "options", {
get: function () {
return __assign({}, this._options);
},
enumerable: true,
configurable: true
});
Object.defineProperty(CornerstoneBase64ImageLoader.prototype, "cornerstone", {
get: function () {
return this._cornerstone;
},
enumerable: true,
configurable: true
});
Object.defineProperty(CornerstoneBase64ImageLoader.prototype, "UPNG", {
get: function () {
return this._UPNG;
},
enumerable: true,
configurable: true
});
CornerstoneBase64ImageLoader.prototype.setUPNG = function (UPNG) {
this._UPNG = UPNG;
};
CornerstoneBase64ImageLoader.prototype.registerLoaders = function () {
this.cornerstone.registerImageLoader('base64', this.imageLoader);
};
return CornerstoneBase64ImageLoader;
}());
var _imageLoader;
var _options = __assign({}, _defaultOptions);
var cornerstoneBase64ImageLoader = {
external: {
set cornerstone(cs) {
_imageLoader = new CornerstoneBase64ImageLoader(cs, _options);
_imageLoader.registerLoaders();
},
get cornerstone() {
return _imageLoader.cornerstone;
},
get UPNG() {
return _imageLoader.UPNG;
},
set UPNG(_UPNG) {
_imageLoader.setUPNG(_UPNG);
}
},
initOptions: function () {
_options = __assign({}, _defaultOptions);
},
set options(newOptions) {
_options = __assign({}, _options, newOptions);
},
get options() {
return __assign({}, _options);
},
get imageLoader() {
return _imageLoader;
}
};
return cornerstoneBase64ImageLoader;
})));
//# sourceMappingURL=cornerstone-base64-image-loader.umd.js.map
+8599
View File
File diff suppressed because one or more lines are too long
+1
View File
@@ -0,0 +1 @@
/*! cornerstone - v0.9.0 - 2016-02-03 | (c) 2014 Chris Hafey | https://github.com/chafey/cornerstone */.cornerstone-enabled-image{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}
+3
View File
File diff suppressed because one or more lines are too long
+3
View File
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
+3
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+3
View File
@@ -0,0 +1,3 @@
/*! cornerstone-web-image-loader - 2.1.1 - 2018-12-05 | (c) 2016 Chris Hafey | https://github.com/cornerstonejs/cornerstoneWebImageLoader */
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("cornerstoneWebImageLoader",[],t):"object"==typeof exports?exports.cornerstoneWebImageLoader=t():e.cornerstoneWebImageLoader=t()}(window,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=5)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.external=void 0;var r,o=n(4),a=(r=o)&&r.__esModule?r:{default:r};var u=void 0,i={set cornerstone(e){u=e,(0,a.default)(u)},get cornerstone(){return u}};t.external=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loadImage=function(e){var t=r.external.cornerstone,n=new XMLHttpRequest;return n.open("GET",e,!0),n.responseType="arraybuffer",i.beforeSend(n),n.onprogress=function(n){if(n.lengthComputable){var r=n.loaded,o=n.total,a=Math.round(r/o*100),u={imageId:e,loaded:r,total:o,percentComplete:a};t.triggerEvent(t.events,"cornerstoneimageloadprogress",u)}},{promise:new Promise(function(t,r){n.onload=function(){(0,o.default)(this.response).then(function(n){var r=(0,a.default)(n,e);t(r)},r)},n.send()}),cancelFn:function(){n.abort()}}},t.configure=function(e){i=e};var r=n(0),o=u(n(3)),a=u(n(2));function u(e){return e&&e.__esModule?e:{default:e}}var i={beforeSend:function(){}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=e.naturalHeight,u=e.naturalWidth;return{imageId:t,minPixelValue:0,maxPixelValue:255,slope:1,intercept:0,windowCenter:128,windowWidth:255,render:r.external.cornerstone.renderWebImage,getPixelData:function(){return(n=void 0,a===t?n=o.getContext("2d"):(o.height=e.naturalHeight,o.width=e.naturalWidth,(n=o.getContext("2d")).drawImage(e,0,0),a=t),n.getImageData(0,0,e.naturalWidth,e.naturalHeight)).data;var n},getCanvas:function(){return a===t?o:(o.height=e.naturalHeight,o.width=e.naturalWidth,o.getContext("2d").drawImage(e,0,0),a=t,o)},getImage:function(){return e},rows:n,columns:u,height:n,width:u,color:!0,rgba:!1,columnPixelSpacing:void 0,rowPixelSpacing:void 0,invert:!1,sizeInBytes:n*u*4}};var r=n(0),o=document.createElement("canvas"),a=void 0},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return new Promise(function(t,n){var r=new Image,o=new Uint8Array(e),a=new Blob([o]),u=window.URL||window.webkitURL,i=u.createObjectURL(a);r.src=i,r.onload=function(){t(r),u.revokeObjectURL(i)},r.onerror=function(e){u.revokeObjectURL(i),n(e)}})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){e.registerImageLoader("http",r.loadImage),e.registerImageLoader("https",r.loadImage)};var r=n(1)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.external=t.configure=t.loadImage=t.createImage=t.arrayBufferToImage=void 0;var r=i(n(3)),o=i(n(2)),a=n(1),u=n(0);function i(e){return e&&e.__esModule?e:{default:e}}var d={arrayBufferToImage:r.default,createImage:o.default,loadImage:a.loadImage,configure:a.configure,external:u.external};t.arrayBufferToImage=r.default,t.createImage=o.default,t.loadImage=a.loadImage,t.configure=a.configure,t.external=u.external,t.default=d}])});
//# sourceMappingURL=cornerstoneWebImageLoader.min.js.map
+4474
View File
File diff suppressed because it is too large Load Diff
+17
View File
File diff suppressed because one or more lines are too long
+2643
View File
File diff suppressed because it is too large Load Diff
+2
View File
File diff suppressed because one or more lines are too long
+1
View File
@@ -0,0 +1 @@
.blocker{position:fixed;top:0;right:0;bottom:0;left:0;width:100%;height:100%;overflow:auto;z-index:1;padding:20px;box-sizing:border-box;background-color:#000;background-color:rgba(0,0,0,0.75);text-align:center}.blocker:before{content:"";display:inline-block;height:100%;vertical-align:middle;margin-right:-0.05em}.blocker.behind{background-color:transparent}.modal{display:none;vertical-align:middle;position:relative;z-index:2;max-width:500px;box-sizing:border-box;width:90%;background:#fff;padding:15px 30px;-webkit-border-radius:8px;-moz-border-radius:8px;-o-border-radius:8px;-ms-border-radius:8px;border-radius:8px;-webkit-box-shadow:0 0 10px #000;-moz-box-shadow:0 0 10px #000;-o-box-shadow:0 0 10px #000;-ms-box-shadow:0 0 10px #000;box-shadow:0 0 10px #000;text-align:left}.modal a.close-modal{position:absolute;top:-12.5px;right:-12.5px;display:block;width:30px;height:30px;text-indent:-9999px;background-size:contain;background-repeat:no-repeat;background-position:center center;background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAAAXNSR0IArs4c6QAAA3hJREFUaAXlm8+K00Acx7MiCIJH/yw+gA9g25O49SL4AO3Bp1jw5NvktC+wF88qevK4BU97EmzxUBCEolK/n5gp3W6TTJPfpNPNF37MNsl85/vN/DaTmU6PknC4K+pniqeKJ3k8UnkvDxXJzzy+q/yaxxeVHxW/FNHjgRSeKt4rFoplzaAuHHDBGR2eS9G54reirsmienDCTRt7xwsp+KAoEmt9nLaGitZxrBbPFNaGfPloGw2t4JVamSt8xYW6Dg1oCYo3Yv+rCGViV160oMkcd8SYKnYV1Nb1aEOjCe6L5ZOiLfF120EjWhuBu3YIZt1NQmujnk5F4MgOpURzLfAwOBSTmzp3fpDxuI/pabxpqOoz2r2HLAb0GMbZKlNV5/Hg9XJypguryA7lPF5KMdTZQzHjqxNPhWhzIuAruOl1eNqKEx1tSh5rfbxdw7mOxCq4qS68ZTjKS1YVvilu559vWvFHhh4rZrdyZ69Vmpgdj8fJbDZLJpNJ0uv1cnr/gjrUhQMuI+ANjyuwftQ0bbL6Erp0mM/ny8Fg4M3LtdRxgMtKl3jwmIHVxYXChFy94/Rmpa/pTbNUhstKV+4Rr8lLQ9KlUvJKLyG8yvQ2s9SBy1Jb7jV5a0yapfF6apaZLjLLcWtd4sNrmJUMHyM+1xibTjH82Zh01TNlhsrOhdKTe00uAzZQmN6+KW+sDa/JD2PSVQ873m29yf+1Q9VDzfEYlHi1G5LKBBWZbtEsHbFwb1oYDwr1ZiF/2bnCSg1OBE/pfr9/bWx26UxJL3ONPISOLKUvQza0LZUxSKyjpdTGa/vDEr25rddbMM0Q3O6Lx3rqFvU+x6UrRKQY7tyrZecmD9FODy8uLizTmilwNj0kraNcAJhOp5aGVwsAGD5VmJBrWWbJSgWT9zrzWepQF47RaGSiKfeGx6Szi3gzmX/HHbihwBser4B9UJYpFBNX4R6vTn3VQnez0SymnrHQMsRYGTr1dSk34ljRqS/EMd2pLQ8YBp3a1PLfcqCpo8gtHkZFHKkTX6fs3MY0blKnth66rKCnU0VRGu37ONrQaA4eZDFtWAu2fXj9zjFkxTBOo8F7t926gTp/83Kyzzcy2kZD6xiqxTYnHLRFm3vHiRSwNSjkz3hoIzo8lCKWUlg/YtGs7tObunDAZfpDLbfEI15zsEIY3U/x/gHHc/G1zltnAgAAAABJRU5ErkJggg==')}.modal-spinner{display:none;position:fixed;top:50%;left:50%;transform:translateY(-50%) translateX(-50%);padding:12px 16px;border-radius:5px;background-color:#111;height:20px}.modal-spinner>div{border-radius:100px;background-color:#fff;height:20px;width:2px;margin:0 1px;display:inline-block;-webkit-animation:sk-stretchdelay 1.2s infinite ease-in-out;animation:sk-stretchdelay 1.2s infinite ease-in-out}.modal-spinner .rect2{-webkit-animation-delay:-1.1s;animation-delay:-1.1s}.modal-spinner .rect3{-webkit-animation-delay:-1.0s;animation-delay:-1.0s}.modal-spinner .rect4{-webkit-animation-delay:-0.9s;animation-delay:-0.9s}@-webkit-keyframes sk-stretchdelay{0%,40%,100%{-webkit-transform:scaleY(0.5)}20%{-webkit-transform:scaleY(1.0)}}@keyframes sk-stretchdelay{0%,40%,100%{transform:scaleY(0.5);-webkit-transform:scaleY(0.5)}20%{transform:scaleY(1.0);-webkit-transform:scaleY(1.0)}}
+5
View File
@@ -0,0 +1,5 @@
/*
A simple jQuery modal (http://github.com/kylefox/jquery-modal)
Version 0.9.2
*/
!function(o){"object"==typeof module&&"object"==typeof module.exports?o(require("jquery"),window,document):o(jQuery,window,document)}(function(o,t,i,e){var s=[],l=function(){return s.length?s[s.length-1]:null},n=function(){var o,t=!1;for(o=s.length-1;o>=0;o--)s[o].$blocker&&(s[o].$blocker.toggleClass("current",!t).toggleClass("behind",t),t=!0)};o.modal=function(t,i){var e,n;if(this.$body=o("body"),this.options=o.extend({},o.modal.defaults,i),this.options.doFade=!isNaN(parseInt(this.options.fadeDuration,10)),this.$blocker=null,this.options.closeExisting)for(;o.modal.isActive();)o.modal.close();if(s.push(this),t.is("a"))if(n=t.attr("href"),this.anchor=t,/^#/.test(n)){if(this.$elm=o(n),1!==this.$elm.length)return null;this.$body.append(this.$elm),this.open()}else this.$elm=o("<div>"),this.$body.append(this.$elm),e=function(o,t){t.elm.remove()},this.showSpinner(),t.trigger(o.modal.AJAX_SEND),o.get(n).done(function(i){if(o.modal.isActive()){t.trigger(o.modal.AJAX_SUCCESS);var s=l();s.$elm.empty().append(i).on(o.modal.CLOSE,e),s.hideSpinner(),s.open(),t.trigger(o.modal.AJAX_COMPLETE)}}).fail(function(){t.trigger(o.modal.AJAX_FAIL);var i=l();i.hideSpinner(),s.pop(),t.trigger(o.modal.AJAX_COMPLETE)});else this.$elm=t,this.anchor=t,this.$body.append(this.$elm),this.open()},o.modal.prototype={constructor:o.modal,open:function(){var t=this;this.block(),this.anchor.blur(),this.options.doFade?setTimeout(function(){t.show()},this.options.fadeDuration*this.options.fadeDelay):this.show(),o(i).off("keydown.modal").on("keydown.modal",function(o){var t=l();27===o.which&&t.options.escapeClose&&t.close()}),this.options.clickClose&&this.$blocker.click(function(t){t.target===this&&o.modal.close()})},close:function(){s.pop(),this.unblock(),this.hide(),o.modal.isActive()||o(i).off("keydown.modal")},block:function(){this.$elm.trigger(o.modal.BEFORE_BLOCK,[this._ctx()]),this.$body.css("overflow","hidden"),this.$blocker=o('<div class="'+this.options.blockerClass+' blocker current"></div>').appendTo(this.$body),n(),this.options.doFade&&this.$blocker.css("opacity",0).animate({opacity:1},this.options.fadeDuration),this.$elm.trigger(o.modal.BLOCK,[this._ctx()])},unblock:function(t){!t&&this.options.doFade?this.$blocker.fadeOut(this.options.fadeDuration,this.unblock.bind(this,!0)):(this.$blocker.children().appendTo(this.$body),this.$blocker.remove(),this.$blocker=null,n(),o.modal.isActive()||this.$body.css("overflow",""))},show:function(){this.$elm.trigger(o.modal.BEFORE_OPEN,[this._ctx()]),this.options.showClose&&(this.closeButton=o('<a href="#close-modal" rel="modal:close" class="close-modal '+this.options.closeClass+'">'+this.options.closeText+"</a>"),this.$elm.append(this.closeButton)),this.$elm.addClass(this.options.modalClass).appendTo(this.$blocker),this.options.doFade?this.$elm.css({opacity:0,display:"inline-block"}).animate({opacity:1},this.options.fadeDuration):this.$elm.css("display","inline-block"),this.$elm.trigger(o.modal.OPEN,[this._ctx()])},hide:function(){this.$elm.trigger(o.modal.BEFORE_CLOSE,[this._ctx()]),this.closeButton&&this.closeButton.remove();var t=this;this.options.doFade?this.$elm.fadeOut(this.options.fadeDuration,function(){t.$elm.trigger(o.modal.AFTER_CLOSE,[t._ctx()])}):this.$elm.hide(0,function(){t.$elm.trigger(o.modal.AFTER_CLOSE,[t._ctx()])}),this.$elm.trigger(o.modal.CLOSE,[this._ctx()])},showSpinner:function(){this.options.showSpinner&&(this.spinner=this.spinner||o('<div class="'+this.options.modalClass+'-spinner"></div>').append(this.options.spinnerHtml),this.$body.append(this.spinner),this.spinner.show())},hideSpinner:function(){this.spinner&&this.spinner.remove()},_ctx:function(){return{elm:this.$elm,$elm:this.$elm,$blocker:this.$blocker,options:this.options,$anchor:this.anchor}}},o.modal.close=function(t){if(o.modal.isActive()){t&&t.preventDefault();var i=l();return i.close(),i.$elm}},o.modal.isActive=function(){return s.length>0},o.modal.getCurrent=l,o.modal.defaults={closeExisting:!0,escapeClose:!0,clickClose:!0,closeText:"Close",closeClass:"",modalClass:"modal",blockerClass:"jquery-modal",spinnerHtml:'<div class="rect1"></div><div class="rect2"></div><div class="rect3"></div><div class="rect4"></div>',showSpinner:!0,showClose:!0,fadeDuration:null,fadeDelay:1},o.modal.BEFORE_BLOCK="modal:before-block",o.modal.BLOCK="modal:block",o.modal.BEFORE_OPEN="modal:before-open",o.modal.OPEN="modal:open",o.modal.BEFORE_CLOSE="modal:before-close",o.modal.CLOSE="modal:close",o.modal.AFTER_CLOSE="modal:after-close",o.modal.AJAX_SEND="modal:ajax:send",o.modal.AJAX_SUCCESS="modal:ajax:success",o.modal.AJAX_FAIL="modal:ajax:fail",o.modal.AJAX_COMPLETE="modal:ajax:complete",o.fn.modal=function(t){return 1===this.length&&new o.modal(this,t),this},o(i).on("click.modal",'a[rel~="modal:close"]',o.modal.close),o(i).on("click.modal",'a[rel~="modal:open"]',function(t){t.preventDefault(),o(this).modal()})});