### Initialize PDF Viewer Options (JavaScript) Source: https://www.truenas.com/managed-service-provider This JavaScript code initializes options for a PDF viewer, likely for displaying documents like datasheets and guides. It configures settings such as outline generation, thumbnail display, and PDF source. ```javascript var option_df_108634 = {"outline":[],"forceFit":"true","autoEnableOutline":"false","autoEnableThumbnail":"false","overwritePDFOutline":"false","direction":"1","pageSize":"0","source":"https:\/\/www.truenas.com\/wp-content\/uploads\/2025\/03\/TrueNAS_Appliance_Portfolio_March_2025.pdf","wpOptions":"true"}; if(window.DFLIP && DFLIP.parseBooks){DFLIP.parseBooks();} ``` ```javascript var option_df_85947 = {"outline":[],"forceFit":"true","autoEnableOutline":"false","autoEnableThumbnail":"false","overwritePDFOutline":"false","direction":"1","pageSize":"0","source":"https:\/\/www.truenas.com\/wp-content\/uploads\/2023\/09\/SCALE_Evaluation_Guide_September_2023.pdf","wpOptions":"true"}; if(window.DFLIP && DFLIP.parseBooks){DFLIP.parseBooks();} ``` ```javascript var option_df_85941 = {"outline":[],"forceFit":"true","autoEnableOutline":"false","autoEnableThumbnail":"false","overwritePDFOutline":"false","direction":"1","pageSize":"0","source":"https:\/\/www.truenas.com\/wp-content\/uploads\/2023\/05\/TrueCommand_2.3_White_Paper_May_2023.pdf","wpOptions":"true"}; if(window.DFLIP && DFLIP.parseBooks){DFLIP.parseBooks();} ``` -------------------------------- ### Initialize PDF Viewer Options (JavaScript) Source: https://www.truenas.com/r-series Configures options for DFLIP PDF viewer, including outline, fit, and source path. This script is intended to be run in a browser environment where DFLIP is available. ```javascript var option_df_72080 = {"outline":[],"forceFit":"true","autoEnableOutline":"false","autoEnableThumbnail":"false","overwritePDFOutline":"false","direction":"1","pageSize":"0","source":"https:\/\/www.truenas.com\/wp-content\/uploads\/2021\/05\/iXsystems_CalTech_Case_Study_WEB_May_2021.pdf","wpOptions":"true"}; if(window.DFLIP && DFLIP.parseBooks){DFLIP.parseBooks();} ``` ```javascript var option_df_73016 = {"outline":[],"forceFit":"true","autoEnableOutline":"false","autoEnableThumbnail":"false","overwritePDFOutline":"false","direction":"1","pageSize":"0","source":"https:\/\/www.truenas.com\/wp-content\/uploads\/2021\/08\/iXsystems_Cambridge_University_Case_Study_August_2021.pdf","wpOptions":"true"}; if(window.DFLIP && DFLIP.parseBooks){DFLIP.parseBooks();} ``` -------------------------------- ### Configure NAS Bridge Interface for VMs and Containers (Linux/Windows Examples) Source: https://www.truenas.com/docs/scale Instructions on creating a bridge interface for virtual machines or applications to access the NAS. Includes examples for both Linux and Windows environments. ```bash # Linux Example: # Assuming 'eth0' is your primary network interface # Create a bridge interface 'br0' ip link add name br0 type bridge ip link set br0 up # Add 'eth0' to the bridge ip link set eth0 master br0 # Assign an IP address to the bridge (replace with your network details) ip addr add 192.168.1.100/24 dev br0 # Configure DNS and Gateway as needed ``` ```powershell # Windows Example: # Get the network adapter to use for the bridge $netAdapter = Get-NetAdapter -Name "Ethernet" # Create a new virtual network adapter for the bridge New-NetVirtualAdapter -Name "BridgeAdapter" -InterfaceDescription $netAdapter.InterfaceDescription # Get the newly created bridge adapter $bridgeAdapter = Get-NetAdapter -Name "BridgeAdapter" # Create the bridge New-NetBridge -Name "MyBridge" -InterfaceIndex $bridgeAdapter.InterfaceIndex # Add the physical adapter to the bridge Add-NetBridgeNic -BridgeName "MyBridge" -InterfaceAlias $netAdapter.Name # Assign an IP address to the bridge (replace with your network details) New-NetIPAddress -InterfaceAlias "MyBridge" -IPAddress "192.168.1.100" -PrefixLength 24 -DefaultGateway "192.168.1.1" ``` -------------------------------- ### JavaScript for DFLIP Book Initialization Source: https://www.truenas.com/virtualization These JavaScript snippets initialize DFLIP books, likely for displaying PDF documents like case studies and white papers. They configure options such as outline, fit, direction, and source PDF location. The `DFLIP.parseBooks()` function is called to render the books. ```javascript var option_df_71858 = {"outline":[],"forceFit":"true","autoEnableOutline":"false","autoEnableThumbnail":"false","overwritePDFOutline":"false","direction":"1","pageSize":"0","source":"https:\/\/www.truenas.com\/wp-content\/uploads\/2021\/05\/IT_Worldwide_Case_Study_WEB.pdf","wpOptions":"true"}; if(window.DFLIP && DFLIP.parseBooks){DFLIP.parseBooks();} ``` ```javascript var option_df_71859 = {"outline":[],"forceFit":"true","autoEnableOutline":"false","autoEnableThumbnail":"false","overwritePDFOutline":"false","direction":"1","pageSize":"0","source":"https:\/\/www.truenas.com\/wp-content\/uploads\/2022\/05\/Nevada_Department_of_Corrections_Case_Study_2022.pdf","wpOptions":"true"}; if(window.DFLIP && DFLIP.parseBooks){DFLIP.parseBooks();} ``` ```javascript var option_df_71860 = {"outline":[],"forceFit":"true","autoEnableOutline":"false","autoEnableThumbnail":"false","overwritePDFOutline":"false","direction":"1","pageSize":"0","source":"https:\/\/www.truenas.com\/wp-content\/uploads\/2021\/05\/ISC_org_CaseStudy_WEB.pdf","wpOptions":"true"}; if(window.DFLIP && DFLIP.parseBooks){DFLIP.parseBooks();} ``` ```javascript var option_df_71898 = {"outline":[],"forceFit":"true","autoEnableOutline":"false","autoEnableThumbnail":"false","overwritePDFOutline":"false","direction":"1","pageSize":"0","source":"https:\/\/www.truenas.com\/wp-content\/uploads\/2023\/05\/TrueNAS_for_VMware_White_Paper_May_2023.pdf","wpOptions":"true"}; if(window.DFLIP && DFLIP.parseBooks){DFLIP.parseBooks();} ``` ```javascript var option_df_80240 = {"outline":[],"forceFit":"true","autoEnableOutline":"false","autoEnableThumbnail":"false","overwritePDFOutline":"false","direction":"1","pageSize":"0","source":"https:\/\/www.truenas.com\/wp-content\/uploads\/2022\/05\/TrueNAS_Virtualization_for_VMware_Datasheet_2022.pdf","wpOptions":"true"}; if(window.DFLIP && DFLIP.parseBooks){DFLIP.parseBooks();} ``` -------------------------------- ### Integrate TrueNAS 'Get a Quote' Form with JavaScript Source: https://www.truenas.com/media-creation This JavaScript code configures and creates a 'Get a Quote' form using HubSpot's form integration. It defines options for UTM tracking, extra form fields like domain and use case, and pop-up behavior. The function `hbspt.forms.create` is used to render the form, with callbacks for `onFormReady`, `onFormSubmit`, and `onFormSubmitted`. ```javascript var ixhsOptionsQt = { "includeUTM": true, "includeExtras": true, "extras": [ {"enabled": false, "name": "form_model", "value": ""}, {"enabled": true, "name": "form_domain", "value": "truenas.com"}, {"enabled": true, "name": "form_location", "value": "null"}, {"enabled": true, "name": "form_use_case", "value": "M&E Overview"} ], "popUp": true, "popUpTriggerClass": ".quote-pop-up", "popUpElementClass": ".ixhs-pop-up-quote", "hideAfterSubmit": ".ixhs-hide" } hbspt.forms.create({ portalId: "6502416", formId: "f71e6c91-e849-4ff6-afdd-054c32a54b31", onFormReady: function($form) { ixtegrateFormOnReady($form, ixhsOptionsQt); }, onFormSubmit: function($form) { ixtegrateFormOnSubmit($form, ixhsOptionsQt); }, onFormSubmitted: function($form) { ixtegrateFormOnSubmitted($form, ixhsOptionsQt); } }); ``` -------------------------------- ### Initialize Product and Version Dropdowns (JavaScript) Source: https://www.truenas.com/docs/core Initializes the product and version dropdowns based on the selected product. It sets the initial text for buttons, populates version lists, and handles specific cases for 'TrueNAS Systems', 'TrueNAS', and 'TrueCommand' products. Dependencies include DOM manipulation and basic string operations. ```javascript function yId(e){return document.getElementById(e)} var n=yId("versionButton"),t=yId("versionDropdown"); if(n.innerHTML='Version ',n.dataset.versionId="",s.innerHTML=e+' ',s.dataset.productId=e.toLowerCase().replace(/\s/g,""),o=document.getElementById("docsnav-intro"),o.textContent="Product and Version:",e==="TrueNAS Systems"){ window.location.href="https://www.truenas.com/docs/hardware"; return } n.disabled=!1,t.style.display="none",t.innerHTML="",e==="TrueNAS"?(t.innerHTML=`
Next
26.04
25.10
Current
25.04
Previous
24.10
13.0

Archive
`):e==="TrueCommand"&&(t.innerHTML=`
3.0
Archive
`),t.style.display="block",i=document.getElementById("productDropdown"),i.style.display="none"} ``` -------------------------------- ### Integrate TrueNAS 'Get Expert' Form with JavaScript Source: https://www.truenas.com/media-creation This JavaScript code configures and creates a 'Get Expert' form using HubSpot's form integration. It includes settings for UTM tracking, additional fields such as domain and use case, and pop-up window configurations. The `hbspt.forms.create` function is utilized for form rendering, with event handlers for form readiness, submission, and post-submission. ```javascript var ixhsOptionsEx = { "includeUTM": true, "includeExtras": true, "extras": [ {"enabled": false, "name": "form_model", "value": ""}, {"enabled": true, "name": "form_domain", "value": "truenas.com"}, {"enabled": true, "name": "form_location", "value": "null"}, {"enabled": true, "name": "form_use_case", "value": "Media and Entertainment"} ], "popUp": true, "popUpTriggerClass": ".expert-pop-up", "popUpElementClass": ".ixhs-pop-up-expert", "hideAfterSubmit": ".ixhs-hide" } hbspt.forms.create({ portalId: "6502416", formId: "a22c0f41-7467-47c5-bb42-1059479400ef", onFormReady: function($form) { ixtegrateFormOnReady($form, ixhsOptionsEx); }, onFormSubmit: function($form) { ixtegrateFormOnSubmit($form, ixhsOptionsEx); }, onFormSubmitted: function($form) { ixtegrateFormOnSubmitted($form, ixhsOptionsEx); } }); ``` -------------------------------- ### Initialize Divi Theme and Builder Utilities Source: https://www.truenas.com/faq This JavaScript code initializes global variables and configurations for the Divi theme and its page builder. It sets up parameters for conditional loading, scroll locations, AJAX URLs, and various user interface elements, enabling dynamic content and theme functionality. ```javascript var DIVI = {"item_count":"%d Item","items_count":"%d Items"}; var et_builder_utils_params = {"condition":{"diviTheme":true,"extraTheme":false},"scrollLocations":["app","top"],"builderScrollLocations":{"desktop":"app","tablet":"app","phone":"app"},"onloadScrollLocation":"app","builderType":"fe"}; var et_frontend_scripts = {"builderCssContainerPrefix":"#et-boc","builderCssLayoutPrefix":"#et-boc .et-l"}; var et_pb_custom = {"ajaxurl":"https:\/\/www.truenas.com\/wp-admin\/admin-ajax.php","images_uri":"https:\/\/www.truenas.com\/wp-content\/themes\/Divi\/images","builder_images_uri":"https:\/\/www.truenas.com\/wp-content\/themes\/Divi\/includes\/builder\/images","et_frontend_nonce":"2d23a2d866","subscription_failed":"Please, check the fields below to make sure you entered the correct information.","et_ab_log_nonce":"9d731146d7","fill_message":"Please, fill in the following fields:","contact_error_message":"Please, fix the following errors:","invalid":"Invalid email","captcha":"Captcha","prev":"Prev","previous":"Previous","next":"Next","wrong_captcha":"You entered the wrong number in captcha.","wrong_checkbox":"Checkbox","ignore_waypoints":"no","is_divi_theme_used":"1","widget_search_selector":".widget_search","ab_tests":[],"is_ab_testing_active":"","page_id":"80488","unique_test_id":"","ab_bounce_rate":"5","is_cache_plugin_active":"no","is_shortcode_tracking":"","tinymce_uri":"https:\/\/www.truenas.com\/wp-content\/themes\/Divi\/includes\/builder\/frontend-builder\/assets\/vendors","accent_color":"#0095d5","waypoints_options":[]}; var et_pb_box_shadow_elements = []; ``` -------------------------------- ### Podcast Link Source: https://www.truenas.com/blog/truenas-h30-nab-2025-award-winner This HTML snippet links to the TrueNAS podcast. It includes an icon and descriptive text to guide users to the podcast page. ```html Podcast Icon Listen to our Podcast ``` -------------------------------- ### Postcode Field Hint (CSS) Source: https://www.truenas.com/terms This CSS adds a pseudo-element before the postcode input field to display a hint message in red, guiding the user. ```css #calc_shipping_postcode_field::before { content: "Enter your Post / Zip Code for a best estimate."; color: red; font-size: 75%; } ``` -------------------------------- ### Initialize PDF Viewer Options Source: https://www.truenas.com/m-series Initializes options for a PDF viewer, likely for displaying a case study. It sets properties like outline, fit, direction, and the source PDF URL. This code assumes the presence of a DFLIP JavaScript library. ```javascript var option_df_73016 = {"outline":[],"forceFit":"true","autoEnableOutline":"false","autoEnableThumbnail":"false","overwritePDFOutline":"false","direction":"1","pageSize":"0","source":"https:\/\/www.truenas.com\/wp-content\/uploads\/2021\/08\/iXsystems_Cambridge_University_Case_Study_August_2021.pdf","wpOptions":"true"}; if(window.DFLIP && DFLIP.parseBooks){DFLIP.parseBooks();} ``` -------------------------------- ### Get Current Path (JavaScript) Source: https://www.truenas.com/docs/truecommand Retrieves the current URL path of the browser window and removes the '/docs/' prefix if present. This function is used to determine the current documentation context for navigation updates. ```javascript function getCurrentPath(){ return window.location.pathname; } path.startsWith("/docs/")&&(path=path.substring(6)) ``` -------------------------------- ### dFlip PDF Viewer Configuration and Loading Animation Source: https://www.truenas.com/h-series JavaScript code for configuring the dFlip PDF viewer, including setting global options for text, controls, and appearance. It also includes a loading skeleton animation that is displayed until the page is fully loaded. ```javascript var dFlipLocation = "https://www.truenas.com/wp-content/plugins/dflip/assets/"; var dFlipWPGlobal = {"text":{"toggleSound":"Turn on\/off Sound","toggleThumbnails":"Toggle Thumbnails","toggleOutline":"Toggle Outline\/Bookmark","previousPage":"Previous Page","nextPage":"Next Page","toggleFullscreen":"Toggle Fullscreen","zoomIn":"Zoom In","zoomOut":"Zoom Out","toggleHelp":"Toggle Help","singlePageMode":"Single Page Mode","doublePageMode":"Double Page Mode","downloadPDFFile":"Download PDF File","gotoFirstPage":"Goto First Page","gotoLastPage":"Goto Last Page","share":"Share","mailSubject":"I wanted you to see this FlipBook","mailBody":"Check out this site {{url}}","loading":"Loading"},"moreControls":"download,pageMode,startPage,endPage,sound","hideControls":"","scrollWheel":"true","backgroundColor":"#AEADAE","backgroundImage":"","height":"240","paddingLeft":"20","paddingRight":"20","controlsPosition":"bottom","duration":"800","soundEnable":"false","enableDownload":"true","enableAnalytics":"true","webgl":"true","hard":"none","maxTextureSize":"1600","rangeChunkSize":"524288","zoomRatio":"1.5","stiffness":"3","pageMode":"0","singlePageMode":"0","pageSize":"0","autoPlay":"false","autoPlayDuration":"5000","autoPlayStart":"false","linkTarget":"2","sharePrefix":"TrueNAS-PDF-,flipbook-"}; // Add skeletal class to body const isElementLoaded = async selector => { while ( document.querySelector(selector) === null) { await new Promise( resolve => requestAnimationFrame(resolve) ) } return document.querySelector(selector); }; // Checking for a specific class, id or element. isElementLoaded('body').then((selector) => { document.body.classList.add('loading-skeleton'); const template = document.createElement('div'); template.style.cssText = 'position:absolute;width:100%;height:100%;z-index:100;background:#FFF;'; template.innerHTML += "
"; template.innerHTML += "
"; template.id = 'loading-block'; document.body.appendChild(template); }); addEventListener("DOMContentLoaded", (event) => { try { var element = document.getElementById("loading-block"); element.parentNode.removeChild(element); document.body.classList.remove('loading-skeleton') } catch (exceptionVar) { console.log("second try"); window.requestAnimationFrame(() => { var element = document.getElementById("loading-block"); element.parentNode.removeChild(element); document.body.classList.remove('loading-skeleton'); }); } }); body.loading-skeleton:not(.et-fb) #page-container * {display:none;} body.et-fb #loading-block {display:none;} ``` -------------------------------- ### Get Search Query Parameter Source: https://www.truenas.com/docs/truecommand This JavaScript function retrieves the value of a specified query parameter from the current URL's search string. It is used to conditionally trigger actions, such as opening a search interface. ```javascript function getSearchQueryParam(e){const t=new URLSearchParams(window.location.search);return t.get(e)} document.addEventListener("DOMContentLoaded",function(){const e=getSearchQueryParam("showsearch");e&&setTimeout(function(){var e=document.getElementById("chatbot-button-icon");e&&e.click()},1e3)}) ``` -------------------------------- ### Initialize Divi Theme Builder Parameters Source: https://www.truenas.com/about-us This JavaScript object initializes parameters for the Divi theme builder, including item counts for cart/checkout and settings for scroll locations and builder behavior. It also includes nonces for AJAX requests and error messages for form validation. ```javascript var DIVI = {"item_count":"%d Item","items_count":"%d Items"}; var et_builder_utils_params = {"condition":{"diviTheme":true,"extraTheme":false},"scrollLocations":["app","top"],"builderScrollLocations":{"desktop":"app","tablet":"app","phone":"app"},"onloadScrollLocation":"app","builderType":"fe"}; var et_frontend_scripts = {"builderCssContainerPrefix":"#et-boc","builderCssLayoutPrefix":"#et-boc .et-l"}; var et_pb_custom = {"ajaxurl":"https:\/\/www.truenas.com\/wp-admin\/admin-ajax.php","images_uri":"https:\/\/www.truenas.com\/wp-content\/themes\/Divi\/images","builder_images_uri":"https:\/\/www.truenas.com\/wp-content\/themes\/Divi\/includes\/builder\/images","et_frontend_nonce":"2d23a2d866","subscription_failed":"Please, check the fields below to make sure you entered the correct information.","et_ab_log_nonce":"9d731146d7","fill_message":"Please, fill in the following fields:","contact_error_message":"Please, fix the following errors:","invalid":"Invalid email","captcha":"Captcha","prev":"Prev","previous":"Previous","next":"Next","wrong_captcha":"You entered the wrong number in captcha.","wrong_checkbox":"Checkbox","ignore_waypoints":"no","is_divi_theme_used":"1","widget_search_selector":".widget_search","ab_tests":[],"is_ab_testing_active":"","page_id":"107909","unique_test_id":"","ab_bounce_rate":"5","is_cache_plugin_active":"no"} ``` -------------------------------- ### dFlip Initialization and Configuration - JavaScript Source: https://www.truenas.com/truenas-enterprise This JavaScript code initializes and configures the dFlip plugin for displaying PDF flipbooks. It defines global settings for text, controls, and appearance, and includes functions to manage the loading and display of flipbook elements. ```javascript var dFlipLocation = "https://www.truenas.com/wp-content/plugins/dflip/assets/"; var dFlipWPGlobal = {"text":{"toggleSound":"Turn on\/off Sound","toggleThumbnails":"Toggle Thumbnails","toggleOutline":"Toggle Outline\/Bookmark","previousPage":"Previous Page","nextPage":"Next Page","toggleFullscreen":"Toggle Fullscreen","zoomIn":"Zoom In","zoomOut":"Zoom Out","toggleHelp":"Toggle Help","singlePageMode":"Single Page Mode","doublePageMode":"Double Page Mode","downloadPDFFile":"Download PDF File","gotoFirstPage":"Goto First Page","gotoLastPage":"Goto Last Page","share":"Share","mailSubject":"I wanted you to see this FlipBook","mailBody":"Check out this site {{url}}","loading":"Loading"},"moreControls":"download,pageMode,startPage,endPage,sound","hideControls":"","scrollWheel":"true","backgroundColor":"#AEADAE","backgroundImage":"","height":"240","paddingLeft":"20","paddingRight":"20","controlsPosition":"bottom","duration":"800","soundEnable":"false","enableDownload":"true","enableAnalytics":"true","webgl":"true","hard":"none","maxTextureSize":"1600","rangeChunkSize":"524288","zoomRatio":"1.5","stiffness":"3","pageMode":"0","singlePageMode":"0","pageSize":"0","autoPlay":"false","autoPlayDuration":"5000","autoPlayStart":"false","linkTarget":"2","sharePrefix":"TrueNAS-PDF-,flipbook-"}; ``` -------------------------------- ### Adjust Padding for Scrolling Sticky Section Source: https://www.truenas.com/truenas-community-edition This CSS reduces the padding of a sticky section when the user starts scrolling, providing a more compact layout. It targets elements following a sticky section with specific classes. ```css .et_builder_inner_content.has_et_pb_sticky ~ * .sticky, .et_builder_inner_content.has_et_pb_sticky .sticky { padding: 20px!important; } ``` -------------------------------- ### Website Resource Prefetching and Prerendering Configuration (JSON) Source: https://www.truenas.com/backup Configures browser prefetching and prerendering for website resources to improve load times. It specifies which documents to prefetch eagerly (e.g., all links except cart/checkout, and specific ixsystems.com links) and which to prerender immediately or moderately (e.g., Truenas-related pages, blog, download pages). ```json { "prefetch":[ { "source":"document", "where":{ "and":[ { "href_matches":"/*"}, { "not": { "href_matches": "/cart/*" } }, { "not": { "href_matches": "/checkout/*" } } ] }, "eagerness":"eager" }, { "source":"document", "where":{ "and":[ { "href_matches":"https://www.ixsystems.com/*"} ] }, "eagerness":"eager" } ], "prerender":[ { "source":"document", "where":{ "or":[ { "href_matches":"/truenas-*" }, { "href_matches":"/blog/" }, { "href_matches":"/*-series/" }, { "href_matches":"/download*" } ] }, "eagerness":"immediate" }, { "source":"document", "where":{ "or":[ { "href_matches":"/blog/*" } ] }, "eagerness":"moderate" } ] } ``` -------------------------------- ### Default and Sticky Section Padding Source: https://www.truenas.com/support/truenas-arrays This CSS defines default padding for elements with the class 'sticky' and adjusts the 'top' property for sticky elements, including specific adjustments when the admin bar is present. It also modifies padding when the user starts scrolling. ```css /* Default padding for the sticky section */ .sticky { padding: 10px; /* or whatever your default padding is */ transition: padding 0.3s ease; /* smooth transition */ top: 64px!important; } .admin-bar .sticky { top: 95px!important; } /* Adjust padding when user starts scrolling */ .et_builder_inner_content.has_et_pb_sticky ~ * .sticky, .et_builder_inner_content.has_et_pb_sticky .sticky { padding: 20px!important; /* reduced padding when scrolling */ } ``` -------------------------------- ### Initialize Divi Theme Builder Utilities (JavaScript) Source: https://www.truenas.com/blog This JavaScript code initializes utility parameters for the Divi theme builder. It sets up configurations related to conditional loading, scroll locations for tracking, and builder-specific settings. It also defines nonces for AJAX requests and stores various theme-related image URIs and settings. ```javascript var DIVI = {"item_count":"%d Item","items_count":"%d Items"}; var et_builder_utils_params = {"condition":{"diviTheme":true,"extraTheme":false},"scrollLocations":["app","top"],"builderScrollLocations":{"desktop":"app","tablet":"app","phone":"app"},"onloadScrollLocation":"app","builderType":"fe"}; var et_frontend_scripts = {"builderCssContainerPrefix":"#et-boc","builderCssLayoutPrefix":"#et-boc .et-l"}; var et_pb_custom = {"ajaxurl":"https:\/\/www.truenas.com\/wp-admin\/admin-ajax.php","images_uri":"https:\/\/www.truenas.com\/wp-content\/themes\/Divi\/images","builder_images_uri":"https:\/\/www.truenas.com\/wp-content\/themes\/Divi\/includes\/builder\/images","et_frontend_nonce":"2d23a2d866","subscription_failed":"Please, check the fields below to make sure you entered the correct information.","et_ab_log_nonce":"9d731146d7","fill_message":"Please, fill in the following fields:","contact_error_message":"Please, fix the following errors:","invalid":"Invalid email","captcha":"Captcha","prev":"Prev","previous":"Previous","next":"Next","wrong_captcha":"You entered the wrong number in captcha.","wrong_checkbox":"Checkbox","ignore_waypoints":"no","is_divi_theme_used":"1","widget_search_selector":".widget_search","ab_tests":[],"is_ab_testing_active":"","page_id":"74014","unique_test_id":"","ab_bounce_rate":"5","is_cache_plugin_active":"no","is_shortcode_tracking":"","tinymce_uri":"https:\/\/www.truenas.com\/wp-content\/themes\/Divi\/includes\/builder\/frontend-builder\/assets\/vendors","accent_color":"#0095d5","waypoints_options":[]}; var et_pb_box_shadow_elements = []; ``` -------------------------------- ### JavaScript: PDF Viewer Initialization Source: https://www.truenas.com/h-series These JavaScript snippets initialize PDF viewers using a DFLIP library. Each snippet defines specific options for a PDF document, including its source URL and display settings, and then calls DFLIP.parseBooks() to render the viewer. ```javascript var option_df_96421 = {"outline":[],"forceFit":"true","autoEnableOutline":"false","autoEnableThumbnail":"false","overwritePDFOutline":"false","direction":"1","pageSize":"0","source":"https:\/\/www.truenas.com\/wp-content\/uploads\/2025\/06\/TrueNAS_H-Series_Data_Sheet_June_2025.pdf","wpOptions":"true"}; if(window.DFLIP && DFLIP.parseBooks){DFLIP.parseBooks();} ``` ```javascript var option_df_108634 = {"outline":[],"forceFit":"true","autoEnableOutline":"false","autoEnableThumbnail":"false","overwritePDFOutline":"false","direction":"1","pageSize":"0","source":"https:\/\/www.truenas.com\/wp-content\/uploads\/2025\/03\/TrueNAS_Appliance_Portfolio_March_2025.pdf","wpOptions":"true"}; if(window.DFLIP && DFLIP.parseBooks){DFLIP.parseBooks();} ``` ```javascript var option_df_70147 = {"outline":[],"forceFit":"true","autoEnableOutline":"false","autoEnableThumbnail":"false","overwritePDFOutline":"false","direction":"1","pageSize":"0","source":"https:\/\/www.truenas.com\/wp-content\/uploads\/2025\/07\/Expansion_Shelves_Data_Sheet_July_2025.pdf","wpOptions":"true"}; if(window.DFLIP && DFLIP.parseBooks){DFLIP.parseBooks();} ``` ```javascript var option_df_80238 = {"outline":[],"forceFit":"true","autoEnableOutline":"false","autoEnableThumbnail":"false","overwritePDFOutline":"false","direction":"1","pageSize":"0","source":"https:\/\/www.truenas.com\/wp-content\/uploads\/2025\/06\/TrueCommand_3.1_White_Paper_June_2025.pdf","wpOptions":"true"}; if(window.DFLIP && DFLIP.parseBooks){DFLIP.parseBooks();} ``` -------------------------------- ### CSS for Section Heading Underline Source: https://www.truenas.com/managed-service-provider This CSS creates a decorative underline for section headings (`h3`) within an overview section (`.overview`). The underline is a gradient starting from white and ending in `#0095d5`, with a width of `250px`, centered below the heading. It also adds bottom margin. ```css .overview .et_pb_blurb_container > h3:after { content: " "; display: block; width: 250px; height: 4px; background: #0095d5; margin: 0 auto 10px; } ``` -------------------------------- ### CSS for Pricing Button Styling Source: https://www.truenas.com/managed-service-provider This CSS defines styles for a 'Get Pricing' button. It sets the background color to white, text transformation to uppercase, and text color to a specific blue using `!important`. This ensures the button stands out and adheres to a defined brand color. ```css .get-quote { background-color: #FFF; text-transform: uppercase; color: #0095D5 !important; } ``` -------------------------------- ### Initialize and Alias jQuery Source: https://www.truenas.com/contact-us This snippet demonstrates the initialization of jQuery and its alias '$'. It sets up an array to store parameters passed to jQuery and defines custom functions for jQuery and '$' to push these parameters into the array. It also includes methods for handling 'noConflict' scenarios and document ready/load events. ```javascript let jqueryParams=[]; let jQuery=function(r){return jqueryParams=[...jqueryParams,r],jQuery}; let $=function(r){return jqueryParams=[...jqueryParams,r],$} ; window.jQuery=jQuery, window.$=jQuery; let customHeadScripts=!1; jQuery.fn=jQuery.prototype={}, $.fn=jQuery.prototype={}; jQuery.noConflict=function(r){if(window.jQuery)return jQuery=window.jQuery,$=window.jQuery,customHeadScripts=!0,jQuery.noConflict} jQuery.ready=function(r){jqueryParams=[...jqueryParams,r]}, $.ready=function(r){jqueryParams=[...jqueryParams,r]}; jQuery.load=function(r){jqueryParams=[...jqueryParams,r]}, $.load=function(r){jqueryParams=[...jqueryParams,r]}; jQuery.fn.ready=function(r){jqueryParams=[...jqueryParams,r]}, $.fn.ready=function(r){jqueryParams=[...jqueryParams,r]} ``` -------------------------------- ### Divi Theme Frontend Script Configuration (JavaScript) Source: https://www.truenas.com/virtualization This JavaScript object, `et_pb_custom`, contains configuration settings for the Divi theme's frontend builder. It includes AJAX URLs, image URIs, nonces for security, various user interface messages, and settings related to A/B testing, caching, and theme usage. ```javascript var et_pb_custom = { "ajaxurl":"https:\/\/www.truenas.com\/wp-admin\/admin-ajax.php", "images_uri":"https:\/\/www.truenas.com\/wp-content\/themes\/Divi\/images", "builder_images_uri":"https:\/\/www.truenas.com\/wp-content\/themes\/Divi\/includes\/builder\/images", "et_frontend_nonce":"2d23a2d866", "subscription_failed":"Please, check the fields below to make sure you entered the correct information.", "et_ab_log_nonce":"9d731146d7", "fill_message":"Please, fill in the following fields:", "contact_error_message":"Please, fix the following errors:", "invalid":"Invalid email", "captcha":"Captcha", "prev":"Prev", "previous":"Previous", "next":"Next", "wrong_captcha":"You entered the wrong number in captcha.", "wrong_checkbox":"Checkbox", "ignore_waypoints":"no", "is_divi_theme_used":"1", "widget_search_selector":".widget_search", "ab_tests":[], "is_ab_testing_active":"", "page_id":"71697", "unique_test_id":"", "ab_bounce_rate":"5", "is_cache_plugin_active":"no", "is_shortcode_tracking":"", "tinymce_uri":"https:\/\/www.truenas.com\/wp-content\/themes\/Divi\/includes\/builder\/frontend-builder\/assets\/vendors", "accent_color":"#0095d5", "waypoints_options":[] }; ``` -------------------------------- ### jQuery and $ Alias Initialization (JavaScript) Source: https://www.truenas.com/faq This JavaScript code initializes jQuery and its alias '$' by storing provided parameters. It also includes methods for handling `noConflict` mode and event-like functions such as `ready` and `load`. This setup is common in older JavaScript projects that rely on jQuery. ```javascript let jqueryParams=[],jQuery=function(r){return jqueryParams=[...jqueryParams,r],jQuery},$=function(r){return jqueryParams=[...jqueryParams,r],$};window.jQuery=jQuery,window.$=jQuery;let customHeadScripts=!1;jQuery.fn=jQuery.prototype={},$.fn=jQuery.prototype={},jQuery.noConflict=function(r){if(window.jQuery)return jQuery=window.jQuery,$=window.jQuery,customHeadScripts=!0,jQuery.noConflict},jQuery.ready=function(r){jqueryParams=[...jqueryParams,r]},$.ready=function(r){jqueryParams=[...jqueryParams,r]},jQuery.load=function(r){jqueryParams=[...jqueryParams,r]},$.load=function(r){jqueryParams=[...jqueryParams,r]},jQuery.fn.ready=function(r){jqueryParams=[...jqueryParams,r]},$.fn.ready=function(r){jqueryParams=[...jqueryParams,r]} ``` -------------------------------- ### Initialize jQuery and Aliases (JavaScript) Source: https://www.truenas.com/file-sharing This JavaScript code initializes variables for jQuery parameters and defines custom functions for jQuery and its alias '$'. It also includes methods for handling 'ready', 'load', and 'noConflict' scenarios. This setup ensures proper jQuery initialization and management within the page. ```javascript let jqueryParams=[]; let jQuery=function(r){return jqueryParams=[...jqueryParams,r],jQuery}; let $=function(r){return jqueryParams=[...jqueryParams,r],$};window.jQuery=jQuery,window.$=jQuery; let customHeadScripts=!1; jQuery.fn=jQuery.prototype={}; $.fn=jQuery.prototype={}; jQuery.noConflict=function(r){if(window.jQuery)return jQuery=window.jQuery,$=window.jQuery,customHeadScripts=!0,jQuery.noConflict}; jQuery.ready=function(r){jqueryParams=[...jqueryParams,r]}; $.ready=function(r){jqueryParams=[...jqueryParams,r]}; jQuery.load=function(r){jqueryParams=[...jqueryParams,r]}; $.load=function(r){jqueryParams=[...jqueryParams,r]}; jQuery.fn.ready=function(r){jqueryParams=[...jqueryParams,r]}; $.fn.ready=function(r){jqueryParams=[...jqueryParams,r]}; ``` -------------------------------- ### dFlip JavaScript Initialization and Configuration Source: https://www.truenas.com/truenas-community-edition This JavaScript code initializes and configures the dFlip library for interactive PDF viewing on the TrueNAS website. It defines global settings for dFlip, including asset paths, text labels for controls, and various display and behavior options. The code also includes a utility function to check for element loading and adds a 'loading-skeleton' class to the body during the initial page load. ```javascript var dFlipLocation = "https://www.truenas.com/wp-content/plugins/dflip/assets/"; var dFlipWPGlobal = {"text":{"toggleSound":"Turn on\/off Sound","toggleThumbnails":"Toggle Thumbnails","toggleOutline":"Toggle Outline\/Bookmark","previousPage":"Previous Page","nextPage":"Next Page","toggleFullscreen":"Toggle Fullscreen","zoomIn":"Zoom In","zoomOut":"Zoom Out","toggleHelp":"Toggle Help","singlePageMode":"Single Page Mode","doublePageMode":"Double Page Mode","downloadPDFFile":"Download PDF File","gotoFirstPage":"Goto First Page","gotoLastPage":"Goto Last Page","share":"Share","mailSubject":"I wanted you to see this FlipBook","mailBody":"Check out this site {{url}}","loading":"Loading"},"moreControls":"download,pageMode,startPage,endPage,sound","hideControls":"","scrollWheel":"true","backgroundColor":"#AEADAE","backgroundImage":"","height":"240","paddingLeft":"20","paddingRight":"20","controlsPosition":"bottom","duration":"800","soundEnable":"false","enableDownload":"true","enableAnalytics":"true","webgl":"true","hard":"none","maxTextureSize":"1600","rangeChunkSize":"524288","zoomRatio":"1.5","stiffness":"3","pageMode":"0","singlePageMode":"0","pageSize":"0","autoPlay":"false","autoPlayDuration":"5000","autoPlayStart":"false","linkTarget":"2","sharePrefix":"TrueNAS-PDF-,flipbook-"}; // Add skeletal class to body const isElementLoaded = async selector => { while ( document.querySelector(selector) === null) { await new Promise( resolve => requestAnimationFrame(resolve) ) } return document.querySelector(selector); }; // Checking for a specific class, id or element. isElementLoaded('body').then((selector) => { document.body.classList.add('loading-skeleton'); const template = document.createElement('div'); template.style.cssText = 'position:absolute;width:100%;height:100%;z-index:100;background:#FFF;'; template.innerHTML += "
"; template.innerHTML += "
"; template.id = 'loading-block'; document.body.appendChild(template); }); addEventListener("DOMContentLoaded", (event) => { try { var element = document.getElementById("loading-block"); element.parentNode.removeChild(element); document.body.classList.remove('loading-skeleton') } catch (exceptionVar) { console.log("second try"); window.requestAnimationFrame(() => { var element = document.getElementById("loading-block"); element.parentNode.removeChild(element); document.body.classList.remove('loading-skeleton'); }); } }); ``` -------------------------------- ### Initialize DFLIP PDF Viewer Options Source: https://www.truenas.com/truecommand This JavaScript code initializes configuration options for the DFLIP PDF viewer. It sets parameters such as outline, fit, auto-enable outline/thumbnail, overwrite PDF outline, direction, page size, and the source PDF URL. The code then calls DFLIP.parseBooks() if the DFLIP object and its parseBooks method are available. ```javascript var option_df_80238 = {"outline":[],"forceFit":"true","autoEnableOutline":"false","autoEnableThumbnail":"false","overwritePDFOutline":"false","direction":"1","pageSize":"0","source":"https:\/\/www.truenas.com\/wp-content\/uploads\/2025\/06\/TrueCommand_3.1_White_Paper_June_2025.pdf","wpOptions":"true"}; if(window.DFLIP && DFLIP.parseBooks){DFLIP.parseBooks();} ``` -------------------------------- ### Add Banner Padding and Sticky Section Padding (CSS) Source: https://www.truenas.com/backup Adds padding to banner sections for floating navigation and defines default padding for sticky sections. It also includes adjustments for when the user starts scrolling, reducing the padding for a smoother visual effect. Responsive design is considered for the admin bar. ```css /* Add Banner padding for the floating navigation */ .et_pb_section_0.et_pb_section, .et_pb_section_0_tb_body.et_pb_section { padding-top: 72px!important; } .ubermenu .ubermenu-divider { padding: 0; margin-bottom: 20px; } /* Default padding for the sticky section */ .sticky { padding: 10px; /* or whatever your default padding is */ transition: padding 0.3s ease; /* smooth transition */ top: 64px!important; } .admin-bar .sticky { top: 95px!important; } /* Adjust padding when user starts scrolling */ .et_builder_inner_content.has_et_pb_sticky ~ * .sticky, .et_builder_inner_content.has_et_pb_sticky .sticky { padding: 20px!important; /* reduced padding when scrolling */ } ``` -------------------------------- ### Define CSS Animation Parameters for Divi Builder Source: https://www.truenas.com/blog/truenas-is-secure-storage This JavaScript code defines an array of animation data for elements within the Divi Builder. Each object specifies animation properties such as the target CSS class, animation style ('slideBottom'), repetition ('once'), duration, delay, intensity, starting opacity, and speed curve. This allows for dynamic application of animations to page elements. ```javascript var et_animation_data = [{"class":"et_pb_row_1_tb_body","style":"slideBottom","repeat":"once","duration":"1000ms","delay":"0ms","intensity":"2%","starting_opacity":"0%","speed_curve":"ease-in-out"}]; ```