Mercurial > hg > orthanc-stone
comparison Applications/StoneWebViewer/WebApplication/app.js @ 1561:cf652990abb1
tunable mouse actions
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 20 Aug 2020 17:44:35 +0200 |
parents | 6d14ed6163b1 |
children | 2a4a6b967053 |
comparison
equal
deleted
inserted
replaced
1560:b4ccd4963d37 | 1561:cf652990abb1 |
---|---|
102 stone: stone, // To access global object "stone" from "index.html" | 102 stone: stone, // To access global object "stone" from "index.html" |
103 ready: false, | 103 ready: false, |
104 leftMode: 'grid', // Can be 'small', 'grid' or 'full' | 104 leftMode: 'grid', // Can be 'small', 'grid' or 'full' |
105 leftVisible: true, | 105 leftVisible: true, |
106 viewportLayoutButtonsVisible: false, | 106 viewportLayoutButtonsVisible: false, |
107 mouseActionsVisible: false, | |
107 activeViewport: 0, | 108 activeViewport: 0, |
108 showInfo: true, | 109 showInfo: true, |
109 showReferenceLines: true, | 110 showReferenceLines: true, |
110 | 111 |
111 modalWarning: false, | 112 modalWarning: false, |
191 settingSoftwareRendering: function(newVal, oldVal) { | 192 settingSoftwareRendering: function(newVal, oldVal) { |
192 localStorage.settingSoftwareRendering = (newVal ? '1' : '0'); | 193 localStorage.settingSoftwareRendering = (newVal ? '1' : '0'); |
193 } | 194 } |
194 }, | 195 }, |
195 methods: { | 196 methods: { |
196 FitContent() { | 197 FitContent: function() { |
197 // This function can be used even if WebAssembly is not initialized yet | 198 // This function can be used even if WebAssembly is not initialized yet |
198 if (typeof stone._AllViewportsUpdateSize !== 'undefined') { | 199 if (typeof stone._AllViewportsUpdateSize !== 'undefined') { |
199 this.$nextTick(function () { | 200 this.$nextTick(function () { |
200 stone.AllViewportsUpdateSize(true /* fit content */); | 201 stone.AllViewportsUpdateSize(true /* fit content */); |
201 }); | 202 }); |
202 } | 203 } |
203 }, | 204 }, |
204 | 205 |
205 GetActiveSeries() { | 206 GetActiveSeries: function() { |
206 var s = []; | 207 var s = []; |
207 | 208 |
208 if ('tags' in this.viewport1Series) | 209 if ('tags' in this.viewport1Series) |
209 s.push(this.viewport1Series.tags[SERIES_INSTANCE_UID]); | 210 s.push(this.viewport1Series.tags[SERIES_INSTANCE_UID]); |
210 | 211 |
218 s.push(this.viewport4Series.tags[SERIES_INSTANCE_UID]); | 219 s.push(this.viewport4Series.tags[SERIES_INSTANCE_UID]); |
219 | 220 |
220 return s; | 221 return s; |
221 }, | 222 }, |
222 | 223 |
223 GetActiveCanvas() { | 224 GetActiveCanvas: function() { |
224 if (this.activeViewport == 1) { | 225 if (this.activeViewport == 1) { |
225 return 'canvas1'; | 226 return 'canvas1'; |
226 } | 227 } |
227 else if (this.activeViewport == 2) { | 228 else if (this.activeViewport == 2) { |
228 return 'canvas2'; | 229 return 'canvas2'; |
443 this.$set(this.viewport4Series, series); | 444 this.$set(this.viewport4Series, series); |
444 } | 445 } |
445 } | 446 } |
446 }, | 447 }, |
447 | 448 |
448 SetWindowing(center, width) { | 449 SetWindowing: function(center, width) { |
449 var canvas = this.GetActiveCanvas(); | 450 var canvas = this.GetActiveCanvas(); |
450 if (canvas != '') { | 451 if (canvas != '') { |
451 stone.SetWindowing(canvas, center, width); | 452 stone.SetWindowing(canvas, center, width); |
452 } | 453 } |
453 }, | 454 }, |
454 | 455 |
455 SetDefaultWindowing() { | 456 SetDefaultWindowing: function() { |
456 var canvas = this.GetActiveCanvas(); | 457 var canvas = this.GetActiveCanvas(); |
457 if (canvas != '') { | 458 if (canvas != '') { |
458 stone.SetDefaultWindowing(canvas); | 459 stone.SetDefaultWindowing(canvas); |
459 } | 460 } |
460 }, | 461 }, |
461 | 462 |
462 InvertContrast() { | 463 InvertContrast: function() { |
463 var canvas = this.GetActiveCanvas(); | 464 var canvas = this.GetActiveCanvas(); |
464 if (canvas != '') { | 465 if (canvas != '') { |
465 stone.InvertContrast(canvas); | 466 stone.InvertContrast(canvas); |
466 } | 467 } |
467 }, | 468 }, |
468 | 469 |
469 FlipX() { | 470 FlipX: function() { |
470 var canvas = this.GetActiveCanvas(); | 471 var canvas = this.GetActiveCanvas(); |
471 if (canvas != '') { | 472 if (canvas != '') { |
472 stone.FlipX(canvas); | 473 stone.FlipX(canvas); |
473 } | 474 } |
474 }, | 475 }, |
475 | 476 |
476 FlipY() { | 477 FlipY: function() { |
477 var canvas = this.GetActiveCanvas(); | 478 var canvas = this.GetActiveCanvas(); |
478 if (canvas != '') { | 479 if (canvas != '') { |
479 stone.FlipY(canvas); | 480 stone.FlipY(canvas); |
480 } | 481 } |
481 }, | 482 }, |
482 | 483 |
483 ApplyPreferences() { | 484 ApplyPreferences: function() { |
484 this.modalPreferences = false; | 485 this.modalPreferences = false; |
485 | 486 |
486 if ((stone.IsSoftwareRendering() != 0) != this.settingSoftwareRendering) { | 487 if ((stone.IsSoftwareRendering() != 0) != this.settingSoftwareRendering) { |
487 document.location.reload(); | 488 document.location.reload(); |
488 } | 489 } |
489 } | 490 }, |
491 | |
492 HideAllTooltips: function() { | |
493 $('[data-toggle="tooltip"]').tooltip('hide'); | |
494 }, | |
495 | |
496 SetMouseButtonActions: function(left, middle, right) { | |
497 this.mouseActionsVisible = false; | |
498 stone.SetMouseButtonActions(left, middle, right); | |
499 } | |
490 }, | 500 }, |
491 | 501 |
492 mounted: function() { | 502 mounted: function() { |
493 this.SetViewportLayout('1x1'); | 503 this.SetViewportLayout('1x1'); |
494 | 504 |
607 | 617 |
608 | 618 |
609 | 619 |
610 $(document).ready(function() { | 620 $(document).ready(function() { |
611 // Enable support for tooltips in Bootstrap | 621 // Enable support for tooltips in Bootstrap |
612 //$('[data-toggle="tooltip"]').tooltip(); | 622 $('[data-toggle="tooltip"]').tooltip({ |
623 placement: 'bottom', | |
624 container: 'body', | |
625 trigger: 'hover' | |
626 }); | |
613 | 627 |
614 //app.modalWarning = true; | 628 //app.modalWarning = true; |
615 | 629 |
616 | 630 |
617 $('#windowing-popover').popover({ | 631 $('#windowing-popover').popover({ |