DevArt EichJS Extender Core: Difference between revisions

From DevArt Knowledgebase
No edit summary
 
(11 intermediate revisions by the same user not shown)
Line 6: Line 6:
* Latest Version: v1.0.16 @2025-06-26
* Latest Version: v1.0.16 @2025-06-26
* URL: https://js.devartsoftware.com/devart/extender/main/v1.0/devart.extender.min.js
* URL: https://js.devartsoftware.com/devart/extender/main/v1.0/devart.extender.min.js


== Structs ==
== Structs ==
=== Int(Integer) ===
=== Int (Integer Constants) ===
  Int.MinusOne = -1;
  Int.MinusOne
 
  Int.Zero
  Int.Zero
  Int.One
  Int.One
Line 41: Line 39:
  Int.FiveThousand
  Int.FiveThousand
  Int.TenThousand
  Int.TenThousand
  Int.HeightSD = 480
  Int.HeightSD = 480
  Int.HeightHD = 768
  Int.HeightHD = 768
  Int.HeightFHD = 1080
  Int.HeightFHD = 1080


=== Str (String) ===
=== Str (String Constants) ===
 
Str.Empty => ""
Str.Space => " "
Str.Zero => "0"
Str.MinusNinetyNine => "-99"
Str.Colan => ":"
Str.SemiColan => ";"
Str.Comma => ","
Str.Plus => "+"
Str.Hash => "#"
Str.Dash => "-"
Str.FullStop => "."
Str.Underscore => "_"
Str.SlashForward => "/"
Str.SlashBackward => "\\"
Str.QuestionMark => "?"
Str.Plus => "+"
Str.At => "@"
Str.Twiddle => "~"
Str.Exclamation => "!"
Str.Dollar => "$"
Str.Percentage => "%"
Str.Ampersand => "&"
Str.Asterix => "*"
Str.BracketOpen => "("
Str.BracketClose => ")"
Str.OperatorEqual => "="
Str.UnitPixel => "px"
Str.WordScript => "script"
 
== Methods ==
=== CreateCookie ===
Creates a cookie in the browser with given values.


Str.Empty
==== Parameters ====
Str.Space
  {string} Name - Name of the cookie
Str.Zero
  {object} Value - Value of the cookie
Str.MinusNinetyNine
  {number} Days - Number of days to expire. If null or 0, cookie will expire at end of session.
Str.Colan = ":"
Str.SemiColan = ";"
Str.Comma = ","
Str.Plus = "+"
Str.Hash = "#"
Str.Dash = "-"
Str.FullStop = "."
Str.Underscore = "_"
  Str.SlashForward = "/"
  Str.SlashBackward = "\\"
  Str.QuestionMark = "?"
Str.Plus = "+"
Str.At = "@"
Str.Twiddle = "~"
Str.Exclamation = "!"
Str.Dollar = "$"
Str.Percentage = "%"
Str.Ampersand = "&"
Str.Asterix = "*"
Str.BracketOpen = "("
Str.BracketClose = ")"


  Str.OperatorEqual = "="
==== Sample ====
  CreateCookie("CkLastLogin", new Date().getTime(), 365);


Str.UnitPixel = "px"
=== ReadCookie ===
Reads a cookie from the browser.


  Str.WordScript = "script"
==== Parameters ====
{string} Name - Name of the cookie.
  @returns {string|null} Value of the cookie or null if not found.
 
==== Sample ====
let Value = ReadCookie("CkLastLogin");
 
=== EraseCookie ===
Deletes a cookie from the browser.
 
==== Parameters ====
{string} Name - Name of the cookie.
 
==== Sample ====
EraseCookie("CkLastLogin");


== Methods ==
=== ValidateFile ===
=== ValidateFile ===
 
Validates upload file controller with the given validation rules.
ValidateFile(FileControl, Rules, OnComplete);
Validates upload file controller with the given validation rules.


==== Parameters ====
==== Parameters ====
  {Element} FileControl - File input control.
  {Element} FileControl - File input control.
  {Object[]} Rueles - Array of validation rules.
  {object[]} Rueles - Array of validation rules.
  {Function} OnComplete - Callback function to be called on completion of validation. Parameter is an object with Success and Message properties.
  {function} OnComplete - Callback function to be called on completion of validation. Parameter is an object with Success and Message properties.


==== Sample ====
==== Sample ====

Latest revision as of 09:31, 23 September 2025

HTTP EichJS is a comprehensive library that allows you to develop web applications using Vanilla JavaScript.

Info

Structs

Int (Integer Constants)

Int.MinusOne
Int.Zero
Int.One
Int.Two
Int.Three
Int.Four
Int.Five
Int.Six
Int.Seven
Int.Eight
Int.Nine
Int.Ten
Int.Twelve
Int.Fifteen
Int.Sixteen
Int.Twenty
Int.TwentyFour
Int.Thirty
Int.Fifty
Int.Sixty
Int.Ninety
Int.Hundred
Int.TwoHundred
Int.ThreeHundredSixtyFive
Int.FiveHundred
Int.Thousand
Int.TwoThousand
Int.ThreeThousand
Int.FiveThousand
Int.TenThousand
Int.HeightSD = 480
Int.HeightHD = 768
Int.HeightFHD = 1080

Str (String Constants)

Str.Empty => ""
Str.Space => " "
Str.Zero => "0"
Str.MinusNinetyNine => "-99"
Str.Colan => ":"
Str.SemiColan => ";"
Str.Comma => ","
Str.Plus => "+"
Str.Hash => "#"
Str.Dash => "-"
Str.FullStop => "."
Str.Underscore => "_"
Str.SlashForward => "/"
Str.SlashBackward => "\\"
Str.QuestionMark => "?"
Str.Plus => "+"
Str.At => "@"
Str.Twiddle => "~"
Str.Exclamation => "!"
Str.Dollar => "$"
Str.Percentage => "%"
Str.Ampersand => "&"
Str.Asterix => "*"
Str.BracketOpen => "("
Str.BracketClose => ")"
Str.OperatorEqual => "="
Str.UnitPixel => "px"
Str.WordScript => "script"

Methods

CreateCookie

Creates a cookie in the browser with given values.

Parameters

{string} Name - Name of the cookie 
{object} Value - Value of the cookie
{number} Days - Number of days to expire. If null or 0, cookie will expire at end of session.

Sample

CreateCookie("CkLastLogin", new Date().getTime(), 365);

ReadCookie

Reads a cookie from the browser.

Parameters

{string} Name - Name of the cookie.
@returns {string|null} Value of the cookie or null if not found.

Sample

let Value = ReadCookie("CkLastLogin");

EraseCookie

Deletes a cookie from the browser.

Parameters

{string} Name - Name of the cookie.

Sample

EraseCookie("CkLastLogin");

ValidateFile

Validates upload file controller with the given validation rules.

Parameters

{Element} FileControl - File input control.
{object[]} Rueles - Array of validation rules.
{function} OnComplete - Callback function to be called on completion of validation. Parameter is an object with Success and Message properties.

Sample

ValidateFile(Uploader,
   [
       { Name: "size", Value: 1 }, //in MB
       { Name: "type", Value: "jpg,png,jpeg,gif" },
       { Name: "ratio", Value: "16:9" },
       { Name: "dimension-min", Value: { Width: 480, Height: 270 } },
       { Name: "dimension-max", Value: { Width: 1920, Height: 1080} }
   ],
   (Result) =>
   {
       let Lbl = document.getElementById("LblUploadMsg");
       
       if (!Result.Success)
       {
           Lbl.innerHTML = Result.Message;
           return;
       }
       
       UploadFile();
   });