Unify the display of novel streaming checkbox
| @@ -218,22 +218,6 @@ | ||
| 218 | 218 | </div> |
| 219 | 219 | </div> |
| 220 | 220 | </div> |
| 221 | - <div id="ai_module_block_novel" class="width100p"> | |
| 222 | - <div class="range-block"> | |
| 223 | - <div class="range-block-title justifyLeft" data-i18n="AI Module"> | |
| 224 | - AI Module | |
| 225 | - </div> | |
| 226 | - <div class="toggle-description justifyLeft" data-i18n="Changes the style of the generated text."> | |
| 227 | - Changes the style of the generated text. | |
| 228 | - </div> | |
| 229 | - <select id="nai_prefix"> | |
| 230 | - <option value="vanilla" data-i18n="No Module">No Module</option> | |
| 231 | - <option value="special_instruct" data-i18n="Instruct">Instruct</option> | |
| 232 | - <option value="special_proseaugmenter" data-i18n="Prose Augmenter">Prose Augmenter</option> | |
| 233 | - <option value="theme_textadventure" data-i18n="Text Adventure">Text Adventure</option> | |
| 234 | - </select> | |
| 235 | - </div> | |
| 236 | - </div> | |
| 237 | 221 | <div id="common-gen-settings-block" class="width100p"> |
| 238 | 222 | <div id="pro-settings-block" class="flex-container gap10h5v justifyCenter"> |
| 239 | 223 | <div id="amount_gen_block" class="alignitemscenter flex-container marginBot5 flexFlowColumn flexBasis48p flexGrow flexShrink gap0"> |
| @@ -258,6 +242,14 @@ | ||
| 258 | 242 | </small> |
| 259 | 243 | </label> |
| 260 | 244 | </div> |
| 245 | + <div id="streaming_novel_block" class="flex-container alignitemscenter justifyCenter marginTop5"> | |
| 246 | + <label class="checkbox_label" for="streaming_novel"> | |
| 247 | + <input type="checkbox" id="streaming_novel" /> | |
| 248 | + <small><span data-i18n="Streaming">Streaming</span> | |
| 249 | + <div class="margin5 fa-solid fa-circle-info opacity50p" data-i18n="[title]Streaming_desc" title="Display the response bit by bit as it is generated. When this is off, responses will be displayed all at once when they are complete."></div> | |
| 250 | + </small> | |
| 251 | + </label> | |
| 252 | + </div> | |
| 261 | 253 | </div> |
| 262 | 254 | <div id="max_context_block" class="alignitemscenter flex-container marginBot5 flexFlowColumn flexBasis48p flexGrow flexShrink gap0"> |
| 263 | 255 | <small data-i18n="context size(tokens)">Context (tokens)</small> |
| @@ -278,6 +270,22 @@ | ||
| 278 | 270 | <span data-i18n="Max prompt cost:">Max prompt cost:</span> <span id="or_prompt_cost">–</span> |
| 279 | 271 | </small> |
| 280 | 272 | </div> |
| 273 | + <div id="ai_module_block_novel" class="width100p"> | |
| 274 | + <div class="range-block"> | |
| 275 | + <div class="range-block-title justifyLeft" data-i18n="AI Module"> | |
| 276 | + AI Module | |
| 277 | + </div> | |
| 278 | + <div class="toggle-description justifyLeft" data-i18n="Changes the style of the generated text."> | |
| 279 | + Changes the style of the generated text. | |
| 280 | + </div> | |
| 281 | + <select id="nai_prefix"> | |
| 282 | + <option value="vanilla" data-i18n="No Module">No Module</option> | |
| 283 | + <option value="special_instruct" data-i18n="Instruct">Instruct</option> | |
| 284 | + <option value="special_proseaugmenter" data-i18n="Prose Augmenter">Prose Augmenter</option> | |
| 285 | + <option value="theme_textadventure" data-i18n="Text Adventure">Text Adventure</option> | |
| 286 | + </select> | |
| 287 | + </div> | |
| 288 | + </div> | |
| 281 | 289 | <hr> |
| 282 | 290 | </div> |
| 283 | 291 | <div id="respective-ranges-and-temps" class="width100p"> |
| @@ -287,19 +295,6 @@ | ||
| 287 | 295 | --> |
| 288 | 296 | <div id="range_block_novel"> |
| 289 | 297 | <div class="range-block"> |
| 290 | - <label class="checkbox_label widthFreeExpand"> | |
| 291 | - <input id="streaming_novel" type="checkbox" /> | |
| 292 | - <span data-i18n="Streaming">Streaming</span> | |
| 293 | - </label> | |
| 294 | - <div class="toggle-description justifyLeft"> | |
| 295 | - <span data-i18n="Display the response bit by bit as it is generated."> | |
| 296 | - Display the response bit by bit as it is generated.</span><br> | |
| 297 | - <span data-i18n="When this is off, responses will be displayed all at once when they are complete."> | |
| 298 | - When this is off, responses will be displayed all at once when they are complete. | |
| 299 | - </span> | |
| 300 | - </div> | |
| 301 | - </div> | |
| 302 | - <div class="range-block"> | |
| 303 | 298 | <div class="range-block-title" data-i18n="Temperature"> |
| 304 | 299 | Temperature |
| 305 | 300 | </div> |
| @@ -5160,6 +5155,8 @@ | ||
| 5160 | 5155 | </div> |
| 5161 | 5156 | <!-- various fullscreen popups --> |
| 5162 | 5157 | <div name="templatesAndPopupsWrapper"> <!--this div is just for IDE sanity for quick collapsing--> |
| 5158 | + <!-- Point to this element when you need a no-op selector --> | |
| 5159 | + <template id="NULL_SELECTOR" class="displayNone"></template> | |
| 5163 | 5160 | <div id="export_format_popup" class="list-group"> |
| 5164 | 5161 | <div class="export_format list-group-item" data-format="png">PNG</div> |
| 5165 | 5162 | <div class="export_format list-group-item" data-format="json">JSON</div> |
| @@ -6360,6 +6360,7 @@ export function changeMainAPI() { | ||
| 6360 | 6360 | //console.log(selectedVal); |
| 6361 | 6361 | const apiElements = { |
| 6362 | 6362 | 'koboldhorde': { |
| 6363 | + apiStreaming: $('#NULL_SELECTOR'), | |
| 6363 | 6364 | apiSettings: $('#kobold_api-settings'), |
| 6364 | 6365 | apiConnector: $('#kobold_horde'), |
| 6365 | 6366 | apiPresets: $('#kobold_api-presets'), |
| @@ -6368,6 +6369,7 @@ export function changeMainAPI() { | ||
| 6368 | 6369 | amountGenElem: $('#amount_gen_block'), |
| 6369 | 6370 | }, |
| 6370 | 6371 | 'kobold': { |
| 6372 | + apiStreaming: $('#streaming_kobold_block'), | |
| 6371 | 6373 | apiSettings: $('#kobold_api-settings'), |
| 6372 | 6374 | apiConnector: $('#kobold_api'), |
| 6373 | 6375 | apiPresets: $('#kobold_api-presets'), |
| @@ -6376,6 +6378,7 @@ export function changeMainAPI() { | ||
| 6376 | 6378 | amountGenElem: $('#amount_gen_block'), |
| 6377 | 6379 | }, |
| 6378 | 6380 | 'textgenerationwebui': { |
| 6381 | + apiStreaming: $('#streaming_textgenerationwebui_block'), | |
| 6379 | 6382 | apiSettings: $('#textgenerationwebui_api-settings'), |
| 6380 | 6383 | apiConnector: $('#textgenerationwebui_api'), |
| 6381 | 6384 | apiPresets: $('#textgenerationwebui_api-presets'), |
| @@ -6384,6 +6387,7 @@ export function changeMainAPI() { | ||
| 6384 | 6387 | amountGenElem: $('#amount_gen_block'), |
| 6385 | 6388 | }, |
| 6386 | 6389 | 'novel': { |
| 6390 | + apiStreaming: $('#streaming_novel_block'), | |
| 6387 | 6391 | apiSettings: $('#novel_api-settings'), |
| 6388 | 6392 | apiConnector: $('#novel_api'), |
| 6389 | 6393 | apiPresets: $('#novel_api-presets'), |
| @@ -6392,6 +6396,7 @@ export function changeMainAPI() { | ||
| 6392 | 6396 | amountGenElem: $('#amount_gen_block'), |
| 6393 | 6397 | }, |
| 6394 | 6398 | 'openai': { |
| 6399 | + apiStreaming: $('#NULL_SELECTOR'), | |
| 6395 | 6400 | apiSettings: $('#openai_settings'), |
| 6396 | 6401 | apiConnector: $('#openai_api'), |
| 6397 | 6402 | apiPresets: $('#openai_api-presets'), |
| @@ -6414,12 +6419,14 @@ export function changeMainAPI() { | ||
| 6414 | 6419 | apiObj.apiConnector.css('display', 'none'); |
| 6415 | 6420 | apiObj.apiRanges.css('display', 'none'); |
| 6416 | 6421 | apiObj.apiPresets.css('display', 'none'); |
| 6422 | + apiObj.apiStreaming.css('display', 'none'); | |
| 6417 | 6423 | } |
| 6418 | 6424 | |
| 6419 | 6425 | //then, find and enable the active item. |
| 6420 | 6426 | //This is split out of the loop so that different apis can share settings divs |
| 6421 | 6427 | let activeItem = apiElements[selectedVal]; |
| 6422 | 6428 | |
| 6429 | + activeItem.apiStreaming.css('display', 'block'); | |
| 6423 | 6430 | activeItem.apiSettings.css('display', 'block'); |
| 6424 | 6431 | activeItem.apiConnector.css('display', 'block'); |
| 6425 | 6432 | activeItem.apiRanges.css('display', 'block'); |
| @@ -6436,17 +6443,6 @@ export function changeMainAPI() { | ||
| 6436 | 6443 | } |
| 6437 | 6444 | |
| 6438 | 6445 | //custom because streaming has been moved up under response tokens, which exists inside common settings block |
| 6439 | - if (selectedVal === 'textgenerationwebui') { | |
| 6440 | - $('#streaming_textgenerationwebui_block').css('display', 'block'); | |
| 6441 | - } else { | |
| 6442 | - $('#streaming_textgenerationwebui_block').css('display', 'none'); | |
| 6443 | - } | |
| 6444 | - if (selectedVal === 'kobold') { | |
| 6445 | - $('#streaming_kobold_block').css('display', 'block'); | |
| 6446 | - } else { | |
| 6447 | - $('#streaming_kobold_block').css('display', 'none'); | |
| 6448 | - } | |
| 6449 | - | |
| 6450 | 6446 | if (selectedVal === 'novel') { |
| 6451 | 6447 | $('#ai_module_block_novel').css('display', 'block'); |
| 6452 | 6448 | } else { |