This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This self-invoking anonymous function consists of: | |
* - onload finction, which cotains functions that are responsible for the logic of click event handling on the Switch button | |
* - the helper function for adding event listeners; | |
* - the RequestsQueue constructor: impelements the dymanic queue | |
* | |
* It encloses variables and functions in it's scope and helps us keep them out of Global | |
* This is the most simple scenario of Module pattern. | |
* | |
* Working process: by clicking the button on the page, the requests start generating. The amount of requests in the bunch is a random number (from 1 to 3). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This self-invoking anonymous function consists of: | |
* - DOM_Sniffer which inspects the DOM of the page; | |
* - the helper function for adding event listeners; | |
* - the InfoBlock constructor: the element which contains data of sniffed object | |
* | |
* It encloses variables and functions in it's scope and helps us keep them out of Global | |
* This is the most simple scenario of Module pattern. | |
* | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This self-invoking anonymous function consists of: | |
* - the object currencyConverterTool, which is responsible for conversion of usd values into euro values and displaying the result in the tooltip; | |
* - the helper function for adding event listeners; | |
* - the Tooltip constructor. | |
* It encloses variables and functions in it's scope and helps us keep them out of Global | |
* This is the most simple scenario of Module pattern. | |
*/ | |
(function(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
//initializing an object to add to session storage or cookies | |
var person = { | |
name: 'Anastasia', | |
lastname: 'Tayanovskaya', | |
birth: { | |
day: 10, | |
month: 'September', | |
year: 1989 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
/** | |
* Gets the object value from the session storage or cookies and displays the result | |
*/ | |
window.onload = function() { | |
var resultBox = document.getElementById('result'), //gets the DOM element where results are stored | |
key = 'person', // the key name of the object | |
result = sessionDataManager.getObject(key); //gets the value of the object from session storage or from cookies | |
// appends the reult to the resultBox element |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This self-invoking anonymous function contains the json object with attendees' names, | |
* the helper function for adding event listeners and the Autocomplete constructor. | |
* It encloses variables and functions in it's scope and helps us keep them out of Global | |
* This is the most simple scenario of Module pattern. | |
*/ | |
(function(){ | |
//json object | |
var attendeesJSON = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Slider = function(options){ | |
var bar, | |
slider, | |
toggle, | |
percent, | |
that = this; | |
function _init(options){ | |
_construct(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Blur.prototype.burn_ = function () { | |
var time = (new Date()).getTime(); | |
var width = this.image.width; | |
var height = this.image.height; | |
if (!this.lastTime) this.lastTime = time; | |
//Light up | |
if (this.dragging) { | |
var centerX = this.drag.coords.x - this.element_.offsetLeft; | |
var centerY = this.drag.coords.y - this.element_.offsetTop; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Blur.prototype.burn_ = function () { | |
var time = (new Date()).getTime(); | |
var width = this.image.width; | |
var height = this.image.height; | |
if (!this.lastTime) this.lastTime = time; | |
if (this.dragging) { | |
var points = this.getAndProcessAffected(); | |
//var edgePoints = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Blur.prototype.burn_ = function () { | |
var time = (new Date()).getTime(); | |
var width = this.image.width; | |
var height = this.image.height; | |
if (!this.lastTime) this.lastTime = time; | |
if (this.dragging) { | |
var points = this.getAndProcessAffected(); | |
//var edgePoints = []; |