Creating ohif:compatibility package to enable IE11 support

This commit is contained in:
Bruno Alves de Faria 2017-04-17 16:50:10 -03:00
parent 66bc4e2105
commit 1f8eda7b82
13 changed files with 1116 additions and 20 deletions

View File

@ -26,6 +26,7 @@ clinical:hipaa-logger
aldeed:simple-schema # Third party package to deal with schemas aldeed:simple-schema # Third party package to deal with schemas
# OHIF Packages # OHIF Packages
ohif:compatibility
ohif:design ohif:design
ohif:core ohif:core
ohif:user ohif:user

View File

@ -87,6 +87,7 @@ natestrauser:select2@4.0.3
npm-bcrypt@0.9.2 npm-bcrypt@0.9.2
npm-mongo@2.2.11_2 npm-mongo@2.2.11_2
observe-sequence@1.0.14 observe-sequence@1.0.14
ohif:compatibility@0.0.1
ohif:core@0.0.1 ohif:core@0.0.1
ohif:cornerstone@0.0.1 ohif:cornerstone@0.0.1
ohif:design@0.0.1 ohif:design@0.0.1

View File

@ -5,6 +5,7 @@
# but you can also edit it by hand. # but you can also edit it by hand.
# OHIF Packages # OHIF Packages
ohif:compatibility
ohif:design ohif:design
ohif:core ohif:core
ohif:header ohif:header

View File

@ -72,6 +72,7 @@ mongo-id@1.0.6
natestrauser:select2@4.0.3 natestrauser:select2@4.0.3
npm-mongo@2.2.11_2 npm-mongo@2.2.11_2
observe-sequence@1.0.14 observe-sequence@1.0.14
ohif:compatibility@0.0.1
ohif:core@0.0.1 ohif:core@0.0.1
ohif:cornerstone@0.0.1 ohif:cornerstone@0.0.1
ohif:design@0.0.1 ohif:design@0.0.1

View File

@ -0,0 +1,11 @@
/* jshint -W060 */
// Check if browser is IE and add the polyfill scripts
if (navigator && /MSIE \d|Trident.*rv:/.test(navigator.userAgent)) {
const writeScript = fileName => {
const src = `/packages/ohif_compatibility/public/js/${fileName}`;
document.write(`<script src="${src}"><\/script>`);
};
writeScript('svgxuse.min.js');
writeScript('typedarray.js');
}

View File

@ -0,0 +1 @@
import './ie';

View File

@ -0,0 +1,19 @@
Package.describe({
name: 'ohif:compatibility',
summary: 'OHIF assets to keep compatibility with older browsers',
version: '0.0.1'
});
Package.onUse(function(api) {
api.versionsFrom('1.4');
// Meteor packages
api.use('ecmascript');
// Assets to be imported dynamically
api.addAssets('public/js/svgxuse.min.js', 'client');
api.addAssets('public/js/typedarray.js', 'client');
// Client imports
api.addFiles('client/index.js', 'client');
});

View File

@ -0,0 +1,12 @@
/*!
* @copyright Copyright (c) 2017 IcoMoon.io
* @license Licensed under MIT license
* See https://github.com/Keyamoon/svgxuse
* @version 1.2.4
*/
(function(){if("undefined"!==typeof window&&window.addEventListener){var e=Object.create(null),n,t,d=function(){clearTimeout(t);t=setTimeout(n,100)},q=function(){},u=function(){var f;window.addEventListener("resize",d,!1);window.addEventListener("orientationchange",d,!1);window.MutationObserver?(f=new MutationObserver(d),f.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0}),q=function(){try{f.disconnect(),window.removeEventListener("resize",d,!1),window.removeEventListener("orientationchange",
d,!1)}catch(w){}}):(document.documentElement.addEventListener("DOMSubtreeModified",d,!1),q=function(){document.documentElement.removeEventListener("DOMSubtreeModified",d,!1);window.removeEventListener("resize",d,!1);window.removeEventListener("orientationchange",d,!1)})},v=function(f){function e(a){var c;void 0!==a.protocol?c=a:(c=document.createElement("a"),c.href=a);return c.protocol.replace(/:/g,"")+c.host}var d,p;window.XMLHttpRequest&&(d=new XMLHttpRequest,p=e(location),f=e(f),d=void 0===d.withCredentials&&
""!==f&&f!==p?XDomainRequest||void 0:XMLHttpRequest);return d};n=function(){function d(){--r;0===r&&(q(),u())}function l(a){return function(){!0!==e[a.base]&&(a.isXlink?a.useEl.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href","#"+a.hash):a.useEl.setAttribute("href","#"+a.hash))}}function n(a){return function(){var c=document.body,b=document.createElement("x");a.onload=null;b.innerHTML=a.responseText;if(b=b.getElementsByTagName("svg")[0])b.setAttribute("aria-hidden","true"),b.style.position=
"absolute",b.style.width=0,b.style.height=0,b.style.overflow="hidden",c.insertBefore(b,c.firstChild);d()}}function p(a){return function(){a.onerror=null;a.ontimeout=null;d()}}var a,c,m,g,r=0,b,k=!1,h;q();h=document.getElementsByTagName("use");for(g=0;g<h.length;g+=1){try{c=h[g].getBoundingClientRect()}catch(x){c=!1}(a=h[g].getAttribute("href"))?k=!1:(a=h[g].getAttributeNS("http://www.w3.org/1999/xlink","href"),k=!0);m=a&&a.split?a.split("#"):["",""];a=m[0];m=m[1];b=c&&0===c.left&&0===c.right&&0===
c.top&&0===c.bottom;c&&0===c.width&&0===c.height&&!b?a.length&&(b=e[a],!0!==b&&setTimeout(l({useEl:h[g],base:a,hash:m,isXlink:k}),0),void 0===b&&(k=v(a),void 0!==k&&(b=new k,e[a]=b,b.onload=n(b),b.onerror=p(b),b.ontimeout=p(b),b.open("GET",a),b.send(),r+=1))):b?a.length&&e[a]&&setTimeout(l({useEl:h[g],base:a,hash:m,isXlink:k}),0):void 0===e[a]?e[a]=!0:e[a].onload&&(e[a].abort(),delete e[a].onload,e[a]=!0)}h="";r+=1;d()};var l;l=function(){window.removeEventListener("load",l,!1);t=setTimeout(n,0)};
"complete"!==document.readyState?window.addEventListener("load",l,!1):l()}})();

File diff suppressed because it is too large Load Diff

View File

@ -1702,7 +1702,6 @@ if(typeof cornerstoneWADOImageLoader === 'undefined'){
seriesInstanceUID: dataSet.string('x0020000e'), seriesInstanceUID: dataSet.string('x0020000e'),
seriesNumber: dataSet.intString('x00200011'), seriesNumber: dataSet.intString('x00200011'),
studyInstanceUID: dataSet.string('x0020000d'), studyInstanceUID: dataSet.string('x0020000d'),
seriesInstanceUID: dataSet.string('x0020000e'),
seriesDate: dicomParser.parseDA(dataSet.string('x00080021')), seriesDate: dicomParser.parseDA(dataSet.string('x00080021')),
seriesTime: dicomParser.parseTM(dataSet.string('x00080031') || '') seriesTime: dicomParser.parseTM(dataSet.string('x00080031') || '')
}; };

View File

@ -19,6 +19,7 @@ ecmascript@0.6.1 # Enable ECMAScript2015+ syntax in app code
shell-server@0.2.1 # Server-side component of the `meteor shell` command shell-server@0.2.1 # Server-side component of the `meteor shell` command
# OHIF Packages # OHIF Packages
ohif:compatibility
ohif:core ohif:core
ohif:header ohif:header
ohif:design ohif:design

View File

@ -72,6 +72,7 @@ mrt:moment@2.8.1
natestrauser:select2@4.0.3 natestrauser:select2@4.0.3
npm-mongo@2.2.11_2 npm-mongo@2.2.11_2
observe-sequence@1.0.14 observe-sequence@1.0.14
ohif:compatibility@0.0.1
ohif:core@0.0.1 ohif:core@0.0.1
ohif:cornerstone@0.0.1 ohif:cornerstone@0.0.1
ohif:design@0.0.1 ohif:design@0.0.1