### 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. ```htmlMauris 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.
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.
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.
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.
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] ) ```