OHIF-157 Use OHIF.utils.absoluteUrl which removes the leading “/” from path before calling Meteor.absoluteUrl

This commit is contained in:
Evren Ozkan 2017-03-01 16:43:11 -05:00
parent 583147c542
commit 82876ddbe7
8 changed files with 23 additions and 13 deletions

View File

@ -1,4 +1,5 @@
import { Meteor } from 'meteor/meteor'; import { Meteor } from 'meteor/meteor';
import { OHIF } from 'meteor/ohif:core';
import { cornerstoneWADOImageLoader } from 'meteor/ohif:cornerstone'; import { cornerstoneWADOImageLoader } from 'meteor/ohif:cornerstone';
Meteor.startup(function() { Meteor.startup(function() {
@ -6,12 +7,12 @@ Meteor.startup(function() {
const config = { const config = {
maxWebWorkers: maxWebWorkers, maxWebWorkers: maxWebWorkers,
startWebWorkersOnDemand: true, startWebWorkersOnDemand: true,
webWorkerPath : Meteor.absoluteUrl('packages/ohif_cornerstone/public/js/cornerstoneWADOImageLoaderWebWorker.es5.js'), webWorkerPath : OHIF.utils.absoluteUrl('packages/ohif_cornerstone/public/js/cornerstoneWADOImageLoaderWebWorker.es5.js'),
taskConfiguration: { taskConfiguration: {
'decodeTask' : { 'decodeTask' : {
loadCodecsOnStartup : true, loadCodecsOnStartup : true,
initializeCodecsOnStartup: false, initializeCodecsOnStartup: false,
codecsPath: Meteor.absoluteUrl('packages/ohif_cornerstone/public/js/cornerstoneWADOImageLoaderCodecs.es5.js'), codecsPath: OHIF.utils.absoluteUrl('packages/ohif_cornerstone/public/js/cornerstoneWADOImageLoaderCodecs.es5.js'),
usePDFJS: false usePDFJS: false
} }
} }

View File

@ -1,3 +1,5 @@
import { OHIF } from 'meteor/ohif:core';
Meteor.startup(function () { Meteor.startup(function () {
// Mail server settings // Mail server settings
@ -33,7 +35,7 @@ Meteor.startup(function () {
}; };
Accounts.urls.resetPassword = function(token) { Accounts.urls.resetPassword = function(token) {
return Meteor.absoluteUrl('resetPassword/' + token); return OHIF.utils.absoluteUrl('resetPassword/' + token);
}; };
Accounts.emailTemplates.resetPassword.text = function(user, url) { Accounts.emailTemplates.resetPassword.text = function(user, url) {

View File

@ -1,4 +1,5 @@
import { Meteor } from 'meteor/meteor'; import { Meteor } from 'meteor/meteor';
import { OHIF } from 'meteor/ohif:core';
import { cornerstoneWADOImageLoader } from 'meteor/ohif:cornerstone'; import { cornerstoneWADOImageLoader } from 'meteor/ohif:cornerstone';
Meteor.startup(function() { Meteor.startup(function() {
@ -6,12 +7,12 @@ Meteor.startup(function() {
const config = { const config = {
maxWebWorkers: maxWebWorkers, maxWebWorkers: maxWebWorkers,
startWebWorkersOnDemand: true, startWebWorkersOnDemand: true,
webWorkerPath : Meteor.absoluteUrl('packages/ohif_cornerstone/public/js/cornerstoneWADOImageLoaderWebWorker.es5.js'), webWorkerPath : OHIF.utils.absoluteUrl('packages/ohif_cornerstone/public/js/cornerstoneWADOImageLoaderWebWorker.es5.js'),
taskConfiguration: { taskConfiguration: {
'decodeTask' : { 'decodeTask' : {
loadCodecsOnStartup : true, loadCodecsOnStartup : true,
initializeCodecsOnStartup: false, initializeCodecsOnStartup: false,
codecsPath: Meteor.absoluteUrl('packages/ohif_cornerstone/public/js/cornerstoneWADOImageLoaderCodecs.es5.js'), codecsPath: OHIF.utils.absoluteUrl('packages/ohif_cornerstone/public/js/cornerstoneWADOImageLoaderCodecs.es5.js'),
usePDFJS: false usePDFJS: false
} }
} }

View File

@ -1,7 +1,7 @@
import { Meteor } from 'meteor/meteor';
import { Template } from 'meteor/templating'; import { Template } from 'meteor/templating';
import { Session } from 'meteor/session'; import { Session } from 'meteor/session';
import { ReactiveVar } from 'meteor/reactive-var'; import { ReactiveVar } from 'meteor/reactive-var';
import { OHIF } from 'meteor/ohif:core';
/** /**
* Global Blaze UI helpers to work with Blaze * Global Blaze UI helpers to work with Blaze
@ -9,7 +9,7 @@ import { ReactiveVar } from 'meteor/reactive-var';
// Return the absolute url // Return the absolute url
Template.registerHelper('absoluteUrl', path => { Template.registerHelper('absoluteUrl', path => {
return Meteor.absoluteUrl(path); return OHIF.utils.absoluteUrl(path);
}); });
// Return the current template instance // Return the current template instance

View File

@ -1,5 +1,11 @@
import { OHIF } from 'meteor/ohif:core'; import { OHIF } from 'meteor/ohif:core';
// Return an absolute URL with the given path by supporting the leading "/"
OHIF.utils.absoluteUrl = function(path) {
path = path.replace(/^\//, '');
return Meteor.absoluteUrl(path);
};
// Return the array sorting function for its object's properties // Return the array sorting function for its object's properties
OHIF.utils.sortBy = function() { OHIF.utils.sortBy = function() {
var fields = [].slice.call(arguments), var fields = [].slice.call(arguments),

View File

@ -1,10 +1,11 @@
import { Meteor } from 'meteor/meteor'; import { Meteor } from 'meteor/meteor';
import { OHIF } from 'meteor/ohif:core';
Meteor.startup(function() { Meteor.startup(function() {
if (Meteor.isClient){ if (Meteor.isClient){
ActiveEntry.configure({ ActiveEntry.configure({
logo: { logo: {
url: Meteor.absoluteUrl('/images/logo.png'), url: OHIF.utils.absoluteUrl('/images/logo.png'),
displayed: true displayed: true
}, },
signIn: { signIn: {

View File

@ -1,4 +1,4 @@
import { Meteor } from "meteor/meteor"; import { OHIF } from 'meteor/ohif:core';
import { getWADORSImageId } from './getWADORSImageId'; import { getWADORSImageId } from './getWADORSImageId';
/** /**
@ -18,7 +18,7 @@ export function getImageId(instance, frame) {
} }
if (instance.wadouri) { if (instance.wadouri) {
var imageId = 'dicomweb:' + Meteor.absoluteUrl(instance.wadouri); var imageId = 'dicomweb:' + OHIF.utils.absoluteUrl(instance.wadouri);
if (frame !== undefined) { if (frame !== undefined) {
imageId += '&frame=' + frame; imageId += '&frame=' + frame;
} }

View File

@ -1,10 +1,9 @@
import { Meteor } from 'meteor/meteor';
import { OHIF } from 'meteor/ohif:core'; import { OHIF } from 'meteor/ohif:core';
/** /**
* Obtain an imageId for Cornerstone based on the WADO-RS scheme * Obtain an imageId for Cornerstone based on the WADO-RS scheme
* *
* @param {object} instance metadata object (InstanceMetadata) * @param {object} instanceMetada metadata object (InstanceMetadata)
* @returns {string} The imageId to be used by Cornerstone * @returns {string} The imageId to be used by Cornerstone
*/ */
@ -28,7 +27,7 @@ export function getWADORSImageId(instanceMetada) {
} }
const image = { const image = {
uri: Meteor.absoluteUrl(instance.wadorsuri), uri: OHIF.utils.absoluteUrl(instance.wadorsuri),
//imageId : '', //imageId : '',
//minPixelValue : 0, //minPixelValue : 0,
//maxPixelValue : 255, //maxPixelValue : 255,