tOOlmaRR / web-slideshow

a web application to display custom slideshows in a browser for locally-stored photos
0 stars 0 forks source link

Static Slideshows #64

Closed tOOlmaRR closed 1 year ago

tOOlmaRR commented 2 years ago

Description: As an alternative to tag-based dynamic slideshows, I would like to have more traditional static slideshows that always contains the same slides in a predetermined order.

Requirements:

Design:

  1. Database

    • New table called "StaticSlideshows" with columns "ID" (autoincrement), "Name", and "Secure"
    • New table called "StaticSlideshowSlides" that provides the many-to-many relationship between the "StaticSlideshows" table and the existing "Images table" with columns "ID" (autoincrement), "StaticSlideshowID" and ImageID as FKs to the two tables (this will allow an image to appear in a slideshow more than once), and "DisplayOrder"
    • New SPROC called "StaticSlideshow.Select" which, given a slideshow's name, retrieves all images in the slideshow ordered by the display order column
    • New SPROC called "StaticSlideshows.Select" which, given a "secure" flag, retrieves the names of all available slideshows in alphabetical order
  2. DAL

    • New class called "StaticSlideshowEntity" to represent data being retrieved from the database, along with a "get" method in "StaticSlideshowEntity" to retrieve the data via an SPROC
    • New class called "StaticSlideshowsEntity to represent a list if slideshows that are available, along with a "get" method to retrieve a list of slideshows (at this point, just names)
  3. Service Layer

    • New service called "loadStaticSlideshows" that will call the "getStaticSlideshows" method in "DbWebSlideshow" class
    • New service called "loadStaticSlideshowSlides that will call the "getStaticSlideshowSlides" method in "DbWebSlideshow" class
    • New service called "renderStaticSlideshowNames" that will produce the HTML required to render the drop-down containing the names of all available slideshows retrieved by the "loadStaticSlideshows" service as well as the wrapping fieldset container and the "Start Slideshow" button
    • New service called "renderStaticSlideshowSlide" which will produce the HTML required to render a single slide in the current static slideshow
  4. UI

    • Add a new radio button at the top of the Slideshow Options panel (inside the "show_collapsible_div") with two options: "Tag-Based Slideshows" (selected by default) and "Static Slideshows"
    • Add a new "staticSlideshowOptions" DIV containing a "staticSlideshowOptionsContainer" DIV after the radio button
    • Add a new "tagSlideshowOptions" DIV and include the existing "slideshowTagSelection" and "randomizeToggle" DIVs in it, but not the "slideshowSpeed" DIV.
  5. JS

    • Add new methods in slideshowFunctions (toggleSlideshowType) to hide or show the existing "slideshowOptions" or the new "staticSlideshowOptions" DIV based on the selected value
    • When "Static Slideshows" is selected, consider hiding the "Slide Info" panel completely, unless it's fairly easy to populate and render this info once all is said and done (The call to the "ShowSlides" so do that automagically)
    • Within the DOMContentLoaded event handler, add a call to a method that calls the new "loadStaticSlideshows" service to retrieve the static slideshows
    • After this, call another method that call the new "renderStaticSlideshowNames" service to render the fieldset, drop-down box, and button
    • After this, add another event listener for this new button, similar to the "Generate Slideshow" button
    • Within the event listener, call a new method that calls the "loadStaticSlideshowSlides" service to retrieve the slides for the current slideshow.
      • Refer to "loadSlideshowFromDb" method for a similar setup
      • Slideshow name is the input instead of the chosen tags
      • Mode can be normal for now
      • consider using the same method with a different signature, if that is possible in JS
      • integrate security stuff

Test Plan:

Implementation Notes:

tOOlmaRR commented 2 years ago

Static Slideshows

tOOlmaRR commented 1 year ago

Description may be a bit out of sync with my internal notes - a few things/steps were not needed