From 33fe6af12fac79fc59d1ca79717a6840f88c3e9e Mon Sep 17 00:00:00 2001 From: Dmitry Sharabin Date: Fri, 25 Jun 2021 10:29:27 +0300 Subject: [PATCH 1/4] [docs update] Replace var with let --- docs.html | 72 +++++++++++++++++++++++++++--------------------------- index.html | 36 +++++++++++++-------------- 2 files changed, 54 insertions(+), 54 deletions(-) diff --git a/docs.html b/docs.html index 7416d8b..003439b 100644 --- a/docs.html +++ b/docs.html @@ -29,7 +29,7 @@

Overview

Bliss includes several static methods (on the Bliss or $ object). For example, to copy all properties of an object onto another object, you would call $.extend():

-
var yolo = $.extend({foo: 1}, {bar: 2}); // or Bliss.extend(…)
+	
let yolo = $.extend({foo: 1}, {bar: 2}); // or Bliss.extend(…)
 // yolo is {foo: 1, bar: 2}

Many of Bliss’ methods take an element or an array of elements as their first argument. For example, to set both the width and padding of an element to 0, you could use the $.style() method:

@@ -206,7 +206,7 @@

$()

Select an element by selector. Mainly a shortcut for element.querySelector().

-
var element = $(selector [, context])
+
let element = $(selector [, context])
selector
@@ -221,11 +221,11 @@

$()

// return the first element with a class of .foo
 // that is inside the first element with a class of .bar
-var ret = $(".foo", $(".bar"));
+let ret = $(".foo", $(".bar"));
// Return the first element with a class of .foo
 // that is inside any element with a class of .bar
-var ret = $(".bar .foo");
+let ret = $(".bar .foo");
// Get the first element with a class of .foo
 // and set its title attribute to "yolo"
@@ -241,7 +241,7 @@ 

$()

// Check if the .foo element exists
 // and set an attribute by using a variable "foo"
 // as a reference of the element
-var foo = $(".foo");
+let foo = $(".foo");
 if (foo) {
     foo.setAttribute("title", "yolo");
 }
@@ -254,7 +254,7 @@

$$()

Get all elements that match a given selector as an array. Similar to element.querySelectorAll() but returns an Array instead of a NodeList, so it has all of the convenience methods we’ve come to love on arrays.

-
var array = $$(selector [, context])
+
let array = $$(selector [, context])
selector
@@ -267,7 +267,7 @@

$$()

The matched elements as an array.
-
var array = $$(collection)
+
let array = $$(collection)
collection
@@ -283,7 +283,7 @@

$$()

h1.id = h1.textContent.replace(/\W/g, ""); });
// Get an array with all ids on the page
-var ids = $$("[id]").map(function(element){
+let ids = $$("[id]").map(function(element){
 	return element.id;
 });
// Get all of an element’s attributes starting with data-bliss-
@@ -299,7 +299,7 @@ 

create

Create an element.

-
var element = $.create([tag,] [options]);
+
let element = $.create([tag,] [options]);
tag
@@ -331,9 +331,9 @@

create

] });
-
var paragraph = $.create("p");
+
let paragraph = $.create("p");
-
var div = $.create();
+
let div = $.create();