### Django-Hosts Setup Example Source: https://github.com/sefaria/sefaria-project/blob/master/agent_docs/sefaria/views_and_routing.md Illustrates how domain strings are dynamically built for different languages and subdomains using settings and constants. ```Python settings.DOMAIN_MODULES[lang][LIBRARY_MODULE] -> library subdomain settings.DOMAIN_MODULES[lang][VOICES_MODULE] -> sheets subdomain ``` -------------------------------- ### Full HTML Example with Progressbar Initialization Source: https://github.com/sefaria/sefaria-project/blob/master/static/js/lib/jquery-ui/development-bundle/docs/progressbar.html A complete HTML document demonstrating the setup and initialization of a jQuery UI Progressbar. It includes necessary CSS and JavaScript includes. ```html
``` -------------------------------- ### Full HTML Example with jQuery UI Slider Initialization Source: https://github.com/sefaria/sefaria-project/blob/master/static/js/lib/jquery-ui/development-bundle/docs/slider.html A complete HTML document demonstrating the setup and initialization of a jQuery UI Slider, including necessary CSS and JavaScript includes. ```html
``` -------------------------------- ### Full HTML Example with jQuery UI Accordion Source: https://github.com/sefaria/sefaria-project/blob/master/static/js/lib/jquery-ui/development-bundle/docs/accordion.html A complete HTML document demonstrating the setup and initialization of a jQuery UI Accordion, including necessary CSS and JavaScript includes. ```html

Section 1

Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer ut neque. Vivamus nisi metus, molestie vel, gravida in, condimentum sit amet, nunc. Nam a nibh. Donec suscipit eros. Nam mi. Proin viverra leo ut odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate.

Section 2

Sed non urna. Donec et ante. Phasellus eu ligula. Vestibulum sit amet purus. Vivamus hendrerit, dolor at aliquet laoreet, mauris turpis porttitor velit, faucibus interdum tellus libero ac justo. Vivamus non quam. In suscipit faucibus urna.

Section 3

Nam enim risus, molestie et, porta ac, aliquam ac, risus. Quisque lobortis. Phasellus pellentesque purus in massa. Aenean in pede. Phasellus ac libero ac tellus pellentesque semper. Sed ac felis. Sed commodo, magna quis lacinia ornare, quam ante aliquam nisi, eu iaculis leo purus venenatis dui.

Section 4

Cras dictum. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aenean lacinia mauris vel est.

Suspendisse eu nisl. Nullam ut libero. Integer dignissim consequat lectus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.

``` -------------------------------- ### CSS for Open Example and Goto Input Source: https://github.com/sefaria/sefaria-project/blob/master/static/dev/jqm.html Styles the 'open example' text and the input field for the 'goto' functionality. ```css #openEg { font-style: italic; font-size: 14px; margin: 7px 5px 0px 5px; } #goto { font-size: 17px; width: 265px; } ``` -------------------------------- ### Bind to 'start' Event Source: https://github.com/sefaria/sefaria-project/blob/master/static/js/lib/jquery-ui/development-bundle/docs/selectable.html Bind to the 'start' event by its type: 'selectablestart'. ```javascript $( ".selector" ).bind( "selectablestart", function(event, ui) { ... }); ``` -------------------------------- ### Full HTML Example with jQuery UI Position Source: https://github.com/sefaria/sefaria-project/blob/master/static/js/lib/jquery-ui/development-bundle/docs/position.html A complete HTML document demonstrating the jQuery UI Position utility, including necessary CSS and JavaScript setup. ```html
``` -------------------------------- ### Handle 'start' Event with Init Option Source: https://github.com/sefaria/sefaria-project/blob/master/static/js/lib/jquery-ui/development-bundle/docs/selectable.html Supply a callback function to handle the 'start' event when initializing the selectable widget. ```javascript $( ".selector" ).selectable({ start: function(event, ui) { ... } }); ``` -------------------------------- ### Full HTML Example with Local Array Autocomplete Source: https://github.com/sefaria/sefaria-project/blob/master/static/js/lib/jquery-ui/development-bundle/docs/autocomplete.html A complete HTML document demonstrating the setup and usage of the jQuery UI Autocomplete widget with a local array of strings. Includes necessary CSS and JavaScript includes. ```html ``` -------------------------------- ### Handle 'start' Event on Initialization Source: https://github.com/sefaria/sefaria-project/blob/master/static/js/lib/jquery-ui/development-bundle/docs/draggable.html Provides a callback function to handle the 'start' event when the draggable is initialized. ```javascript $( ".selector" ).draggable({ start: function(event, ui) { ... } }); ``` -------------------------------- ### Handle Slider Start Event with Init Option Source: https://github.com/sefaria/sefaria-project/blob/master/static/js/lib/jquery-ui/development-bundle/docs/slider.html Supply a callback function to handle the 'start' event when initializing the slider. ```javascript $( ".selector" ).slider({ start: function(event, ui) { ... } }); ``` -------------------------------- ### Get or Set AppendTo Option Source: https://github.com/sefaria/sefaria-project/blob/master/static/js/lib/jquery-ui/development-bundle/docs/sortable.html Provides examples for getting the current `appendTo` option value and for setting it to 'body' on an existing sortable instance. ```javascript //getter var appendTo = $( ".selector" ).sortable( "option", "appendTo" ); //setter $( ".selector" ).sortable( "option", "appendTo", 'body' ); ``` -------------------------------- ### Add a New WebSite via CLI Source: https://github.com/sefaria/sefaria-project/wiki/Adding-WebSites Shows the necessary steps to create and save a new WebSite object using the Sefaria command-line interface. Ensure all required attributes are provided. ```python from sefaria.model.webpage import * w = WebSite() w.name = "Torah In Motion" # required attribute w.domains = ["torahinmotion.org", "torahinmotionorg.e.civicrm.ca"] # required attribute w.is_whitelisted = True #required attribute w.save() ``` -------------------------------- ### Get or Set Delay Option Source: https://github.com/sefaria/sefaria-project/blob/master/static/js/lib/jquery-ui/development-bundle/docs/selectable.html Shows how to get the current delay setting or change it after initialization. Adjusting this value can fine-tune the sensitivity for starting a selection. ```javascript //getter var delay = $( ".selector" ).selectable( "option", "delay" ); //setter $( ".selector" ).selectable( "option", "delay", 20 ); ``` -------------------------------- ### Get or Set ConnectWith Option Source: https://github.com/sefaria/sefaria-project/blob/master/static/js/lib/jquery-ui/development-bundle/docs/sortable.html Provides examples for retrieving the current `connectWith` option and setting it to '.otherlist' for a sortable. ```javascript //getter var connectWith = $( ".selector" ).sortable( "option", "connectWith" ); //setter $( ".selector" ).sortable( "option", "connectWith", '.otherlist' ); ``` -------------------------------- ### Install Dependencies and Run Tests Source: https://github.com/sefaria/sefaria-project/blob/master/e2e-tests/README.md Installs project dependencies, downloads Playwright browser binaries, sets up the environment file, and runs a quick test to verify the setup. Also shows how to open the UI runner for interactive exploration. ```bash # 1. From the repo root, install dependencies (once) npm install # 2. Download the browser binaries Playwright drives (once) npx playwright install # Chromium, Firefox, WebKit # 3. Create your local env file from the template cp e2e-tests/example.env e2e-tests/.env # …then fill in SANDBOX_URL, SANDBOX_URL_IL, and the PLAYWRIGHT_*_EMAIL / _PASSWORD # credentials. The .env file is gitignored — never commit it. # 4. Run one fast test to confirm the wiring works npx playwright test library/header.spec.ts --project=chrome-library # 5. Open the UI runner to explore the suite interactively npx playwright test --ui ``` -------------------------------- ### Example Usage of Sefaria CLI Source: https://github.com/sefaria/sefaria-project/wiki/Command-Line-Interface Demonstrates how to create a LinkSet for a specific reference and count the number of links using the Sefaria CLI. ```python >>> p = LinkSet(Ref("Genesis 13")) >>> p.count() 226 ``` -------------------------------- ### Get Section-Level Reference Source: https://github.com/sefaria/sefaria-project/blob/master/agent_docs/frontend/sefaria_js.md Extracts the section-level reference from a given reference string. For example, 'Genesis 1:2:3' would return 'Genesis 1:2'. ```javascript Sefaria.sectionRef(refString) ``` -------------------------------- ### Initialize Dialog with minWidth Source: https://github.com/sefaria/sefaria-project/blob/master/static/js/lib/jquery-ui/development-bundle/docs/dialog.html Example of initializing a dialog and setting the minWidth option. ```javascript $( ".selector" ).dialog({ minWidth: 400 }); ``` -------------------------------- ### Initialize Dialog with resizeStart Event Option Source: https://github.com/sefaria/sefaria-project/blob/master/static/js/lib/jquery-ui/development-bundle/docs/dialog.html Provides an example of initializing a dialog and setting a callback for the resizeStart event. ```javascript $( ".selector" ).dialog({ resizeStart: function(event, ui) { ... } }); ``` -------------------------------- ### Initialize Dialog with show Option Source: https://github.com/sefaria/sefaria-project/blob/master/static/js/lib/jquery-ui/development-bundle/docs/dialog.html Example of initializing a dialog and setting the show option to 'slide'. ```javascript $( ".selector" ).dialog({ show: 'slide' }); ``` -------------------------------- ### Handle resizestart Event with Initialization Option Source: https://github.com/sefaria/sefaria-project/blob/master/static/js/lib/jquery-ui/development-bundle/docs/resizable.html Supply a callback function to handle the 'start' event when initializing the resizable widget. ```javascript $( ".selector" ).resizable({ start: function(event, ui) { ... } }); ``` -------------------------------- ### Progressbar Initialization and Options Source: https://github.com/sefaria/sefaria-project/blob/master/static/js/lib/jquery-ui/development-bundle/docs/progressbar.html Demonstrates how to initialize the progressbar widget with various options and how to get or set these options after initialization. ```APIDOC ## Initialize Progressbar ### Description Initializes the progressbar widget on a selected element. ### Method JavaScript ### Endpoint N/A (Widget Initialization) ### Parameters #### Options - **value** (Number) - Optional - The value of the progressbar. Defaults to 0. - **disabled** (Boolean) - Optional - Disables (true) or enables (false) the progressbar. Defaults to false. ### Request Example ```javascript $( "#progressbar" ).progressbar({ value: 37 }); $( ".selector" ).progressbar({ disabled: true }); ``` ## Progressbar Options ### Description Allows getting or setting individual or multiple options for the progressbar widget after initialization. ### Method JavaScript ### Endpoint N/A (Widget Method) ### Parameters #### Option Name and Value - **optionName** (String) - The name of the option to get or set. - **value** (Any) - Optional - The new value for the option. If omitted, acts as a getter. #### Options Object - **options** (Object) - An object containing key/value pairs of options to set. ### Request Example ```javascript // Getter for 'value' option var currentValue = $( ".selector" ).progressbar( "option", "value" ); // Setter for 'value' option $( ".selector" ).progressbar( "option", "value", 37 ); // Setter for multiple options $( ".selector" ).progressbar( "option", { value: 50, disabled: false } ); ``` ``` -------------------------------- ### Full HTML Example for Buttonset Source: https://github.com/sefaria/sefaria-project/blob/master/static/js/lib/jquery-ui/development-bundle/docs/button.html A complete HTML document demonstrating the initialization of a jQuery UI Buttonset for a group of radio buttons. Includes necessary CSS and JavaScript includes. ```html
``` -------------------------------- ### Get or Set Slider Value Source: https://github.com/sefaria/sefaria-project/blob/master/static/js/lib/jquery-ui/development-bundle/docs/slider.html Gets or sets the value of the slider for single-handle sliders. ```javascript .slider( "value" , [value] ) ``` -------------------------------- ### Bind to Slider Start Event Source: https://github.com/sefaria/sefaria-project/blob/master/static/js/lib/jquery-ui/development-bundle/docs/slider.html Bind to the 'slidestart' event by type to handle the start of a slide. ```javascript $( ".selector" ).bind( "slidestart", function(event, ui) { ... }); ``` -------------------------------- ### Full HTML Example with Draggable Initialization Source: https://github.com/sefaria/sefaria-project/blob/master/static/js/lib/jquery-ui/development-bundle/docs/draggable.html A complete HTML document demonstrating the initialization of a draggable element. Includes necessary jQuery and jQuery UI CSS and JS files. ```html
Drag me
``` -------------------------------- ### Get or Set buttonImageOnly Option Source: https://github.com/sefaria/sefaria-project/blob/master/static/js/lib/jquery-ui/development-bundle/docs/datepicker.html Shows how to get the current `buttonImageOnly` setting or update it dynamically. ```javascript //getter var buttonImageOnly = $( ".selector" ).datepicker( "option", "buttonImageOnly" ); //setter $( ".selector" ).datepicker( "option", "buttonImageOnly", true ); ``` -------------------------------- ### Full HTML Example with Selectable Source: https://github.com/sefaria/sefaria-project/blob/master/static/js/lib/jquery-ui/development-bundle/docs/selectable.html A complete HTML document demonstrating the jQuery UI Selectable plugin with basic styling for selected and selecting elements. ```html ``` -------------------------------- ### Full HTML Example for Resizable Source: https://github.com/sefaria/sefaria-project/blob/master/static/js/lib/jquery-ui/development-bundle/docs/resizable.html A complete HTML document demonstrating the jQuery UI Resizable plugin. It includes necessary CSS and JavaScript includes, along with basic styling and initialization. ```html
``` -------------------------------- ### Get or Set autoSize Option Source: https://github.com/sefaria/sefaria-project/blob/master/static/js/lib/jquery-ui/development-bundle/docs/datepicker.html Shows how to get the current `autoSize` setting or update it after initialization. ```javascript //getter var autoSize = $( ".selector" ).datepicker( "option", "autoSize" ); //setter $( ".selector" ).datepicker( "option", "autoSize", true ); ``` -------------------------------- ### Full HTML Example for Basic Button Source: https://github.com/sefaria/sefaria-project/blob/master/static/js/lib/jquery-ui/development-bundle/docs/button.html A complete HTML document demonstrating the initialization of a basic jQuery UI Button. Includes necessary CSS and JavaScript includes. ```html ``` -------------------------------- ### GET /related Source: https://github.com/sefaria/sefaria-project/blob/master/static/llms.txt Get all content (links, sheets, notes, media, topics) related to a Ref. ```APIDOC ## GET /related ### Description Get all content (links, sheets, notes, media, topics) related to a Ref. ### Method GET ### Endpoint /related ### Parameters #### Query Parameters - **ref** (string) - Required - The reference string (e.g., "Genesis 1:1"). ### Response #### Success Response (200) - **links** (array) - List of related links. - **sheets** (array) - List of related source sheets. - **notes** (array) - List of related notes. - **media** (array) - List of related media. - **topics** (array) - List of related topics. #### Response Example { "links": [...], "sheets": [...], "notes": [...], "media": [...], "topics": [...] } ``` -------------------------------- ### Get and Set position Option Source: https://github.com/sefaria/sefaria-project/blob/master/static/js/lib/jquery-ui/development-bundle/docs/dialog.html Shows how to get the current position setting and update it for a dialog. ```javascript //getter var position = $( ".selector" ).dialog( "option", "position" ); //setter $( ".selector" ).dialog( "option", "position", 'top' ); ``` -------------------------------- ### Initialize Dialog with title Option Source: https://github.com/sefaria/sefaria-project/blob/master/static/js/lib/jquery-ui/development-bundle/docs/dialog.html Example of initializing a dialog and setting the title option. ```javascript $( ".selector" ).dialog({ title: 'Dialog Title' }); ``` -------------------------------- ### Basic Positioning Examples Source: https://github.com/sefaria/sefaria-project/blob/master/static/js/lib/jquery-ui/development-bundle/docs/position.html Demonstrates positioning elements relative to a target element using different alignment options. ```javascript $("#position1").position({ my: "center", at: "center", of: "#targetElement" }); $("#position2").position({ my: "left top", at: "left top", of: "#targetElement" }); $("#position3").position({ my: "right center", at: "right bottom", of: "#targetElement" }); ``` -------------------------------- ### Get or Set duration Option Source: https://github.com/sefaria/sefaria-project/blob/master/static/js/lib/jquery-ui/development-bundle/docs/datepicker.html Shows how to get or set the duration option for an existing datepicker instance. ```javascript //getter var duration = $( ".selector" ).datepicker( "option", "duration" ); //setter $( ".selector" ).datepicker( "option", "duration", 'slow' ); ``` -------------------------------- ### Initialize Dialog with width Option Source: https://github.com/sefaria/sefaria-project/blob/master/static/js/lib/jquery-ui/development-bundle/docs/dialog.html Example of initializing a dialog and setting the width option. ```javascript $( ".selector" ).dialog({ width: 460 }); ``` -------------------------------- ### Get or Set dayNamesShort Option Source: https://github.com/sefaria/sefaria-project/blob/master/static/js/lib/jquery-ui/development-bundle/docs/datepicker.html Shows how to get or set the dayNamesShort option for an existing datepicker instance. ```javascript //getter var dayNamesShort = $( ".selector" ).datepicker( "option", "dayNamesShort" ); //setter $( ".selector" ).datepicker( "option", "dayNamesShort", ['Dim', 'Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam'] ); ``` -------------------------------- ### Get or Set dayNames Option Source: https://github.com/sefaria/sefaria-project/blob/master/static/js/lib/jquery-ui/development-bundle/docs/datepicker.html Shows how to get or set the dayNames option for an existing datepicker instance. ```javascript //getter var dayNames = $( ".selector" ).datepicker( "option", "dayNames" ); //setter $( ".selector" ).datepicker( "option", "dayNames", ['Dimanche', 'Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi'] ); ``` -------------------------------- ### Get or Set altFormat Option Source: https://github.com/sefaria/sefaria-project/blob/master/static/js/lib/jquery-ui/development-bundle/docs/datepicker.html Shows how to get the current `altFormat` setting or update it after the datepicker is active. ```javascript //getter var altFormat = $( ".selector" ).datepicker( "option", "altFormat" ); //setter $( ".selector" ).datepicker( "option", "altFormat", 'yy-mm-dd' ); ``` -------------------------------- ### Full HTML Example with switchClass Source: https://github.com/sefaria/sefaria-project/blob/master/static/js/lib/jquery-ui/development-bundle/docs/switchClass.html A complete HTML document demonstrating the switchClass functionality. It includes necessary jQuery and jQuery UI imports, CSS for styling, and a script to switch classes on paragraph clicks. ```html

Click to switch

to blue

on these

paragraphs

``` -------------------------------- ### Get and Set title Option Source: https://github.com/sefaria/sefaria-project/blob/master/static/js/lib/jquery-ui/development-bundle/docs/dialog.html Shows how to get the current title and set a new title for a dialog. ```javascript //getter var title = $( ".selector" ).dialog( "option", "title" ); //setter $( ".selector" ).dialog( "option", "title", 'Dialog Title' ); ``` -------------------------------- ### Initialize Dialog with focus Event Option Source: https://github.com/sefaria/sefaria-project/blob/master/static/js/lib/jquery-ui/development-bundle/docs/dialog.html Provides an example of initializing a dialog and setting a callback for the focus event. ```javascript $( ".selector" ).dialog({ focus: function(event, ui) { ... } }); ``` -------------------------------- ### Get and Set showCurrentAtPos Option Source: https://github.com/sefaria/sefaria-project/blob/master/static/js/lib/jquery-ui/development-bundle/docs/datepicker.html Shows how to get the current value of 'showCurrentAtPos' and how to update it with a new numeric value. ```javascript //getter var showCurrentAtPos = $( ".selector" ).datepicker( "option", "showCurrentAtPos" ); //setter $( ".selector" ).datepicker( "option", "showCurrentAtPos", 3 ); ``` -------------------------------- ### Initialize Dialog with dragStart Event Option Source: https://github.com/sefaria/sefaria-project/blob/master/static/js/lib/jquery-ui/development-bundle/docs/dialog.html Shows how to initialize a dialog and specify a callback function for the dragStart event. ```javascript $( ".selector" ).dialog({ dragStart: function(event, ui) { ... } }); ``` -------------------------------- ### Get or Set Cancel Option Source: https://github.com/sefaria/sefaria-project/blob/master/static/js/lib/jquery-ui/development-bundle/docs/sortable.html Shows how to get the current `cancel` option and set it to 'button' for a sortable instance. ```javascript //getter var cancel = $( ".selector" ).sortable( "option", "cancel" ); //setter $( ".selector" ).sortable( "option", "cancel", 'button' ); ``` -------------------------------- ### Initialize Dialog with modal Option Source: https://github.com/sefaria/sefaria-project/blob/master/static/js/lib/jquery-ui/development-bundle/docs/dialog.html Example of initializing a dialog and setting the modal option to true. ```javascript $( ".selector" ).dialog({ modal: true }); ``` -------------------------------- ### Initialize Dialog with position Option Source: https://github.com/sefaria/sefaria-project/blob/master/static/js/lib/jquery-ui/development-bundle/docs/dialog.html Example of initializing a dialog and setting the position option to 'top'. ```javascript $( ".selector" ).dialog({ position: 'top' }); ``` -------------------------------- ### Get and Set show Option Source: https://github.com/sefaria/sefaria-project/blob/master/static/js/lib/jquery-ui/development-bundle/docs/dialog.html Shows how to get the current show effect and set a new one for a dialog. ```javascript //getter var show = $( ".selector" ).dialog( "option", "show" ); //setter $( ".selector" ).dialog( "option", "show", 'slide' ); ``` -------------------------------- ### Get and Set minWidth Option Source: https://github.com/sefaria/sefaria-project/blob/master/static/js/lib/jquery-ui/development-bundle/docs/dialog.html Shows how to get the current minWidth and set a new minWidth for an existing dialog. ```javascript //getter var minWidth = $( ".selector" ).dialog( "option", "minWidth" ); //setter $( ".selector" ).dialog( "option", "minWidth", 400 ); ``` -------------------------------- ### Initialize Dialog with open Event Option Source: https://github.com/sefaria/sefaria-project/blob/master/static/js/lib/jquery-ui/development-bundle/docs/dialog.html Shows how to initialize a dialog and specify a callback function for the open event. ```javascript $( ".selector" ).dialog({ open: function(event, ui) { ... } }); ``` -------------------------------- ### Get or Set Slider Values Source: https://github.com/sefaria/sefaria-project/blob/master/static/js/lib/jquery-ui/development-bundle/docs/slider.html Gets or sets the values for multiple-handle or range sliders, specifying the index of the handle. ```javascript .slider( "values" , index , [value] ) ``` -------------------------------- ### Handle start Event with Init Option Source: https://github.com/sefaria/sefaria-project/blob/master/static/js/lib/jquery-ui/development-bundle/docs/sortable.html Provides a callback function to execute when sorting begins. This is specified directly within the sortable initialization options. ```javascript $( ".selector" ).sortable({ start: function(event, ui) { ... } }); ``` -------------------------------- ### Get or Set Progressbar Value Source: https://github.com/sefaria/sefaria-project/blob/master/static/js/lib/jquery-ui/development-bundle/docs/progressbar.html This method allows getting the current value of the progressbar or setting a new value. ```javascript .progressbar( "value" , [value] ) ``` -------------------------------- ### Example WebSite Database Entry Source: https://github.com/sefaria/sefaria-project/wiki/Adding-WebSites Illustrates the structure of a WebSite object as stored in the database, showing all attributes and their typical values. ```json { "name" : "Torah In Motion", "domains" : [ "torahinmotion.org", "torahinmotionorg.e.civicrm.ca" ], "is_whitelisted" : true, "bad_urls" : [ "torahinmotionorg\.e\.civicrm\.ca\/store" ], "normalization_rules" : [ "remove www" ], "title_branding" : [ "TORAH IN MOTION" ], "initial_title_branding" : true, } ``` -------------------------------- ### Initialize Dialog with resize Event Option Source: https://github.com/sefaria/sefaria-project/blob/master/static/js/lib/jquery-ui/development-bundle/docs/dialog.html Shows how to initialize a dialog and specify a callback function for the resize event. ```javascript $( ".selector" ).dialog({ resize: function(event, ui) { ... } }); ``` -------------------------------- ### Resizable with Delay Start Source: https://github.com/sefaria/sefaria-project/blob/master/static/js/lib/jquery-ui/development-bundle/demos/resizable/delay-start.html Initializes a resizable element with a 1000ms delay before resizing can start. This is useful for preventing accidental resizing. ```javascript $(function() { $( "#resizable" ).resizable({ delay: 1000 }); }); ``` -------------------------------- ### Initialize Dialog with beforeClose Event Option Source: https://github.com/sefaria/sefaria-project/blob/master/static/js/lib/jquery-ui/development-bundle/docs/dialog.html Provides an example of initializing a dialog and supplying a callback function for the beforeClose event. ```javascript $( ".selector" ).dialog({ beforeClose: function(event, ui) { ... } }); ``` -------------------------------- ### Get and Set showAnim Option Source: https://github.com/sefaria/sefaria-project/blob/master/static/js/lib/jquery-ui/development-bundle/docs/datepicker.html Shows how to get the current animation effect for the datepicker and how to set it to a different animation string. ```javascript //getter var showAnim = $( ".selector" ).datepicker( "option", "showAnim" ); //setter $( ".selector" ).datepicker( "option", "showAnim", 'fold' ); ``` -------------------------------- ### Initialize Dialog with drag Event Option Source: https://github.com/sefaria/sefaria-project/blob/master/static/js/lib/jquery-ui/development-bundle/docs/dialog.html Provides an example of initializing a dialog and setting a callback for the drag event. ```javascript $( ".selector" ).dialog({ drag: function(event, ui) { ... } }); ``` -------------------------------- ### Get or Set calculateWeek Option Source: https://github.com/sefaria/sefaria-project/blob/master/static/js/lib/jquery-ui/development-bundle/docs/datepicker.html Illustrates how to get the current 'calculateWeek' function or assign a new one after the datepicker is active. ```javascript //getter var calculateWeek = $( ".selector" ).datepicker( "option", "calculateWeek" ); //setter $( ".selector" ).datepicker( "option", "calculateWeek", myWeekCalc ); ``` -------------------------------- ### Initial Image Positioning and Setup Source: https://github.com/sefaria/sefaria-project/blob/master/static/js/lib/jquery-ui/development-bundle/demos/position/cycler.html Sets the initial positions for the images and configures the container and images for absolute positioning. This prepares the elements for the cycling and animation effects. ```javascript $( "img:eq(0)" ).left(); $( "img:eq(1)" ).center(); $( "img:eq(2)" ).right(); $( "body" ).css({ overflow: "hidden" }) $( ".demo" ).css({ position: "relative", }); $( ".demo img" ).css({ position: "absolute", }); ``` -------------------------------- ### Get and Set Draggable refreshPositions Option Source: https://github.com/sefaria/sefaria-project/blob/master/static/js/lib/jquery-ui/development-bundle/docs/draggable.html Shows how to get the current refreshPositions setting and how to set it to true for a draggable element. ```javascript //getter var refreshPositions = $( ".selector" ).draggable( "option", "refreshPositions" ); //setter $( ".selector" ).draggable( "option", "refreshPositions", true ); ``` -------------------------------- ### Initialize Dialog with resizable Option Source: https://github.com/sefaria/sefaria-project/blob/master/static/js/lib/jquery-ui/development-bundle/docs/dialog.html Example of initializing a dialog and setting the resizable option to false. ```javascript $( ".selector" ).dialog({ resizable: false }); ``` -------------------------------- ### Start Sefaria CLI with iPython Source: https://github.com/sefaria/sefaria-project/wiki/Command-Line-Interface Launches the Sefaria CLI within an iPython interactive session. This is useful for enhanced interactive development and requires the script to be run from the Sefaria-Project root directory. ```shell ./cli -i ``` -------------------------------- ### Get and Set Draggable iframeFix Option Source: https://github.com/sefaria/sefaria-project/blob/master/static/js/lib/jquery-ui/development-bundle/docs/draggable.html Shows how to get the current iframeFix setting and how to set it to true for a draggable element. ```javascript //getter var iframeFix = $( ".selector" ).draggable( "option", "iframeFix" ); //setter $( ".selector" ).draggable( "option", "iframeFix", true ); ``` -------------------------------- ### Get or Set Single Progressbar Option Source: https://github.com/sefaria/sefaria-project/blob/master/static/js/lib/jquery-ui/development-bundle/docs/progressbar.html Demonstrates how to get the value of a specific progressbar option or set a new value for it. ```javascript .progressbar( "option" , optionName , [value] ) ```