### Initialize Bootbox Source: https://themes.kopyov.com/limitless/demo/docs/plugins_notifications Allows a function to be called when a Bootbox dialog is initialized. This is useful for custom setup or event handling after a dialog appears. ```javascript bootbox.init(function() { // Custom initialization logic here }); ``` -------------------------------- ### SweetAlert: Get Progress Steps Source: https://themes.kopyov.com/limitless/demo/docs/plugins_notifications The Swal.getProgressSteps() method retrieves the progress steps configured for a multi-step SweetAlert popup. This is relevant when using the progress steps feature. ```javascript Swal.getProgressSteps() ``` -------------------------------- ### Advanced Sweet Alert with Callback (JavaScript) Source: https://themes.kopyov.com/limitless/demo/docs/plugins_notifications Provides an example of an advanced Sweet Alert configuration, including a warning icon, cancel button, and a callback function executed when the 'Confirm' button is clicked. This allows for user interaction and conditional actions. ```javascript // Advanced initialization Swal.fire({ title: 'Are you sure?', text: "You won't be able to revert this!", icon: 'warning', showCancelButton: true, confirmButtonColor: '#3085d6', cancelButtonColor: '#d33', confirmButtonText: 'Yes, delete it!' }).then((result) => { if (result.isConfirmed) { Swal.fire( 'Deleted!', 'Your file has been deleted.', 'success' ) } }); ``` -------------------------------- ### Basic Sweet Alert Initialization (JavaScript) Source: https://themes.kopyov.com/limitless/demo/docs/plugins_notifications Demonstrates the basic usage of the Sweet Alert plugin to display a simple alert message. This is a straightforward way to present information to the user. ```javascript // Basic initialization Swal.fire( 'The Internet?', 'That thing is still around?', 'question' ) ``` -------------------------------- ### Bootstrap File Input Basic Setup Source: https://themes.kopyov.com/limitless/demo/docs/plugins_uploaders This JavaScript code initializes the Bootstrap file input plugin on elements with the class 'file-input'. It configures various options such as button labels, icons, and initial caption. This setup is for a basic file input element. ```javascript // Basic setup $('.file-input').fileinput({ browseLabel: 'Browse', browseIcon: '', uploadIcon: '', removeIcon: '', layoutTemplates: { icon: '' }, uploadClass: 'btn btn-light', removeClass: 'btn btn-light', initialCaption: "No file selected", previewZoomButtonClasses: previewZoomButtonClasses, previewZoomButtonIcons: previewZoomButtonIcons, fileActionSettings: fileActionSettings }); ``` -------------------------------- ### SweetAlert: Get Focusable Elements Source: https://themes.kopyov.com/limitless/demo/docs/plugins_notifications The Swal.getFocusableElements() method returns a list of all focusable elements within the SweetAlert popup. This is helpful for accessibility features or custom focus management. ```javascript Swal.getFocusableElements() ``` -------------------------------- ### Initialize Noty Notification Source: https://themes.kopyov.com/limitless/demo/docs/plugins_notifications Initializes a new Noty notification with specified text and type. Noty displays alert, success, error, warning, information, or confirmation messages in a queue. ```javascript new Noty({ text: 'Change a few things up and try submitting again.', type: 'error' }).show(); ``` -------------------------------- ### Replace .list-icons with hstack for Icon Links (HTML) Source: https://themes.kopyov.com/limitless/demo/docs/other_migration This example demonstrates the removal of the `.list-icons` class and the adoption of `hstack` with text/link color classes for styling icon-only links. This change promotes a more consistent styling approach using Bootstrap's utility classes. ```html
``` -------------------------------- ### Install Gulp Globally Source: https://themes.kopyov.com/limitless/demo/docs/base_scss_compile Installs Gulp globally on your system using npm, allowing it to be accessed from any project directory. This command requires administrator privileges (sudo) and installs Gulp as a command-line tool. ```bash sudo npm install -g gulp ``` -------------------------------- ### Install Gulp Locally Source: https://themes.kopyov.com/limitless/demo/docs/base_scss_compile Installs Gulp as a development dependency for the current project. This command adds Gulp to your project's `node_modules` directory and updates `package.json`. ```bash npm install --save-dev gulp ``` -------------------------------- ### Check Gulp Version Source: https://themes.kopyov.com/limitless/demo/docs/base_scss_compile Verifies the global installation of Gulp by displaying its version number. This confirms that Gulp has been successfully installed and is accessible from the command line. ```bash gulp -v ``` -------------------------------- ### Moment.js: Format Dates Source: https://themes.kopyov.com/limitless/demo/docs/plugins_extensions Provides examples of formatting dates using Moment.js with various format specifiers. This covers common date and time representations. ```javascript // Format dates example moment().format('MMMM Do YYYY, h:mm:ss a'); // September 21st 2015, 1:31:51 am moment().format('dddd'); // Monday moment().format("MMM Do YY"); // Sep 21st 15 moment().format('YYYY [escaped] YYYY'); // 2015 escaped 2015 moment().format(); // 2015-09-21T01:31:51+02:00 ``` -------------------------------- ### Check Node.js Version Source: https://themes.kopyov.com/limitless/demo/docs/base_scss_compile Verifies the installation of Node.js by displaying its version number in the command line. This command is essential for ensuring that Node.js is correctly set up before proceeding with other installations. ```bash node -v ``` -------------------------------- ### Start Autocomplete Search Source: https://themes.kopyov.com/limitless/demo/docs/plugins_forms The `start(query)` function initiates the search process within the Autocomplete.js engine. It takes an optional query string, manipulates it, checks trigger conditions, fetches data, and renders the results list if enabled. This method is crucial for performing searches based on user input or predefined queries. ```javascript autoCompleteJS.start("tea"); ``` -------------------------------- ### Include Sweet Alert Plugin in HTML Source: https://themes.kopyov.com/limitless/demo/docs/plugins_notifications This snippet shows how to include the Sweet Alert plugin script in the `` section of an HTML document. Ensure the path to the script is correct for your project. ```html ``` -------------------------------- ### SweetAlert2 Show Animation Classes Source: https://themes.kopyov.com/limitless/demo/docs/plugins_notifications Defines CSS classes to be applied when a SweetAlert2 popup is shown, creating a fade-in animation. These classes are essential for visualizing the popup's appearance. ```javascript showClass: { popup: 'swal2-show', backdrop: 'swal2-backdrop-show', icon: 'swal2-icon-show' } ``` -------------------------------- ### SweetAlert: Get Footer Element Source: https://themes.kopyov.com/limitless/demo/docs/plugins_notifications The Swal.getFooter() method retrieves the DOM element of the footer section in a SweetAlert popup. This can be used to modify or display footer content. ```javascript Swal.getFooter() ``` -------------------------------- ### Initialize and Use Mark.js for Basic Highlighting Source: https://themes.kopyov.com/limitless/demo/docs/plugins_extensions Demonstrates initializing Mark.js with a specific DOM element and performing basic text highlighting. It includes removing previous highlights before applying new ones based on user input. Dependencies include the Mark.js library. ```javascript // Create an instance of mark.js and pass an argument containing // the DOM object of the context (where to search for matches) const instanceBase = new Mark(document.querySelector(".demo-target-base")); // Cache DOM elements const inputBase = document.querySelector("input[name='keyword-basic']"); // Initialize function performMarkBasic() { // Read the keyword const keywordBase = inputBase.value; // Remove previous marked elements and mark // the new keyword inside the context instanceBase.unmark({ done: function(){ instanceBase.mark(keywordBase); } }); } // Listen to input and option changes inputBase.addEventListener("input", performMarkBasic); ``` -------------------------------- ### Initialize Quill Editor with Full Toolbar Source: https://themes.kopyov.com/limitless/demo/docs/plugins_editors Example of initializing the Quill editor with a comprehensive set of toolbar options, including font, size, header, text formatting, blockquotes, code blocks, lists, scripts, indentation, direction, color, alignment, formula, image, video, and a clean button. ```javascript // Initialize const quillFull = new Quill('.quill-full', { modules: { toolbar: [ [{ 'font': [] }], [{ 'size': ['small', false, 'large', 'huge'] }], [{ 'header': [1, 2, 3, 4, 5, 6, false] }], ['bold', 'italic', 'underline', 'strike'], ['blockquote', 'code-block'], [{ 'header': 1 }, { 'header': 2 }], [{ 'list': 'ordered'}, { 'list': 'bullet' }], [{ 'script': 'sub'}, { 'script': 'super' }], [{ 'indent': '-1'}, { 'indent': '+1' }], [{ 'direction': 'rtl' }], [{ 'color': [] }, { 'background': [] }], [{ 'align': [] }], [ 'formula', 'image', 'video' ], ['clean'] ] }, bounds: '.content-inner', placeholder: 'Please add your text here...', theme: 'snow' }); ``` -------------------------------- ### SweetAlert: Get Image Element Source: https://themes.kopyov.com/limitless/demo/docs/plugins_notifications The Swal.getImage() method retrieves the DOM element of the image displayed within the SweetAlert popup. This allows for direct manipulation or styling of the image. ```javascript Swal.getImage() ``` -------------------------------- ### Include Bootbox.js and Bootstrap Dependencies Source: https://themes.kopyov.com/limitless/demo/docs/plugins_notifications These script tags are necessary to include the Bootbox.js library and Bootstrap's JavaScript components in your HTML. Ensure these are placed within the `` section of your document. ```html ``` -------------------------------- ### Initialize Mark.js Instance Source: https://themes.kopyov.com/limitless/demo/docs/plugins_extensions Shows how to create a new instance of Mark.js. The constructor accepts a context argument which can be a single DOM element, an array of elements, a NodeList, or a CSS selector string. This defines the scope for highlighting. ```javascript var instance = new Mark(context); ``` ```javascript var instance = new Mark(document.querySelector("div.context")); ``` ```javascript var instance = new Mark("div.context"); ``` -------------------------------- ### SweetAlert: Get Icon Element Source: https://themes.kopyov.com/limitless/demo/docs/plugins_notifications The Swal.getIcon() method retrieves the DOM element representing the icon displayed in the SweetAlert popup. Useful for dynamic icon changes or styling. ```javascript Swal.getIcon() ``` -------------------------------- ### SweetAlert: Get Close Button Element Source: https://themes.kopyov.com/limitless/demo/docs/plugins_notifications The Swal.getCloseButton() method returns the DOM element of the SweetAlert's close button. This can be used to interact with or style the close button. ```javascript Swal.getCloseButton() ``` -------------------------------- ### HTML Structure for Full Width Layout Source: https://themes.kopyov.com/limitless/demo/docs/layout_overview This HTML snippet illustrates the markup for a full-width layout. It highlights how the main content area (`.content-wrapper`) and sidebars (`.sidebar`) are structured to span the full available width. The example includes a main navbar, sidebars, and content area, demonstrating a flexible layout suitable for various screen sizes. ```html` elements and uses `language-xxxx` classes for language definition, which can be inherited by ancestor elements.
```html
```
--------------------------------
### Trumbowyg Text Range: Get Selected Text
Source: https://themes.kopyov.com/limitless/demo/docs/plugins_editors
Demonstrates how to get the text content of the currently selected range within the Trumbowyg editor using the 'getRangeText' method.
```javascript
// Get text
var text = $('#editor').trumbowyg('getRangeText');
```
--------------------------------
### Initialize Session Timeout
Source: https://themes.kopyov.com/limitless/demo/docs/plugins_extensions
Example of initializing the session timeout plugin with specific options for session expiration warning and redirection. This configuration includes custom titles, messages, and URLs for redirection and logout.
```javascript
// Session timeout
$.sessionTimeout({
title: 'Session Timeout',
message: 'Your session is about to expire. Do you want to stay connected?',
ignoreUserActivity: true,
warnAfter: 10000,
redirAfter: 30000,
redirUrl: 'login_unlock.html',
logoutUrl: 'login_advanced.html'
});
```
--------------------------------
### Replace Media List Component with Flex Utilities (HTML)
Source: https://themes.kopyov.com/limitless/demo/docs/other_migration
This code shows the transition from the older `.media-list` and `.media` structure to using Bootstrap's flexbox utilities (`d-flex`, `flex-fill`, `me-3`). This change offers a more flexible and modern approach to creating media object layouts.
```html
-
Walking away fallaciously
Wise that some and before yellow thus yikes mandrill one luxuriantly other fashionably much
Walking away fallaciously
Wise that some and before yellow thus yikes mandrill one luxuriantly other fashionably much
```
--------------------------------
### Highlight Text Ranges with markRanges() in JavaScript
Source: https://themes.kopyov.com/limitless/demo/docs/plugins_extensions
The markRanges() method enables highlighting of specific text ranges identified by their start position and length. This is useful for marking precise sections of text within a DOM element. The method takes an array of range objects (each with 'start' and 'length' properties) and an optional options object for customization.
```javascript
var context = document.querySelector(".context");
var instance = new Mark(context);
var ranges = [
{ start: 10, length: 5 },
{ start: 25, length: 3 }
];
instance.markRanges(ranges, {
element: "span",
className: "highlight"
});
```
--------------------------------
### Initialize Basic Grid.js Table with Data
Source: https://themes.kopyov.com/limitless/demo/docs/plugins_tables
This JavaScript code demonstrates how to initialize a basic Grid.js table. It defines sample data and column headers, then renders the table into a specified DOM element. Ensure the target element with the class '.gridjs-example-basic' exists in your HTML.
```javascript
// Demo data
const demoData = [
["John", "john@example.com", "(353) 01 222 3333", "Netherlands"],
["Mark", "mark@gmail.com", "(01) 22 888 4444", "Switzerland"],
["Eoin", "eoin@gmail.com", "0097 22 654 00033", "Germany"],
["Sarah", "sarahcdd@gmail.com", "+322 876 1233", "France"],
["Afshin", "afshin@mail.com", "(353) 22 87 8356", "Norway"]
];
// Basic example
const gridjsBasicElement = document.querySelector(".gridjs-example-basic");
if(gridjsBasicElement) {
const gridjsBasic = new gridjs.Grid({
className: {
table: 'table'
},
columns: ["Name", "Email", "Phone Number", "Country"],
data: demoData
});
gridjsBasic.render(gridjsBasicElement);
}
```
--------------------------------
### Initialize Idle Timeout
Source: https://themes.kopyov.com/limitless/demo/docs/plugins_extensions
Example of initializing the session timeout plugin as an idle timeout. This configuration focuses on a shorter warning and redirection period, suitable for detecting user inactivity.
```javascript
// Idle timeout
$.sessionTimeout({
title: 'Idle Timeout',
message: 'Your session is about to expire. Do you want to stay connected?',
warnAfter: 5000,
redirAfter: 15000,
redirUrl: 'login_unlock.html',
logoutUrl: 'login_advanced.html'
});
```
--------------------------------
### SweetAlert: Reset Validation Message
Source: https://themes.kopyov.com/limitless/demo/docs/plugins_notifications
The Swal.resetValidationMessage() method hides the validation message that was previously shown using Swal.showValidationMessage().
```javascript
Swal.resetValidationMessage()
```
--------------------------------
### SweetAlert: Check if Loading
Source: https://themes.kopyov.com/limitless/demo/docs/plugins_notifications
The Swal.isLoading() method determines if the SweetAlert popup is currently in a loading state. This is related to Swal.showLoading() and Swal.hideLoading().
```javascript
Swal.isLoading()
```
--------------------------------
### Include Spectrum Color Picker Dependencies - HTML
Source: https://themes.kopyov.com/limitless/demo/docs/plugins_pickers
Includes the necessary JavaScript files for the Spectrum color picker. This involves loading jQuery first, followed by the Spectrum plugin script itself. These should be placed in the HTML `` section.
```html
```
--------------------------------
### Initialize Dropzone with Multiple Files
Source: https://themes.kopyov.com/limitless/demo/docs/plugins_uploaders
This JavaScript snippet shows how to initialize Dropzone for handling multiple file uploads. It targets an element with the ID 'dropzone_multiple' and configures options such as the upload URL, parameter name for the file, a default message, and maximum file size.
```javascript
// Multiple files
let dropzoneMultiple = new Dropzone("#dropzone_multiple", {
url: "#",
paramName: "file", // The name that will be used to transfer the file
dictDefaultMessage: 'Drop files to upload or CLICK',
maxFilesize: 0.1 // MB
});
```
--------------------------------
### Hide All Bootbox Dialogs
Source: https://themes.kopyov.com/limitless/demo/docs/plugins_notifications
Hides all currently active Bootbox dialogs. This is a global method to quickly dismiss all open dialogs.
```javascript
bootbox.hideAll();
```
--------------------------------
### Include Dual Listbox JavaScript Library
Source: https://themes.kopyov.com/limitless/demo/docs/plugins_forms
Demonstrates how to load the Dual Listbox JavaScript library either through a Content Delivery Network (CDN) or by including a local file. This step is essential before initializing the library.
```html
```