This file contains hidden or 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 pagination = (function () { | |
var TOTAL; // всего статей | |
var PER_PAGE = 3; // статей на 1-ой странице | |
var CURRENT_PAGE = 1; // текущая страница | |
var SHOW_MORE_BUTTON; | |
var SHOW_MORE_CALLBACK; // функция, которую вызывать, когда произошел клик по кнопке | |
/* | |
Total: Всего статей в ArticleModel. (Надо будет еще учесть, что total меняется при применении фильтров) | |
showMoreCb: функция, которую надо вызвать при клике на кнопку "Показать Еще" |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<link rel="stylesheet" href="./styles.css"> | |
</head> | |
<body> | |
<div class="header"> |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<link rel="stylesheet" href="./styles.css"> | |
</head> | |
<body> | |
<div class="header"> |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<div id="div-1"> | |
</div> |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<div id="my-div"> | |
<strong>Text</strong> |
This file contains hidden or 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
<ul> | |
<li>Этот</li> | |
<li>тест</li> | |
</ul> | |
<ul> | |
<li>полностью</li> | |
<li>пройден</li> | |
</ul> | |
<script> | |
var elements = document.querySelectorAll('ul > li:last-child'); |
This file contains hidden or 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
<div id="content">Выделим этот элемент</div> | |
<script> | |
var elem = document.getElementById('content'); | |
elem.style.background = 'red'; | |
</script> |
This file contains hidden or 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
<!DOCTYPE HTML> | |
<html> | |
<body> | |
<div>Начало</div> | |
<ul> | |
<li>Информация</li> | |
</ul> |
This file contains hidden or 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 articlesService = (function () { | |
var articles = [1,2,3]; | |
function getArticles() { | |
return articles; | |
} | |
function addArticle(article) { | |
articles.push(article); | |
} |
This file contains hidden or 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 makeCounter() { | |
var currentCount = 1; | |
return function() { // (**) | |
return currentCount++; | |
}; | |
} | |
var counter = makeCounter(); // (*) |