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
| // What is `callback`? | |
| /** | |
| * Async working method with callback | |
| * | |
| * @param {*} data | |
| * @param {function} callback | |
| * | |
| * @returns {string} | |
| */ |
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
| /** | |
| * Возвращает первый найденный элемент по селектору selector | |
| * @see http://www.w3.org/TR/CSS21/selector | |
| * @see https://developer.mozilla.org/en-US/docs/Web/API/element | |
| * | |
| * @example | |
| * // Получить элемент с классом `myclass` | |
| * var el = document.querySelector(".myclass"); | |
| * | |
| * // Так работать не будет, псевдо-элементы недоступны для js |
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
| // api: fromTextArea | |
| // https://github.com/codemirror/CodeMirror/blob/a11ccbefa281a0e728b7431ba52f550854831ea6/lib/codemirror.js#L5888 | |
| var editor = targetIsTextarea ? CodeMirror.fromTextArea(target, editorOptions) : target; | |
| // api: setCursor | |
| // https://github.com/codemirror/CodeMirror/blob/a11ccbefa281a0e728b7431ba52f550854831ea6/lib/codemirror.js#L7438 | |
| // api: posFromIndex | |
| // https://github.com/codemirror/CodeMirror/blob/a11ccbefa281a0e728b7431ba52f550854831ea6/lib/codemirror.js#L7624 | |
| editor.setCursor(editor.posFromIndex(initialPos)); |
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
| <script> | |
| $(document).ready( function() { | |
| var $grid = $('.row').masonry({ | |
| // main isotope options | |
| itemSelector: '.row__item', | |
| columnWidth: '.row__sizer', | |
| gutter: '.gutter-sizer', | |
| percentPosition: true, | |
| }); |
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 class="people"> | |
| <h3 class="people__title">Количество попутчиков</h3> | |
| <form class="people__form" action="/echo" method="post"> | |
| <input class="people__form-btn" type="button" name="travel-people__plus" value="+"> | |
| <input class="people__form-field" type="text" name="travel-people__continuance" disabled> | |
| <input class="people__form-btn" type="button" name="travel-people__minus" value="-"> | |
| <table class="people__table"> | |
| <tr> | |
| <th class="people__table-title">№</th> |
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 lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Document</title> | |
| </head> | |
| <body> | |
| <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"> | |
| <title>title is required in html</title> | |
| </head> | |
| <body> | |
| <!-- HTML code for validation, see https://validator.w3.org/nu/#textarea --> |
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 phoneMask = (function() { | |
| var block = $('.js-phone-mask'); | |
| function init() { | |
| block.inputmask("mask", {"mask": "8 (999) 999-9999"}); | |
| } | |
| return { | |
| init: init | |
| }; |
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
| block('link')( | |
| def()(function() { | |
| var ctx = this.ctx; | |
| typeof ctx.url === 'object' && // url could contain bemjson | |
| (ctx.url = this.reapply(ctx.url)); | |
| return applyNext(); | |
| }), | |
| tag()('a'), |