changeset 1968:ed5a0b9183dc

The text field with the instance number is editable to go to a specific instance
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 28 Oct 2022 10:56:34 +0200
parents b180233143ae
children ee68ee732aa7
files Applications/StoneWebViewer/NEWS Applications/StoneWebViewer/WebApplication/app-fixes.css Applications/StoneWebViewer/WebApplication/app.js Applications/StoneWebViewer/WebApplication/index.html
diffstat 4 files changed, 19 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/Applications/StoneWebViewer/NEWS	Fri Oct 28 10:38:30 2022 +0200
+++ b/Applications/StoneWebViewer/NEWS	Fri Oct 28 10:56:34 2022 +0200
@@ -3,6 +3,7 @@
 
 * Added vertical slider showing position of the current frame inside the series
 * Display of orientation markers
+* The text field with the instance number is editable to go to a specific instance
 * New configuration options:
   - "ShowInfoPanelAtStartup" to control the info panel at startup
   - "ShowUserPreferencesButton" to show the button for setting preferences
--- a/Applications/StoneWebViewer/WebApplication/app-fixes.css	Fri Oct 28 10:38:30 2022 +0200
+++ b/Applications/StoneWebViewer/WebApplication/app-fixes.css	Fri Oct 28 10:56:34 2022 +0200
@@ -65,3 +65,9 @@
     height: 5%;
     background-color: #00ff00;
 }
+
+.wvInputInstanceNumber {
+    width: 6ch;  /* width of 6 characters */
+    border: 2px solid rgba(255, 202, 128, 0.24);
+    background-color: transparent;
+}
--- a/Applications/StoneWebViewer/WebApplication/app.js	Fri Oct 28 10:38:30 2022 +0200
+++ b/Applications/StoneWebViewer/WebApplication/app.js	Fri Oct 28 10:56:34 2022 +0200
@@ -141,6 +141,7 @@
       stone: stone,  // To access global object "stone" from "index.html"
       status: 'waiting',
       currentFrame: 0,
+      currentFrameFromUser: 0,
       numberOfFrames: 0,
       quality: '',
       cineControls: false,
@@ -158,6 +159,7 @@
   },
   watch: {
     currentFrame: function(newVal, oldVal) {
+      this.currentFrameFromUser = newVal + 1;
       if (this.cineLoadingFrame) {
         /**
          * The "FrameUpdated" event has been received, which indicates
@@ -169,6 +171,13 @@
         stone.SetFrame(this.canvasId, newVal);
       }
     },
+    currentFrameFromUser: function(newVal, oldVal) {
+      if (parseInt(newVal, 10) !== NaN &&
+          newVal >= 1 &&
+          newVal <= this.numberOfFrames) {
+        this.currentFrame = this.currentFrameFromUser - 1;
+      }
+    },
     content: function(newVal, oldVal) {
       this.status = 'loading';
       this.cineControls = false;
--- a/Applications/StoneWebViewer/WebApplication/index.html	Fri Oct 28 10:38:30 2022 +0200
+++ b/Applications/StoneWebViewer/WebApplication/index.html	Fri Oct 28 10:56:34 2022 +0200
@@ -720,7 +720,9 @@
                         </button>
                       </div>
                       <span data-toggle="tooltip" data-title="Current frame number">
-                        &nbsp;&nbsp;{{ currentFrame + 1 }} / {{ numberOfFrames }}&nbsp;&nbsp;
+                        &nbsp;&nbsp;
+                        <input type="text" v-model="currentFrameFromUser" class="wvInputInstanceNumber"> / {{ numberOfFrames }}
+                        &nbsp;&nbsp;
                       </span>
                       <div class="btn-group btn-group-sm" role="group">                        
                         <button class="btn btn-primary" @click="IncrementFrame()">