/SolidCode

sc.js is a versatile utility library written in pure JavaScript, designed to simplify common tasks and enhance productivity. With a wide array of methods, sc.js is your go-to solution for handling various operations seamlessly.

Primary LanguageJavaScriptMIT LicenseMIT

SolidCode - sc.js

sc.js is a versatile utility library written in pure JavaScript, designed to simplify common tasks and enhance productivity. With a wide array of methods, sc.js is your go-to solution for handling various operations seamlessly.

Key Features

Paths and Initialization

  • assetsPath: Manage asset paths easily.
  • globalImgPath: Set and retrieve global image paths.
  • init: Initialize the library.

Data Type Checks

  • isString: Check if a value is a string.
  • isNumber: Check if a value is a number.
  • isObject: Check if a value is an object.
  • isTrue: Check if a value is true.
  • isFalse: Check if a value is false.
  • isInt: Check if a value is an integer.

DOM Manipulation

  • block: Block UI elements.
  • unblock: Unblock UI elements.
  • openModal: Open a modal dialog.

Data Operations

  • sendDataToController: Send data to a controller.
  • postData: Post data to a server.
  • getData: Retrieve data from a server.

String and Number Utilities

  • stringFormat: Format strings.
  • extractNumberFromString: Extract numbers from a string.
  • isAlphaNumeric: Check if a string is alphanumeric.
  • getFileNameFromPath: Get file name from a path.
  • getFileNameFromUrl: Get file name from a URL.
  • splitUrlBySlash: Split URL by slashes.

Validation and Formatting

  • isValid: Validate data.
  • isJsonString: Check if a string is a valid JSON string.
  • isHtmlString: Check if a string is a valid HTML string.
  • formatBytes: Format bytes to a readable format.

Date and Time

  • getNow: Get the current date and time.
  • getGmt: Get the current GMT time.
  • startTimer: Start a timer.
  • resetTimer: Reset a timer.
  • IdleTimeout: Set idle timeout.

UI Enhancements

  • addAsteriskForRequiredFields: Add an asterisk for required fields.
  • setButtonDisabledCountdown: Disable a button with a countdown.
  • activateSelectFocus: Activate focus on select elements.
  • activateTooltip: Activate tooltips.
  • activatePopover: Activate popovers.
  • bindExcelButton: Bind an Excel export button.

Miscellaneous

  • getRandomNum: Generate a random number.
  • getRandomColor: Generate a random color.
  • contains: Check if an array contains a value.
  • goUp: Scroll to the top of the page.

DataTables Integration

  • getDatatableLanguage: Get DataTables language settings.
  • getDatatableButtonArray: Get DataTables button array.
  • bindDatatable: Bind a DataTable.

Localization and Conversion

  • localizer: Localize data.
  • jsonToList: Convert JSON to a list.
  • jsonToTable: Convert JSON to a table.

Getting Started

To get started with sc.js, include the library in your project and start using the methods as needed. Refer to the documentation for detailed usage and examples.

Contributing

Contributions are welcome! Feel free to submit issues and pull requests to improve the library.

License

This project is licensed under the MIT License.