{"id":165429,"date":"2013-01-11T12:00:06","date_gmt":"2013-01-11T08:00:06","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=165429"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=165429","title":{"rendered":"<span class=\"post_title\">\u0421\u0442\u0440\u043e\u0438\u043c \u043f\u0440\u043e\u0447\u043d\u044b\u0439 \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u044b\u0439 frontend<\/span>"},"content":{"rendered":"<div class=\"content html_format\"> \t\t\t\u0412 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u0435, \u0435\u0441\u043b\u0438 \u043d\u0435\u0442 \u0441\u0438\u0434\u0435\u043d\u0438\u044f, \u0442\u043e \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u044c \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e, \u0430 \u0435\u0441\u043b\u0438 \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u044c \u0441\u043b\u043e\u043c\u0430\u0435\u0442\u0441\u044f, \u0442\u043e \u0440\u0443\u0447\u043d\u043e\u0439 \u0442\u043e\u0440\u043c\u043e\u0437 \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u043f\u043e\u0441\u0442\u0440\u0430\u0434\u0430\u0435\u0442. \u042d\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u044f\u0449\u0438\u0445 \u0434\u0440\u0443\u0433 \u043e\u0442 \u0434\u0440\u0443\u0433\u0430 \u043c\u043e\u0434\u0443\u043b\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043f\u043e\u0441\u043b\u0435 \u043e\u0442\u043a\u0430\u0437\u0430 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u043d\u0438\u0445 \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c. \u0412\u043e\u0434\u0438\u0442\u0435\u043b\u044e \u0436\u0435, \u0432 \u0438\u0434\u0435\u0430\u043b\u0435, \u043d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0437\u043d\u0430\u0442\u044c, \u043a\u0430\u043a \u0443\u0441\u0442\u0440\u043e\u0435\u043d \u043c\u043e\u0442\u043e\u0440 \u0438\u043b\u0438 \u0442\u043e\u0440\u043c\u043e\u0437, \u043a\u0430\u0436\u0434\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0435\u043c\u0443 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u0442\u0430\u043a\u043e\u0439, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u0430\u043a \u043f\u0435\u0434\u0430\u043b\u044c \u0433\u0430\u0437\u0430 \u0438\u043b\u0438 \u043a\u043d\u043e\u043f\u043a\u0430 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0444\u0430\u0440. <\/p>\n<p>  \u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0442\u0435\u043a\u0441\u0442\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0438 \u043d\u0430\u0434 HTML \u043a\u043e\u0434\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u043f\u043e\u0445\u043e\u0436\u0438\u043c \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u043e\u043c, \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0441\u043b\u0430\u0431\u044b\u043c \u0441\u0432\u044f\u0437\u044f\u043c \u0438 \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u043e\u0441\u0442\u0438. \u0422\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u0440\u043e\u043c \u0432 \u0434\u0432\u0443\u0445 \u0434\u043e\u043b\u0433\u043e\u0441\u0440\u043e\u0447\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445, \u043e\u0434\u0438\u043d \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u2014 \u0441\u0435\u0440\u0432\u0438\u0441 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u0431\u0430\u043d\u043a\u0438\u043d\u0433\u0430. <br \/>   <a name=\"habracut\"><\/a><br \/>   \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u0430\u0439\u0442-\u0431\u0430\u0437\u0443 \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u043e\u0432. <\/p>\n<h2>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430<\/h2>\n<p>   \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0430\u0439\u043b index.html \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043d\u0435\u0433\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434:  <\/p>\n<pre><code class=\"html\">&lt;!DOCTYPE html&gt; &lt;html&gt;     &lt;head&gt;         &lt;title&gt;\u041a\u043e\u043d\u0442\u0430\u043a\u0442\u044b&lt;\/title&gt;         &lt;meta charset=&quot;utf-8&quot;&gt;         &lt;script type=&quot;text\/javascript&quot; src=&quot;http:\/\/code.jquery.com\/jquery-1.8.3.min.js&quot;&gt;&lt;\/script&gt;         &lt;script type=&quot;text\/javascript&quot; src=&quot;contacts.js&quot;&gt;&lt;\/script&gt;         &lt;script type=&quot;text\/javascript&quot;&gt;             var contacts = new Contacts              jQuery(function(){                contacts.getAll()             })         &lt;\/script&gt;     &lt;\/head&gt;     &lt;body&gt;         &lt;ol id=&quot;list&quot;&gt;             &lt;li&gt;&lt;\/li&gt;         &lt;\/ol&gt;     &lt;\/body&gt; &lt;\/html&gt; <\/code><\/pre>\n<p>   \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0432\u0442\u043e\u0440\u043e\u0439 \u0444\u0430\u0439\u043b \u0432 \u0442\u043e\u0439 \u0436\u0435 \u043f\u0430\u043f\u043a\u0435, \u043d\u0430\u0437\u043e\u0432\u0451\u043c \u0435\u0433\u043e contacts.js \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043d\u0435\u0433\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:  <\/p>\n<pre><code class=\"javascript\">Contacts = function() { } Contacts.prototype.getAll = function() {     jQuery('#list').html(         '&lt;li&gt;\u041f\u0435\u0442\u0440 \u041a\u043e\u043d\u044e\u0448\u0438\u043d petr@konyushin.com&lt;\/li&gt;'+         '&lt;li&gt;\u041a\u0440\u0438\u0441\u0442\u0438\u043d\u0430 \u041b\u043e\u0436\u043a\u0438\u043d\u0430 krispink@mail.ru&lt;\/li&gt;'+         '&lt;li&gt;\u0410\u0440\u0441\u0435\u043d\u0438\u0439 \u041e\u0432\u0430\u043b\u043e\u0432 mrbig@hdfgh.com&lt;\/li&gt;') } <\/code><\/pre>\n<p>   \u0415\u0441\u043b\u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u0444\u0430\u0439\u043b index.html \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043f\u0440\u043e\u043d\u0443\u043c\u0435\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u0430\u043a\u0438\u0445-\u0442\u043e \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u043e\u0432 \u2014 \u043f\u043e\u043a\u0430 \u043d\u0438\u0447\u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0433\u043e.<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/i.imgur.com\/J5eAJ.png\" alt=\"image\"\/><\/p>\n<p>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430\u0448 \u043a\u043e\u0434. \u0421\u0440\u0430\u0437\u0443 \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 Contacts:   <\/p>\n<pre><code class=\"javascript\">var contacts = new Contacts <\/code><\/pre>\n<p>   \u041a\u043e\u0433\u0434\u0430 \u0441\u0430\u0439\u0442 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440, \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434 getAll \u044d\u0442\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430:  <\/p>\n<pre><code class=\"javascript\">jQuery(function(){     contacts.getAll() }) <\/code><\/pre>\n<p>   \u0421\u0430\u043c \u043e\u0431\u044a\u0435\u043a\u0442 \u043f\u043e\u043a\u0430 \u0438\u043c\u0435\u0435\u0442 \u043f\u0443\u0441\u0442\u043e\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440   <\/p>\n<pre><code class=\"javascript\">Contacts = function(){} <\/code><\/pre>\n<p>   \u0418 \u043e\u0434\u0438\u043d \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434, \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0441\u0430\u043c\u044b\u043c \u044d\u043a\u043e\u043d\u043e\u043c\u043d\u044b\u043c \u0434\u043b\u044f \u043f\u0430\u043c\u044f\u0442\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c:  <\/p>\n<pre><code class=\"javascript\">Contacts.prototype.getAll = function() <\/code><\/pre>\n<p>   \u041c\u0435\u0442\u043e\u0434 \u043d\u0430\u0445\u043e\u0434\u0438\u0442 \u0442\u044d\u0433 \u0441 id \u0440\u0430\u0432\u043d\u044b\u043c \u00ablist\u00bb \u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0435\u0433\u043e HTML \u043a\u043e\u0434\u043e\u043c \u0441 \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u0430\u043c\u0438:  <\/p>\n<pre><code class=\"javascript\">Contacts.prototype.getAll = function() {     jQuery('#list').html(         '&lt;li&gt;\u041f\u0435\u0442\u0440 \u041a\u043e\u043d\u044e\u0448\u0438\u043d petr@konyushin.com&lt;\/li&gt;'+         '&lt;li&gt;\u041a\u0440\u0438\u0441\u0442\u0438\u043d\u0430 \u041b\u043e\u0436\u043a\u0438\u043d\u0430 krispink@mail.ru&lt;\/li&gt;'+         '&lt;li&gt;\u0410\u0440\u0441\u0435\u043d\u0438\u0439 \u041e\u0432\u0430\u043b\u043e\u0432 mrbig@hdfgh.com&lt;\/li&gt;') }<\/code><\/pre>\n<p>   \u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0443\u0436\u0435 \u0441\u0435\u0439\u0447\u0430\u0441 \u043c\u043e\u0436\u043d\u043e \u043d\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f HTML \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0438 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043e\u0431\u044a\u0435\u043a\u0442 Contacts \u0438 \u0435\u0433\u043e \u043c\u0435\u0442\u043e\u0434 getAll, \u043d\u043e \u043c\u044b \u0435\u0449\u0451 \u0434\u0430\u043b\u0435\u043a\u0438 \u043e\u0442 \u043d\u0430\u043c\u0435\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0438.<\/p>\n<p>  \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0448\u0430\u0433\u043e\u043c \u043c\u044b \u0438\u0437\u0431\u0430\u0432\u0438\u043c\u0441\u044f \u043e\u0442 HTML \u043a\u043e\u0434\u0430 \u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u0435 Contacts.<\/p>\n<h2>\u041d\u043e\u0432\u044b\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c<\/h2>\n<p>   \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0430\u043f\u043a\u0443 \u00abui\u00bb, \u0438 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0432 \u043d\u043e\u0432\u043e\u0439 \u043f\u0430\u043f\u043a\u0435 \u0444\u0430\u0439\u043b \u00ablist.js\u00bb. \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043d\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434:  <\/p>\n<pre><code class=\"javascript\">UI_List = function(containerId) {     this._containerId = containerId } UI_List.prototype.getList = function() {     jQuery('#'+this._containerId).html(         '&lt;li&gt;\u041f\u0435\u0442\u0440 \u041a\u043e\u043d\u044e\u0448\u0438\u043d petr@konyushin.com&lt;\/li&gt;'+         '&lt;li&gt;\u041a\u0440\u0438\u0441\u0442\u0438\u043d\u0430 \u041b\u043e\u0436\u043a\u0438\u043d\u0430 krispink@mail.ru&lt;\/li&gt;'+         '&lt;li&gt;\u0410\u0440\u0441\u0435\u043d\u0438\u0439 \u041e\u0432\u0430\u043b\u043e\u0432 mrbig@hdfgh.com&lt;\/li&gt;'     ) } <\/code><\/pre>\n<p>   \u041e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0435\u043c \u0444\u0430\u0439\u043b contacts.js \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:  <\/p>\n<pre><code class=\"javascript\">Contacts = function() {     this._uiElements = [] } Contacts.prototype.addUIElement = function(uiElement) {     this._uiElements.push(uiElement) } Contacts.prototype.getAll = function() {     for(var uiElementIndex = 0; uiElementIndex &lt; this._uiElements.length; uiElementIndex ++)     {         this._uiElements[uiElementIndex].getList()     } } <\/code><\/pre>\n<p>   \u0418, \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u043e\u0431\u043d\u043e\u0432\u0438\u043c index.html:  <\/p>\n<pre><code class=\"html\">&lt;!DOCTYPE html&gt; &lt;html&gt;     &lt;head&gt;         &lt;title&gt;\u041a\u043e\u043d\u0442\u0430\u043a\u0442\u044b&lt;\/title&gt;         &lt;meta charset=&quot;utf-8&quot;&gt;         &lt;script type=&quot;text\/javascript&quot; src=&quot;http:\/\/code.jquery.com\/jquery-1.8.3.min.js&quot;&gt;&lt;\/script&gt;         &lt;script type=&quot;text\/javascript&quot; src=&quot;contacts.js&quot;&gt;&lt;\/script&gt;         &lt;script type=&quot;text\/javascript&quot; src=&quot;ui\/list.js&quot;&gt;&lt;\/script&gt;         &lt;script type=&quot;text\/javascript&quot;&gt;             var contacts = new Contacts              var uiList1 = new UI_List('list1')             var uiList2 = new UI_List('list2')             contacts.addUIElement(uiList1)             contacts.addUIElement(uiList2)              jQuery(function(){                contacts.getAll()             })         &lt;\/script&gt;     &lt;\/head&gt;     &lt;body&gt;         &lt;ol id=&quot;list1&quot;&gt;             &lt;li&gt;&lt;\/li&gt;         &lt;\/ol&gt;         &lt;ul id=&quot;list2&quot;&gt;             &lt;li&gt;&lt;\/li&gt;         &lt;\/ul&gt;     &lt;\/body&gt; &lt;\/html&gt; <\/code><\/pre>\n<p>   \u0415\u0441\u043b\u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u043e\u0442\u043a\u0440\u043e\u0435\u043c \u0444\u0430\u0439\u043b index.html, \u0442\u043e \u0443\u0432\u0438\u0434\u0438\u043c \u0434\u0432\u0430 \u0441\u043f\u0438\u0441\u043a\u0430 \u0432\u043c\u0435\u0441\u0442\u043e \u043e\u0434\u043d\u043e\u0433\u043e. <\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/i.imgur.com\/egOcB.png\" alt=\"image\"\/><\/p>\n<p>  \u041f\u0440\u043e\u0439\u0434\u0451\u043c\u0441\u044f \u0431\u044b\u0441\u0442\u0440\u043e \u043f\u043e \u043a\u043e\u0434\u0443. \u0414\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u043d\u043e\u0432\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 UI_List, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 id \u0442\u044d\u0433\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u044b:  <\/p>\n<pre><code class=\"javascript\">UI_List = function(containerId) {     this._containerId = containerId } <\/code><\/pre>\n<p>   \u041b\u043e\u0433\u0438\u043a\u0443 \u043c\u0435\u0442\u043e\u0434\u0430 getAll \u043c\u044b \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u043b\u0438 \u0432 \u043d\u043e\u0432\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0432 \u043c\u0435\u0442\u043e\u0434 getList, \u0438\u0437\u043c\u0435\u043d\u0438\u0432 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440 jQuery:  <\/p>\n<pre><code class=\"javascript\">UI_List.prototype.getList = function() {     jQuery('#'+this._containerId).html(         '&lt;li&gt;\u041f\u0435\u0442\u0440 \u041a\u043e\u043d\u044e\u0448\u0438\u043d petr@konyushin.com&lt;\/li&gt;'+         '&lt;li&gt;\u041a\u0440\u0438\u0441\u0442\u0438\u043d\u0430 \u041b\u043e\u0436\u043a\u0438\u043d\u0430 krispink@mail.ru&lt;\/li&gt;'+         '&lt;li&gt;\u0410\u0440\u0441\u0435\u043d\u0438\u0439 \u041e\u0432\u0430\u043b\u043e\u0432 mrbig@hdfgh.com&lt;\/li&gt;'     ) } <\/code><\/pre>\n<p>   \u041c\u044b \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 Contacts, \u0442\u0435\u043f\u0435\u0440\u044c \u0432 \u043d\u0451\u043c \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e _uiElements \u043a\u0430\u043a \u043f\u0443\u0441\u0442\u043e\u0439 \u043c\u0430\u0441\u0441\u0438\u0432. \u042d\u0442\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 Contacts \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043e \u043f\u043e\u0434\u0447\u0451\u0440\u043a\u0438\u0432\u0430\u043d\u0438\u0435\u043c \u0432 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0438.  <\/p>\n<pre><code class=\"javascript\">Contacts = function() {     this._uiElements = [] } <\/code><\/pre>\n<p>   \u0412 \u044d\u0442\u043e\u043c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0435 \u0431\u0443\u0434\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f, \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043d\u0430\u0448\u0435\u0433\u043e \u043d\u043e\u0432\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 UI_List. \u0427\u0442\u043e\u0431\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0435\u0433\u043e \u0442\u0443\u0434\u0430, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b\u0438 \u043c\u0435\u0442\u043e\u0434:   <\/p>\n<pre><code class=\"javascript\">Contacts.prototype.addUIElement = function(uiElement) {     this._uiElements.push(uiElement) } <\/code><\/pre>\n<p>   \u0412 \u044d\u0442\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u0435 \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u043b\u0438 \u0443 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c\u043e\u0433\u043e UI \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f getList. \u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u043c\u0435\u0442\u043e\u0434 getAll \u043e\u0431\u044a\u0435\u043a\u0442\u0430 Contacts \u0431\u044b\u043b \u0438\u0437\u043c\u0435\u043d\u0451\u043d, \u0442\u0435\u043f\u0435\u0440\u044c \u043e\u043d \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u043f\u043e \u0432\u0441\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u043c \u0432 Contacts UI \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c \u0438 \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0443 \u043d\u0438\u0445 \u043c\u0435\u0442\u043e\u0434 getList.<\/p>\n<p>  \u0412 index.html \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 (\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u0432) \u043e\u0431\u044a\u0435\u043a\u0442\u0430 UI_List, \u0430 \u0442\u0430\u043a \u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u044d\u0442\u0438 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u044b \u043a\u0430\u043a UI elements \u0432 \u043e\u0431\u044a\u0435\u043a\u0442 contacts.   <\/p>\n<pre><code class=\"javascript\">var uiList1 = new UI_List('list1') var uiList2 = new UI_List('list2') contacts.addUIElement(uiList1) contacts.addUIElement(uiList2) <\/code><\/pre>\n<p>   \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u043a\u043e\u0434 \u0432 document.ready \u043e\u0441\u0442\u0430\u043b\u0441\u044f \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u043d\u044b\u043c:  <\/p>\n<pre><code class=\"javascript\">jQuery(function(){ \t\tcontacts.getAll() }) <\/code><\/pre>\n<p>   \u041f\u043e\u0434\u0438\u0442\u043e\u0436\u0438\u043c, \u0447\u0435\u0433\u043e \u043c\u044b \u0434\u043e\u0431\u0438\u043b\u0438\u0441\u044c \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442.   <\/p>\n<ol>\n<li>\u0423 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0443\u0440\u043e\u0432\u0435\u043d\u044c Contacts, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0443\u0433\u043e\u0434\u043d\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u0438 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 getAll, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 getList \u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430. \u041d\u0430 \u044d\u0442\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435 \u043d\u0430\u0441 \u043d\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 HTML.<\/li>\n<li>\u0413\u043b\u0443\u0431\u0436\u0435 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u2014 \u044d\u0442\u043e \u0442\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0432 Contacts. \u0418\u0445 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e, \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0438\u043b\u0438 \u0443\u0434\u0430\u043b\u044f\u0442\u044c, \u043d\u043e \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0432\u044b\u0448\u0435 \u043d\u0435 \u0441\u043b\u043e\u043c\u0430\u0435\u0442\u0441\u044f. \u041a\u0430\u0436\u0434\u044b\u0439 \u0442\u0430\u043a\u043e\u0439 \u043e\u0431\u044a\u0435\u043a\u0442, \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0439 UI \u044d\u043b\u0435\u043c\u0435\u043d\u0442, \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\/\u0435\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u0443\u0435\u0442 \u0432\u0441\u044e \u043b\u043e\u0433\u0438\u043a\u0443 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u0443\u044e \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u044c\u044e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e UI_List \u043c\u044b \u0441\u043e\u0431\u0440\u0430\u043b\u0438 \u0432\u0441\u044e \u043b\u043e\u0433\u0438\u043a\u0443, \u043a\u0430\u0441\u0430\u044e\u0449\u0443\u044e\u0441\u044f \u0442\u044d\u0433\u0430 \u0441\u043f\u0438\u0441\u043a\u0430 \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u043c id.<\/li>\n<li>\u041c\u044b \u043c\u043e\u0436\u0435\u043c \u043b\u0435\u0433\u043a\u043e \u043c\u043d\u043e\u0436\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043a\u0438 \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u043e\u0432, \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u0438\u0440\u0443\u044f \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 Contacts, \u0442\u043e \u0435\u0441\u0442\u044c \u0432 \u0444\u0430\u0439\u043b\u0435 index.html<\/li>\n<\/ol>\n<h2>\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430<\/h2>\n<p>   \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0442\u0435\u043f\u0435\u0440\u044c \u0437\u0430\u043c\u0435\u0442\u043a\u0438 \u043a \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u0443. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b ui\/note.js \u0438 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0432 \u043d\u0451\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:  <\/p>\n<pre><code class=\"javascript\">UI_Note = function() { } UI_Note.prototype.getNote = function(contactId) {     var notes = ['\u041e\u0442\u0447\u0451\u0442', '\u0414\u0435\u043d\u044c \u0440\u043e\u0436\u0434\u0435\u043d\u0438\u044f 5 \u044f\u043d\u0432\u0430\u0440\u044f', '\u0414\u043e\u043b\u0433 \u043c\u043d\u0435 500']     jQuery('#note').html(         notes[contactId]     ) } <\/code><\/pre>\n<p>   \u0418\u0437\u043c\u0435\u043d\u0438\u043c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434 getList \u043e\u0431\u044a\u0435\u043a\u0442\u0430 UI_List, \u043d\u0430\u0437\u043d\u0430\u0447\u0438\u043c \u043c\u0435\u0442\u043e\u0434 \u043d\u0430 \u043a\u043b\u0438\u043a \u043f\u043e \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u0443:  <\/p>\n<pre><code class=\"javascript\">UI_List.prototype.getList = function() {     jQuery('#'+this._containerId).html(         '&lt;li&gt;&lt;a href=&quot;#&quot; onclick=&quot;contacts.getNote(0);return false;&quot;&gt;\u041f\u0435\u0442\u0440 \u041a\u043e\u043d\u044e\u0448\u0438\u043d petr@konyushin.com&lt;\/a&gt;&lt;\/li&gt;'+         '&lt;li&gt;&lt;a href=&quot;#&quot; onclick=&quot;contacts.getNote(1);return false;&quot;&gt;\u041a\u0440\u0438\u0441\u0442\u0438\u043d\u0430 \u041b\u043e\u0436\u043a\u0438\u043d\u0430 krispink@mail.ru&lt;\/a&gt;&lt;\/li&gt;'+         '&lt;li&gt;&lt;a href=&quot;#&quot; onclick=&quot;contacts.getNote(2);return false;&quot;&gt;\u0410\u0440\u0441\u0435\u043d\u0438\u0439 \u041e\u0432\u0430\u043b\u043e\u0432 mrbig@hdfgh.com&lt;\/a&gt;&lt;\/li&gt;'     ) } <\/code><\/pre>\n<p>   \u0422\u0430\u043a \u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u043a\u043e\u0441\u0442\u044b\u043b\u044c, \u0442\u0430\u043a \u043a\u0430\u043a \u0431\u0435\u0437 \u043d\u0435\u0433\u043e \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c. \u041c\u044b \u0443\u0431\u0435\u0440\u0451\u043c \u0435\u0433\u043e \u043f\u043e\u0437\u0436\u0435  <\/p>\n<pre><code class=\"javascript\">UI_List.prototype.getNote = function() { } <\/code><\/pre>\n<p>   \u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 Contacts \u043c\u0435\u0442\u043e\u0434 getNote, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c id \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u0430:  <\/p>\n<pre><code class=\"javascript\">Contacts.prototype.getNote = function(contactId) {     for(var uiElementIndex = 0; uiElementIndex &lt; this._uiElements.length; uiElementIndex ++)     {         this._uiElements[uiElementIndex].getNote(contactId)     } } <\/code><\/pre>\n<p>   \u0418, \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0434\u043b\u044f \u0437\u0430\u043c\u0435\u0442\u043e\u043a \u0432 index.html:  <\/p>\n<pre><code class=\"html\">&lt;!DOCTYPE html&gt; &lt;html&gt;     &lt;head&gt;         &lt;title&gt;\u041a\u043e\u043d\u0442\u0430\u043a\u0442\u044b&lt;\/title&gt;         &lt;meta charset=&quot;utf-8&quot;&gt;         &lt;script type=&quot;text\/javascript&quot; src=&quot;http:\/\/code.jquery.com\/jquery-1.8.3.min.js&quot;&gt;&lt;\/script&gt;         &lt;script type=&quot;text\/javascript&quot; src=&quot;contacts.js&quot;&gt;&lt;\/script&gt;         &lt;script type=&quot;text\/javascript&quot; src=&quot;ui\/list.js&quot;&gt;&lt;\/script&gt;         &lt;script type=&quot;text\/javascript&quot; src=&quot;ui\/note.js&quot;&gt;&lt;\/script&gt;         &lt;script type=&quot;text\/javascript&quot;&gt;             var contacts = new Contacts              var uiList = new UI_List('list')             contacts.addUIElement(uiList)              var uiNote = new UI_Note             contacts.addUIElement(uiNote)              jQuery(function(){                contacts.getAll()             })         &lt;\/script&gt;     &lt;\/head&gt;     &lt;body&gt;         &lt;ol id=&quot;list&quot;&gt;             &lt;li&gt;&lt;\/li&gt;         &lt;\/ol&gt;         &lt;div id=&quot;note&quot;&gt;&lt;\/div&gt;     &lt;\/body&gt; &lt;\/html&gt; <\/code><\/pre>\n<p>   \u0415\u0441\u043b\u0438 \u043e\u0442\u043a\u0440\u044b\u0442\u044c index.html, \u0442\u043e \u043f\u043e \u043a\u043b\u0438\u043a\u0443 \u043d\u0430 \u0438\u043c\u044f \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u0430 \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0437\u0430\u043c\u0435\u0442\u043a\u0430.<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/i.imgur.com\/J858Z.png\" alt=\"image\"\/><\/p>\n<p>  \u0414\u0435\u0442\u0430\u043b\u0438 \u043f\u043e \u043a\u043e\u0434\u0443. \u041d\u043e\u0432\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 UI_Note \u0441\u0434\u0435\u043b\u0430\u043d \u043f\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438 \u0441 UI_List. \u0412 \u043d\u0451\u043c \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d \u043c\u0435\u0442\u043e\u0434 getNote, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443 \u043d\u0430\u0441 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c Contacts. \u0423 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 Contacts \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u043d\u043e\u0432\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 getNote, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u043f\u043e \u0441\u0432\u043e\u0438\u043c UI \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c \u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043e\u0434\u043d\u043e\u0438\u043c\u0451\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434. \u0412 index.html \u043d\u0438\u0447\u0435\u0433\u043e \u043f\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0443 \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u043e\u0441\u044c:   <\/p>\n<pre><code class=\"javascript\">var contacts = new Contacts  var uiList = new UI_List('list') contacts.addUIElement(uiList)  var uiNote = new UI_Note contacts.addUIElement(uiNote)  jQuery(function(){     contacts.getAll() }) <\/code><\/pre>\n<p>   \u0421\u043f\u0438\u0441\u043e\u043a \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u043e\u0432 \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u0432\u044b\u0437\u043e\u0432 \u043c\u0435\u0442\u043e\u0434\u0430 getNote \u043e\u0431\u044a\u0435\u043a\u0442\u0430 Contacts \u043f\u043e \u043a\u043b\u0438\u043a\u0443 \u043d\u0430 \u043f\u0443\u043d\u043a\u0442:   <\/p>\n<pre><code class=\"html\">&lt;li&gt;&lt;a href=&quot;#&quot; onclick=&quot;contacts.getNote(0);return false;&quot;&gt;\u041f\u0435\u0442\u0440 \u041a\u043e\u043d\u044e\u0448\u0438\u043d petr@konyushin.com&lt;\/a&gt;&lt;\/li&gt; &lt;li&gt;&lt;a href=&quot;#&quot; onclick=&quot;contacts.getNote(1);return false;&quot;&gt;\u041a\u0440\u0438\u0441\u0442\u0438\u043d\u0430 \u041b\u043e\u0436\u043a\u0438\u043d\u0430 krispink@mail.ru&lt;\/a&gt;&lt;\/li&gt; &lt;li&gt;&lt;a href=&quot;#&quot; onclick=&quot;contacts.getNote(2);return false;&quot;&gt;\u0410\u0440\u0441\u0435\u043d\u0438\u0439 \u041e\u0432\u0430\u043b\u043e\u0432 mrbig@hdfgh.com&lt;\/a&gt;&lt;\/li&gt; <\/code><\/pre>\n<p>   \u0412\u0435\u0440\u043d\u0451\u043c\u0441\u044f \u043a \u043d\u0430\u0448\u0435\u043c\u0443 \u043a\u043e\u0441\u0442\u044b\u043b\u044e. \u0421\u0443\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b: \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043d\u043e\u0432\u043e\u0433\u043e UI \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u044b \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0435 \u0438\u0437 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 Contacts. \u0421\u0435\u0439\u0447\u0430\u0441 \u0442\u0430\u043a\u0438\u0445 \u0434\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 \u2014 getList \u0438 getNote, \u0430 \u0434\u0430\u043b\u044c\u0448\u0435 \u0438\u0445 \u0431\u0443\u0434\u0435\u0442 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u043e\u043b\u044c\u0448\u0435. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e UI \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430. \u041d\u0430\u0437\u043e\u0432\u0451\u043c \u0435\u0433\u043e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, update, \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0438\u043c\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u044b (getList \u0438\u043b\u0438 getNote) \u043f\u0435\u0440\u0432\u044b\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c, \u0430 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u2014 \u0432\u0442\u043e\u0440\u044b\u043c.<\/p>\n<p>  \u041f\u0435\u0440\u0435\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c UI_List:  <\/p>\n<pre><code class=\"javascript\">UI_List = function(containerId) {     this._containerId = containerId } UI_List.prototype.update = function(command, args) {     switch(command)     {         case 'getList':             jQuery('#'+this._containerId).html(                 '&lt;li&gt;&lt;a href=&quot;#&quot; onclick=&quot;contacts.getNote(0);return false;&quot;&gt;\u041f\u0435\u0442\u0440 \u041a\u043e\u043d\u044e\u0448\u0438\u043d petr@konyushin.com&lt;\/a&gt;&lt;\/li&gt;'+                 '&lt;li&gt;&lt;a href=&quot;#&quot; onclick=&quot;contacts.getNote(1);return false;&quot;&gt;\u041a\u0440\u0438\u0441\u0442\u0438\u043d\u0430 \u041b\u043e\u0436\u043a\u0438\u043d\u0430 krispink@mail.ru&lt;\/a&gt;&lt;\/li&gt;'+                 '&lt;li&gt;&lt;a href=&quot;#&quot; onclick=&quot;contacts.getNote(2);return false;&quot;&gt;\u0410\u0440\u0441\u0435\u043d\u0438\u0439 \u041e\u0432\u0430\u043b\u043e\u0432 mrbig@hdfgh.com&lt;\/a&gt;&lt;\/li&gt;')             break     }  } <\/code><\/pre>\n<p>   \u0424\u0430\u0439\u043b ui\/note.js:  <\/p>\n<pre><code class=\"javascript\">UI_Note = function() { } UI_Note.prototype.update = function(command, args) {     var notes = ['\u041e\u0442\u0447\u0451\u0442', '\u0414\u0435\u043d\u044c \u0440\u043e\u0436\u0434\u0435\u043d\u0438\u044f 5 \u044f\u043d\u0432\u0430\u0440\u044f', '\u0414\u043e\u043b\u0433 \u043c\u043d\u0435 500']     switch(command)     {         case 'getNote':             var contactId = args             jQuery('#note').html(                 notes[contactId]             )             break     } } <\/code><\/pre>\n<p>   \u0424\u0430\u0439\u043b contacts.js:  <\/p>\n<pre><code class=\"javascript\">Contacts = function() {     this._uiElements = [] } Contacts.prototype.addUIElement = function(uiElement) {     this._uiElements.push(uiElement) } Contacts.prototype._uiUpdate = function(command, args) {     for(var uiElementIndex = 0; uiElementIndex &lt; this._uiElements.length; uiElementIndex ++)     {         this._uiElements[uiElementIndex].update(command, args)     } } Contacts.prototype.getAll = function() {     this._uiUpdate('getList') } Contacts.prototype.getNote = function(contactId) {     this._uiUpdate('getNote', contactId) } <\/code><\/pre>\n<p>   \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0443\u0432\u0435\u0440\u0435\u043d\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c  \u0438 \u0437\u0430\u043a\u043e\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u043e\u0447\u043a\u0443 contacts.addUIElement(uiNote) \u0438 \u043d\u0435 \u0431\u0435\u0441\u043f\u043e\u043a\u043e\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0441\u0430\u0439\u0442 \u0440\u0443\u0445\u043d\u0435\u0442, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u043d \u043c\u0435\u0442\u043e\u0434 contacts.getNote. \u0415\u0441\u043b\u0438 \u0435\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0443\u0442, \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 UI \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u0430\u043a\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442 \u0438 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442. \u0415\u0449\u0451 \u043e\u0434\u043d\u0430 \u043f\u0440\u0435\u043b\u0435\u0441\u0442\u044c \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u044d\u0442\u043e \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435.<\/p>\n<h2>\u041b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/h2>\n<p>   \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0430\u0439\u043b ui\/logger.js, \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043d\u0435\u0433\u043e \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434:   <\/p>\n<pre><code class=\"javascript\">UI_Logger = function() { } UI_Logger.prototype.update = function(command, args) {     console.log('UI_Logger: '+command +'('+((typeof args == 'undefined') ? '' : args)+')') } <\/code><\/pre>\n<p>   \u041e\u0431\u043d\u043e\u0432\u0438\u043c  \u0444\u0430\u0439\u043b\u0430 index.html:  <\/p>\n<pre><code class=\"html\">&lt;head&gt;     &lt;title&gt;\u041a\u043e\u043d\u0442\u0430\u043a\u0442\u044b&lt;\/title&gt;     &lt;meta charset=&quot;utf-8&quot;&gt;     &lt;script type=&quot;text\/javascript&quot; src=&quot;http:\/\/code.jquery.com\/jquery-1.8.3.min.js&quot;&gt;&lt;\/script&gt;     &lt;script type=&quot;text\/javascript&quot; src=&quot;contacts.js&quot;&gt;&lt;\/script&gt;     &lt;script type=&quot;text\/javascript&quot; src=&quot;ui\/list.js&quot;&gt;&lt;\/script&gt;     &lt;script type=&quot;text\/javascript&quot; src=&quot;ui\/note.js&quot;&gt;&lt;\/script&gt;     &lt;script type=&quot;text\/javascript&quot; src=&quot;ui\/logger.js&quot;&gt;&lt;\/script&gt;     &lt;script type=&quot;text\/javascript&quot;&gt;         var contacts = new Contacts          contacts.addUIElement(new UI_Logger)         contacts.addUIElement(new UI_List('list'))         contacts.addUIElement(new UI_Note)          jQuery(function(){             contacts.getAll()         })     &lt;\/script&gt; &lt;\/head&gt; <\/code><\/pre>\n<p>   \u0422\u0435\u043f\u0435\u0440\u044c, \u043e\u0442\u043a\u0440\u044b\u0432 index.html \u0444\u0430\u0439\u043b, \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0432\u0438\u0434\u0435\u0442\u044c \u043b\u043e\u0433 \u043a\u0430\u0436\u0434\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u043e\u0439 UI \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c \u0438\u0437 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 Contacts. \u0412\u0441\u044f \u043b\u043e\u0433\u0438\u043a\u0430 \u043f\u043e \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e \u0441\u043e\u0431\u0440\u0430\u043d\u0430 \u0432 \u0444\u0430\u0439\u043b\u0435 UI_Logger, \u0444\u0430\u0439\u043b contacts.js \u043e\u0441\u0442\u0430\u043b\u0441\u044f \u0431\u0435\u0437 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0447\u0435\u0433\u043e, \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u0441 \u043b\u0451\u0433\u043a\u043e\u0441\u0442\u044c\u044e \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 \u0432 HTML, \u043c\u044b \u0442\u043e\u0447\u043d\u043e \u0437\u043d\u0430\u0435\u043c, \u0433\u0434\u0435 \u0443 \u043d\u0430\u0441 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u0438 \u043d\u0438\u043a\u0430\u043a\u0438\u0435 \u0447\u0430\u0441\u0442\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0443 \u043d\u0430\u0441 \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u044f\u0442. \u0427\u0442\u043e\u0431\u044b \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0437\u0430\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0443 contacts.addUIElement(new UI_Logger)<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/i.imgur.com\/HVah5.png\" alt=\"image\"\/><\/p>\n<p>  \u0418\u0442\u0430\u043a, \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0442\u0440\u0438 \u043c\u043e\u0434\u0443\u043b\u044f \u0441\u0430\u0439\u0442\u0430 \u2014 Logger, List \u0438 Note, \u043e\u043d\u0438 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u0434\u0440\u0443\u0433 \u043e\u0442 \u0434\u0440\u0443\u0433\u0430, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0442 \u043e\u0431\u0449\u0438\u0439 \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 (\u043c\u0435\u0442\u043e\u0434 update), \u0438 \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0442\u0441\u044f\/\u043e\u0442\u043a\u043b\u044e\u0447\u0430\u044e\u0442\u0441\u044f \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u0447\u043a\u043e\u0439 contacts.addUIElement(new UI_Xxx). \u0415\u0449\u0451 \u043e\u0434\u0438\u043d \u043f\u043b\u044e\u0441 \u2014 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043c\u0435\u0441\u0442\u043e \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0434\u043e\u0441\u0442\u0443\u0447\u0430\u0442\u044c\u0441\u044f \u0434\u043e \u043b\u044e\u0431\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f \u2014 \u044d\u0442\u043e contacts. \u041d\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 UI \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b, \u043e\u043d\u0438 \u0432\u0441\u0435 \u043c\u043e\u0433\u0443\u0442 \u043e\u0431\u0449\u0430\u0442\u044c\u0441\u044f \u0434\u0440\u0443\u0433 \u0441 \u0434\u0440\u0443\u0433\u043e\u043c \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u043a\u043e\u043c\u0430\u043d\u0434 \u0440\u0430\u0441\u0441\u044b\u043b\u0430\u0435\u043c\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c Contacts. \u041f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u043c \u044d\u0442\u043e.<\/p>\n<h2>\u0418\u0441\u043f\u044b\u0442\u0430\u043d\u0438\u0435 \u043d\u0430 \u043f\u0440\u043e\u0447\u043d\u043e\u0441\u0442\u044c<\/h2>\n<p>   \u041d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u0434\u0441\u0432\u0435\u0447\u0438\u0432\u0430\u0442\u044c, \u0447\u044c\u044f \u0437\u0430\u043c\u0435\u0442\u043a\u0430 \u0432 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u043c\u044b \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u044d\u0442\u043e, \u0432\u044b\u0434\u0435\u043b\u0438\u0432 \u0436\u0438\u0440\u043d\u044b\u043c \u0448\u0440\u0438\u0444\u0442\u043e\u043c \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0430\u043a\u0442 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435. \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0435\u0441\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0437\u0430\u043c\u0435\u0442\u043a\u0443 \u0442\u043e\u043b\u044c\u043a\u043e 5 \u0441\u0435\u043a\u0443\u043d\u0434, \u0438 \u043a\u043e\u0433\u0434\u0430 \u043e\u043d\u0430 \u0441\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0443\u0431\u0438\u0440\u0430\u0442\u044c \u0436\u0438\u0440\u043d\u044b\u0439 \u0448\u0440\u0438\u0444\u0442 \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u0430 \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u043e\u0432. <\/p>\n<p>  \u041d\u0430\u0448\u0438 UI \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b\/\u043c\u043e\u0434\u0443\u043b\u0438 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b \u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \u0442\u0430\u0439\u043c\u0435\u0440\u0430 \u0432 UI_List \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e, \u0442\u0430\u043a \u043a\u0430\u043a, \u043f\u0440\u0438 \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 UI_Note, \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0431\u0435\u0441\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u0434. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0442\u0430\u0439\u043c\u0435\u0440 \u0432 \u043f\u044f\u0442\u044c \u0441\u0435\u043a\u0443\u043d\u0434 \u0431\u0443\u0434\u0435\u0442 \u0432 UI_Note, \u0438 \u043f\u043e \u0435\u0433\u043e \u0438\u0441\u0442\u0435\u0447\u0435\u043d\u0438\u0438 \u043c\u044b \u0434\u0430\u0434\u0438\u043c \u0441\u0438\u0433\u043d\u0430\u043b \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0434\u0447\u0435\u0440\u043a\u043d\u0443\u0442\u044b\u0439 \u043a\u043e\u043d\u0442\u0430\u043a\u0442 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043b \u043f\u043e\u0434\u0447\u0451\u0440\u043a\u0438\u0432\u0430\u0442\u044c\u0441\u044f. \u0421\u0438\u0433\u043d\u0430\u043b \u0431\u0443\u0434\u0435\u0442 \u0434\u0430\u043d \u0447\u0435\u0440\u0435\u0437 contacts. <\/p>\n<p>  \u0418\u0442\u0430\u043a, \u043a\u043e\u0434 UI_List:  <\/p>\n<pre><code class=\"javascript\">UI_List = function(containerId) {     this._containerId = containerId } UI_List.prototype.update = function(command, args) {     switch(command)     {         case 'getList':             jQuery('#'+this._containerId).html(                 '&lt;li&gt;&lt;a href=&quot;#&quot; onclick=&quot;contacts.getNote(0);return false;&quot;&gt;\u041f\u0435\u0442\u0440 \u041a\u043e\u043d\u044e\u0448\u0438\u043d petr@konyushin.com&lt;\/a&gt;&lt;\/li&gt;'+                 '&lt;li&gt;&lt;a href=&quot;#&quot; onclick=&quot;contacts.getNote(1);return false;&quot;&gt;\u041a\u0440\u0438\u0441\u0442\u0438\u043d\u0430 \u041b\u043e\u0436\u043a\u0438\u043d\u0430 krispink@mail.ru&lt;\/a&gt;&lt;\/li&gt;'+                 '&lt;li&gt;&lt;a href=&quot;#&quot; onclick=&quot;contacts.getNote(2);return false;&quot;&gt;\u0410\u0440\u0441\u0435\u043d\u0438\u0439 \u041e\u0432\u0430\u043b\u043e\u0432 mrbig@hdfgh.com&lt;\/a&gt;&lt;\/li&gt;')             break         case 'getNote':             var contactId = args             jQuery('#'+this._containerId).children().css('font-weight','normal')             jQuery('#'+this._containerId).children().eq(contactId).css('font-weight','bold')             break         case 'clearSelection':             jQuery('#'+this._containerId).children().css('font-weight','normal')             break      } } <\/code><\/pre>\n<p>   \u041a\u043e\u0434 UI_Note:  <\/p>\n<pre><code class=\"javascript\">UI_Note = function() {     this._timeOut = null     this._visibleForHowManySeconds = 5 } UI_Note.prototype.update = function(command, args) {     var notes = ['\u041e\u0442\u0447\u0451\u0442', '\u0414\u0435\u043d\u044c \u0440\u043e\u0436\u0434\u0435\u043d\u0438\u044f 5 \u044f\u043d\u0432\u0430\u0440\u044f', '\u0414\u043e\u043b\u0433 \u043c\u043d\u0435 500']     var self = this     switch(command)     {         case 'getNote':             clearTimeout(this._timeOut)             var contactId = args             jQuery('#note').html(                 notes[contactId]             )             this._timeOut = setTimeout(                 function(){                     contacts.clearSelection()                 },                 this._visibleForHowManySeconds * 1000             )             break         case 'clearSelection':             jQuery('#note').html('')     } } <\/code><\/pre>\n<p>   \u041a\u043e\u0434, \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0432 contacts.js:  <\/p>\n<pre><code class=\"javascript\">Contacts.prototype.clearSelection = function() {     this._uiUpdate('clearSelection') } <\/code><\/pre>\n<p>   \u0415\u0441\u043b\u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u043e\u0442\u043a\u0440\u044b\u0442\u044c index.html, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c, \u0447\u0442\u043e \u0432\u0441\u0451 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u043e \u043f\u043b\u0430\u043d\u0443. <\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>  \u041f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0445 \u0434\u0440\u0443\u0433 \u043e\u0442 \u0434\u0440\u0443\u0433\u0430 \u043c\u043e\u0434\u0443\u043b\u0435\u0439. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0435\u0451 \u043b\u0435\u0433\u043a\u043e \u043e\u0442\u043b\u0430\u0436\u0438\u0432\u0430\u0442\u044c. \u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0432 \u043b\u043e\u0433\u0438\u043a\u0443 \u0443\u0436\u0435 \u0433\u043e\u0442\u043e\u0432\u044b\u0445 UI \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0438 \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u0430 \u043d\u0435 \u0437\u0430\u0442\u0440\u043e\u043d\u0435\u0442 \u043d\u0438 UI_List, \u043d\u0438 UI_Note. \u0418, \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 UI \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e \u0432 \u043e\u0434\u043d\u043e\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u0435 \u0441 \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u0443\u0434\u043e\u0431\u043d\u044b\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c.<\/p>\n<p>  \u0422\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0443\u0434\u043e\u0431\u0435\u043d \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0445 \u043d\u0430 AJAX. \u0421 \u043b\u0435\u0433\u043a\u043e\u0441\u0442\u044c\u044e \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u043e\u0432\u0435\u0441\u0442\u0438\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043e \u043d\u0430\u0447\u0430\u043b\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0438 \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043e\u0442\u0440\u0435\u0430\u0433\u0438\u0440\u0443\u044e\u0442 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u043e\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043e\u0432 \u0438\/\u0438\u043b\u0438 \u043f\u043e\u043a\u0430\u0437\u043e\u043c \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438. \u041f\u043e\u0441\u043b\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0442\u043e\u0433\u043e \u0436\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 update \u043e\u043f\u043e\u0432\u0435\u0441\u0442\u0438\u0442\u044c \u0432\u0441\u0435 \u0437\u0430\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043e \u043f\u0440\u0438\u0448\u0435\u0434\u0448\u0435\u043c \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438. <\/p>\n<p>  \u0412 \u043a\u043e\u0434\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0448\u0430\u0431\u043b\u043e\u043d \u041d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u0435\u043b\u044c (Observer), Contacts \u2013 observable, \u0430 UI \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u2014 observer. \u041f\u043e\u0434\u043e\u0431\u043d\u043e\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e \u0432 jQuery \u043c\u0435\u0442\u043e\u0434\u043e\u043c trigger, \u0438 \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0432 \u0441\u0440\u0435\u0434\u0435 jQuery \u2014 \u0442\u0435\u043c\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438. \u041f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0432 \u043c\u0435\u043d\u044c\u0448\u0435\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u0444\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0435\u0439, \u0438 \u0432 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043b\u0435\u0433\u043a\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0435 observers, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u043e\u043f\u0435\u0440\u0438\u0440\u0443\u044e\u0442 html \u043a\u043e\u0434\u043e\u043c (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440 \u0444\u043e\u0440\u043c).<\/p>\n<p>  \u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438 \u0438 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0441\u0441\u044b\u043b\u043a\u0438:  <\/p>\n<ul>\n<li>\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u0430 Observer: <a href=\"http:\/\/cpp-reference.ru\/patterns\/behavioral-patterns\/observer\/\">cpp-reference.ru\/patterns\/behavioral-patterns\/observer\/<\/a><\/li>\n<li>\u0417\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043a\u043d\u0438\u0433\u0430 \u043f\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u0430\u043c: \u00ab\u041f\u0430\u0442\u0442\u0435\u0440\u043d\u044b \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f\u00bb \u042d. \u0424\u0440\u0438\u043c\u0435\u043d, \u042d. \u0424\u0440\u0438\u043c\u0435\u043d, \u041a. \u0421\u044c\u0435\u0440\u0440\u0430, \u0411. \u0411\u0435\u0439\u0442\u0441. <\/li>\n<li>\u0425\u043e\u0440\u043e\u0448\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f, \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u043d\u0430\u044f \u041e\u041e\u041f \u0432 JavaScript: <a href=\"http:\/\/tobyho.com\/2010\/11\/22\/javascript-constructors-and\/\">tobyho.com\/2010\/11\/22\/javascript-constructors-and\/<\/a><\/li>\n<\/ul>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/165429\/\"> http:\/\/habrahabr.ru\/post\/165429\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\"> \t\t\t\u0412 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u0435, \u0435\u0441\u043b\u0438 \u043d\u0435\u0442 \u0441\u0438\u0434\u0435\u043d\u0438\u044f, \u0442\u043e \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u044c \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e, \u0430 \u0435\u0441\u043b\u0438 \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u044c \u0441\u043b\u043e\u043c\u0430\u0435\u0442\u0441\u044f, \u0442\u043e \u0440\u0443\u0447\u043d\u043e\u0439 \u0442\u043e\u0440\u043c\u043e\u0437 \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u043f\u043e\u0441\u0442\u0440\u0430\u0434\u0430\u0435\u0442. \u042d\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u044f\u0449\u0438\u0445 \u0434\u0440\u0443\u0433 \u043e\u0442 \u0434\u0440\u0443\u0433\u0430 \u043c\u043e\u0434\u0443\u043b\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043f\u043e\u0441\u043b\u0435 \u043e\u0442\u043a\u0430\u0437\u0430 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u043d\u0438\u0445 \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c. \u0412\u043e\u0434\u0438\u0442\u0435\u043b\u044e \u0436\u0435, \u0432 \u0438\u0434\u0435\u0430\u043b\u0435, \u043d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0437\u043d\u0430\u0442\u044c, \u043a\u0430\u043a \u0443\u0441\u0442\u0440\u043e\u0435\u043d \u043c\u043e\u0442\u043e\u0440 \u0438\u043b\u0438 \u0442\u043e\u0440\u043c\u043e\u0437, \u043a\u0430\u0436\u0434\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0435\u043c\u0443 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u0442\u0430\u043a\u043e\u0439, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u0430\u043a \u043f\u0435\u0434\u0430\u043b\u044c \u0433\u0430\u0437\u0430 \u0438\u043b\u0438 \u043a\u043d\u043e\u043f\u043a\u0430 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0444\u0430\u0440. <\/p>\n<p>  \u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0442\u0435\u043a\u0441\u0442\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0438 \u043d\u0430\u0434 HTML \u043a\u043e\u0434\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u043f\u043e\u0445\u043e\u0436\u0438\u043c \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u043e\u043c, \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0441\u043b\u0430\u0431\u044b\u043c \u0441\u0432\u044f\u0437\u044f\u043c \u0438 \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u043e\u0441\u0442\u0438. \u0422\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u0440\u043e\u043c \u0432 \u0434\u0432\u0443\u0445 \u0434\u043e\u043b\u0433\u043e\u0441\u0440\u043e\u0447\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445, \u043e\u0434\u0438\u043d \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u2014 \u0441\u0435\u0440\u0432\u0438\u0441 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u0431\u0430\u043d\u043a\u0438\u043d\u0433\u0430.    <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-165429","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/165429","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=165429"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/165429\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=165429"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=165429"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=165429"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}