{"id":202484,"date":"2013-11-19T11:17:03","date_gmt":"2013-11-19T07:17:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=202484"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=202484","title":{"rendered":"<span class=\"post_title\">WidLib \u2013 \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0439 js-\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0432\u0438\u0434\u0436\u0435\u0442\u043e\u0432<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u044f \u0445\u043e\u0442\u0435\u043b \u0431\u044b \u0430\u043d\u043e\u043d\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c js-\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0434\u0438\u0430\u043b\u043e\u0433\u043e\u0432\u044b\u0435 \u043c\u0438\u043a\u0440\u043e-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0440\u043e\u043a js-\u043a\u043e\u0434\u0430, \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u043c\u043e\u0433\u043e \u043c\u0435\u0436\u0434\u0443 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u043c \u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c.<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/8d5\/9df\/36e\/8d59df36e210e0392894d63cd90c921f.png\"\/><\/p>\n<p>  <i>\u0418\u0434\u0435\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e, \u0443\u0434\u043e\u0431\u043d\u043e\u0433\u043e \u0438 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u0434 \u0434\u0438\u0430\u043b\u043e\u0433\u043e\u0432\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0444\u0440\u0435\u0439\u043c\u043e\u0432\u043e\u0440\u043a\u0430 \u0440\u043e\u0434\u0438\u043b\u0430\u0441\u044c \u043f\u043e\u0441\u043b\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043b\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430\u0448\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0441 \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u043c\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c\u0438. \u041d\u0430\u043c \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u0432\u0438\u0434\u0436\u0435\u0442\u043e\u0432, \u043d\u0435 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0439 \u0441\u043b\u043e\u0436\u043d\u044b\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u043d\u0430\u043b\u043e\u043c \u0438 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0437\u0430\u0442\u043e\u0447\u0435\u043d\u043d\u044b\u0439 \u043f\u043e\u0434 \u043a\u043e\u043d\u043a\u0440\u0435\u043d\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443. \u0412 \u0438\u0442\u043e\u0433\u0435 \u043c\u044b \u043f\u0440\u0438\u0448\u043b\u0438 \u043a \u0440\u0435\u0448\u0435\u043d\u0438\u044e \u043f\u0435\u0440\u0435\u043a\u0440\u043e\u0438\u0442\u044c \u043d\u0430\u0448\u0438 \u043d\u0430\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044e \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430.<\/i><\/p>\n<p>  \u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0430 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432, WidLib \u043d\u0435 \u043f\u0440\u0435\u0442\u0435\u043d\u0434\u0443\u0435\u0442 \u043d\u0430 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c: \u043e\u043d \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043c\u043d\u043e\u0433\u043e\u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043d\u044b\u0445 \u0434\u0438\u0430\u043b\u043e\u0433\u043e\u0432\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h5>\u0421\u043f\u0435\u043a\u0442\u0440 \u0437\u0430\u0434\u0430\u0447<\/h5>\n<ol>\n<li>\u0412\u0438\u0434\u0436\u0435\u0442\u044b \u0437\u0430\u043a\u0430\u0437\u0430 \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0438<\/li>\n<li>Wi-Fi \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f (\u043f\u0443\u0442\u0435\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c \u043f\u043e \u0442\u043e\u0440\u0433\u043e\u0432\u043e\u043c\u0443 \u0446\u0435\u043d\u0442\u0440\u0443 \u0438\u043b\u0438 \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0435 \u043c\u0435\u043d\u044e \u043f\u0440\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u043a \u043c\u0435\u0441\u0442\u043d\u043e\u043c\u0443 Wi-Fi)<\/li>\n<li>\u041a\u0430\u043b\u044c\u043a\u0443\u043b\u044f\u0442\u043e\u0440\u044b (\u043a\u0440\u0435\u0434\u0438\u0442\u044b, \u043f\u043b\u0430\u0441\u0442\u0438\u043a\u043e\u0432\u044b\u0435 \u043e\u043a\u043d\u0430 \u0438 \u0434\u0432\u0435\u0440\u0438)<\/li>\n<li>\u0424\u043e\u0440\u043c\u044b \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0438 \u043d\u0430 \u0441\u0430\u0439\u0442\u0435<\/li>\n<li>\u0412\u0438\u043a\u0442\u043e\u0440\u0438\u043d\u044b (\u0438\u0433\u0440\u043e\u0432\u044b\u0435, \u0430 \u0442\u0430\u043a \u0436\u0435 \u0434\u043b\u044f \u043c\u0430\u0440\u043a\u0435\u0442\u0438\u043d\u0433\u043e\u0432\u044b\u0445 \u0430\u043a\u0446\u0438\u0439 \u0438 \u0440\u043e\u0437\u044b\u0433\u0440\u044b\u0448\u0435\u0439) <\/li>\n<li>\u0422\u0435\u0441\u0442\u044b (\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043a\u043e\u043c\u043f\u0435\u0442\u0435\u043d\u0446\u0438\u0439, \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0435, \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u043a\u0430\u0434\u0440\u0430\u043c\u0438)<\/li>\n<li>\u041e\u043d\u043b\u0430\u0439\u043d-\u043f\u043e\u043c\u043e\u0449\u043d\u0438\u043a\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e\u0434\u0431\u043e\u0440 \u0442\u0443\u0440\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0430 \u0438\u043b\u0438 \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442 \u043a\u043e\u043b\u043b-\u0446\u0435\u043d\u0442\u0440\u0430)<\/li>\n<li>\u0412\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u043d\u0438\u0435 \u0432\u0438\u0434\u0436\u0435\u0442\u043e\u0432 \u0432 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f (\u0437\u0434\u0435\u0441\u044c \u043e\u043d \u043f\u043e\u0445\u043e\u0436 \u043d\u0430 PhoneGap)<\/li>\n<li>\u0414\u0438\u0430\u043b\u043e\u0433\u043e\u0432\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0441\u043e\u0446\u0441\u0435\u0442\u0435\u0439 (\u043e\u043f\u044f\u0442\u044c-\u0442\u0430\u043a\u0438 \u0432\u0438\u043a\u0442\u043e\u0440\u0438\u043d\u044b, \u043d\u0435\u043b\u0438\u043d\u0435\u0439\u043d\u044b\u0435 \u043e\u043f\u0440\u043e\u0441\u044b)<\/li>\n<li>\u0411\u0440\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 (\u0431\u0438\u043b\u0435\u0442\u044b \u043d\u0430 \u0441\u0430\u043c\u043e\u043b\u0435\u0442, \u043d\u043e\u043c\u0435\u0440 \u0432 \u0433\u043e\u0441\u0442\u0438\u043d\u0438\u0446\u0435 \u0438\u043b\u0438 \u0432\u0440\u0435\u043c\u044f \u0443 \u0441\u0442\u043e\u043c\u0430\u0442\u043e\u043b\u043e\u0433\u0430)<\/li>\n<li>\u0438 \u0442.\u0434.<\/li>\n<\/ol>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c DSL, \u043c\u044b \u0441\u043f\u0440\u043e\u0441\u0438\u043b\u0438 \u0441\u0435\u0431\u044f \u2013 \u043a\u0430\u043a\u0438\u043c \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0432\u0438\u0434\u0435\u0442\u044c \u043f\u0440\u0435\u0434\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0439, \u043d\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0433\u0438\u0431\u043a\u0438\u0439 \u044f\u0437\u044b\u043a \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f (\u0438 \u0432 \u043c\u0435\u043d\u044c\u0448\u0435\u0439 \u0441\u0442\u0435\u043f\u0435\u043d\u0438 \u2013 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f) \u044d\u0442\u0438\u0445 \u0434\u0438\u0430\u043b\u043e\u0433\u043e\u0432\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. \u041c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u043f\u043e\u0434\u0445\u043e\u0434 convention over configuration, \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u0439 \u043f\u043e Ruby on Rails. \u041f\u0440\u043e\u0441\u0442\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0438\u0448\u0443\u0442\u0441\u044f \u0432 \u0442\u0440\u0438 \u0441\u0442\u0440\u043e\u0447\u043a\u0438, \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u2013 \u0447\u0443\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435.<br \/>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0432\u0438\u0434\u0436\u0435\u0442\u0430 \u043f\u043e \u0437\u0430\u043a\u0430\u0437\u0443 \u043f\u0438\u0446\u0446\u044b \u043d\u0430 \u0441\u0430\u0439\u0442\u0435:<br \/>  (DSL \u0435\u0449\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u043a\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442\u0441\u044f.)<img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/938\/5a0\/36b\/9385a036b403dce2465741dcb652aeaf.png\"\/><\/p>\n<h6>Coffeescript<\/h6>\n<pre><code class=\"coffeescript\">widlib=require(&quot;widlib-server&quot;) server=widlib.init   # \u041c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043b\u044e\u0431\u043e\u0439 \u0448\u0430\u0431\u043b\u043e\u043d\u0438\u0437\u0430\u0442\u043e\u0440 (index_template=Handlebars.compile(&quot;...&quot;)),   # \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u043e\u0431\u044a\u0435\u043a\u0442 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b, \u0448\u0430\u0431\u043b\u043e\u043d \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 @app.template   template: index_template   pages:     type:       # \u0448\u0430\u0431\u043b\u043e\u043d\u044b \u043c\u043e\u0436\u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u0438\u043d\u0434\u0438\u0432\u0438\u0434\u0443\u0430\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b       template: type_template # @app.pages[&quot;type&quot;].template       body: &quot;\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043f\u0438\u0446\u0446\u0443&quot;       # \u043f\u0440\u0438 \u043a\u043b\u0438\u043a\u0435 \u043d\u0430 \u0441\u0441\u044b\u043b\u043a\u0443 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 submit, \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 (\u0435\u0441\u043b\u0438 \u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u043e \u044f\u0432\u043d\u043e)       # \u0442\u0430\u043a\u0436\u0435 \u0443 \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0435\u0441\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u044f onLeave, onEnter       inputs: [         { value: &quot;\u041c\u0430\u0440\u0433\u0430\u0440\u0438\u0442\u0430&quot;, type: &quot;link&quot;, name: &quot;type&quot;, price: 350 },         { value: &quot;\u041f\u0435\u043f\u043f\u0435\u0440\u043e\u043d\u0438&quot;, type: &quot;link&quot;, name: &quot;type&quot;, price: 360 },         { value: &quot;\u0424\u0438\u043b\u0430\u0434\u0435\u043b\u044c\u0444\u0438\u044f&quot;, type: &quot;link&quot;, name: &quot;type&quot;, price: 370 },         { value: &quot;\u0427\u0435\u0442\u044b\u0440\u0435 \u0441\u044b\u0440\u0430&quot;, type: &quot;link&quot;, name: &quot;type&quot;, price: 380 },       ]      size:       body: &quot;\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0440\u0430\u0437\u043c\u0435\u0440&quot;       # \u0435\u0441\u043b\u0438 \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e - \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0435\u043d\u0438\u0432\u043e       inputs: -&gt;         price = @session.input(&quot;type&quot;).price # session - \u0445\u0440\u0430\u043d\u0438\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0441\u0435\u0441\u0441\u0438\u0438. @session.input(&quot;type&quot;) \u043f\u0440\u0438\u0441\u0432\u043e\u0438\u043b\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u0441\u043b\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b type.         [           { value: &quot;30&quot;, type: &quot;link&quot;, name: &quot;size&quot;, price: price },           { value: &quot;40&quot;, type: &quot;link&quot;, name: &quot;size&quot;, price: price*1.2 },           { value: &quot;50&quot;, type: &quot;link&quot;, name: &quot;size&quot;, price: price*1.5 },         ]       # \u043c\u043e\u0436\u043d\u043e \u0432 \u044f\u0432\u043d\u043e\u043c \u0432\u0438\u0434\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0438\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e       onSubmit: &quot;address&quot;      address:       body: &quot;\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0430\u0434\u0440\u0435\u0441&quot;       inputs: [ { name: &quot;address&quot;, type: &quot;text&quot;, placeholder: &quot;\u0443\u043b\u0438\u0446\u0430, \u0434\u043e\u043c, \u043f\u043e\u0434\u044a\u0435\u0437\u0434, \u043a\u0432\u0430\u0440\u0442\u0438\u0440\u0430&quot; }, { type: &quot;submit&quot;, value: &quot;\u0414\u0430\u043b\u0435\u0435&quot; } ]      phone:       body: &quot;\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0442\u0435\u043b\u0435\u0444\u043e\u043d&quot;       inputs: [ { name: &quot;phone&quot;, type: &quot;text&quot;, placeholder: &quot;+7 xxx xx xx&quot; }, { type: &quot;submit&quot;, value: &quot;\u0414\u0430\u043b\u0435\u0435&quot; }]       onSubmit: -&gt; # \u0442\u0430\u043a\u0436\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u044f onLoad, on         @data(&quot;orders&quot;).push @session.values() # \u0434\u0430\u043d\u043d\u044b\u0435 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0432 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435         @data(&quot;email&quot;).push email_template(@session.values())         &quot;success&quot; # \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0438\u043c\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b      success:       body: &quot;\u0412\u0430\u0448\u0430 \u043f\u0438\u0446\u0446\u0430 \u0443\u0436\u0435 \u0435\u0434\u0435\u0442 \u043a \u0432\u0430\u043c&quot;       image: -&gt; &quot;\/images\/#{@session.value(&quot;type&quot;)}.jpg&quot; # \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 image \u0434\u043b\u044f view    data:     orders:       type: &quot;spreadsheet&quot; # \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043c\u043e\u0434\u0443\u043b\u0438 \u0434\u043b\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 API \u043c\u043e\u0436\u043d\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438\u043b\u0438 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u0432\u043d\u0435\u0448\u043d\u0438\u043c\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438       url: &quot;https:\/\/docs.google.com\/spreadsheet\/ccc?key=0Au4e-jj1-69ZdEloMW03UExKLXIZFSUE&quot;     email:       type: &quot;email&quot;       to: &quot;1@interactiff.net&quot;  server.listen &quot;3000&quot; <\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434 \u0431\u0435\u0437 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"coffeescript\">widlib=require(&quot;widlib-server&quot;) server=widlib.init   template: index_template   pages:     type:       template: type_template       body: &quot;\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043f\u0438\u0446\u0446\u0443&quot;       inputs: [         { value: &quot;\u041c\u0430\u0440\u0433\u0430\u0440\u0438\u0442\u0430&quot;, type: &quot;link&quot;, name: &quot;type&quot;, price: 350 },         { value: &quot;\u041f\u0435\u043f\u043f\u0435\u0440\u043e\u043d\u0438&quot;, type: &quot;link&quot;, name: &quot;type&quot;, price: 360 },         { value: &quot;\u0424\u0438\u043b\u0430\u0434\u0435\u043b\u044c\u0444\u0438\u044f&quot;, type: &quot;link&quot;, name: &quot;type&quot;, price: 370 },         { value: &quot;\u0427\u0435\u0442\u044b\u0440\u0435 \u0441\u044b\u0440\u0430&quot;, type: &quot;link&quot;, name: &quot;type&quot;, price: 380 },       ]      size:       body: &quot;\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0440\u0430\u0437\u043c\u0435\u0440&quot;       inputs: -&gt;         price = @session.value(&quot;type&quot;).price         [           { value: &quot;30&quot;, type: &quot;link&quot;, name: &quot;size&quot;, price: price },           { value: &quot;40&quot;, type: &quot;link&quot;, name: &quot;size&quot;, price: price*1.2 },           { value: &quot;50&quot;, type: &quot;link&quot;, name: &quot;size&quot;, price: price*1.5 },         ]       onSubmit: &quot;address&quot;      address:       body: &quot;\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0430\u0434\u0440\u0435\u0441&quot;       inputs: [ { name: &quot;address&quot;, type: &quot;text&quot;, placeholder: &quot;\u0443\u043b\u0438\u0446\u0430, \u0434\u043e\u043c, \u043f\u043e\u0434\u044a\u0435\u0437\u0434, \u043a\u0432\u0430\u0440\u0442\u0438\u0440\u0430&quot; }, { type: &quot;submit&quot;, value: &quot;\u0414\u0430\u043b\u0435\u0435&quot; } ]      phone:       body: &quot;\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0442\u0435\u043b\u0435\u0444\u043e\u043d&quot;       inputs: [ { name: &quot;phone&quot;, type: &quot;text&quot;, placeholder: &quot;+7 xxx xx xx&quot; }, { type: &quot;submit&quot;, value: &quot;\u0414\u0430\u043b\u0435\u0435&quot; }]       onSubmit: -&gt; # \u0442\u0430\u043a\u0436\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u044f onLoad, on         @data(&quot;orders&quot;).push @session.values()         @data(&quot;email&quot;).push email_template(@session.values())         &quot;success&quot;       success:       body: &quot;\u0412\u0430\u0448\u0430 \u043f\u0438\u0446\u0446\u0430 \u0443\u0436\u0435 \u0435\u0434\u0435\u0442 \u043a \u0432\u0430\u043c&quot;       image: -&gt; &quot;\/images\/#{@session.value(&quot;type&quot;)}.jpg&quot;    data:     orders:       type: &quot;spreadsheet&quot;       url: &quot;https:\/\/docs.google.com\/spreadsheet\/ccc?key=0Au4e-jj1-69ZdEloMW03UExKLXIZFSUE&quot;     email:       type: &quot;email&quot;       to: &quot;1@interactiff.net&quot;  server.listen &quot;3000&quot; <\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0412 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0435 \u043d\u0430 JS<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">var client, server, widlib;  widlib = require(&quot;widlib-server&quot;);  server = widlib.init({   template: index_template,   pages: {     type: {       template: type_template,       body: &quot;\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043f\u0438\u0446\u0446\u0443&quot;,       inputs: [         { value: &quot;\u041c\u0430\u0440\u0433\u0430\u0440\u0438\u0442\u0430&quot;, type: &quot;link&quot;, name: &quot;type&quot;, price: 350 },         { value: &quot;\u041f\u0435\u043f\u043f\u0435\u0440\u043e\u043d\u0438&quot;, type: &quot;link&quot;, name: &quot;type&quot;, price: 360 },         { value: &quot;\u0424\u0438\u043b\u0430\u0434\u0435\u043b\u044c\u0444\u0438\u044f&quot;, type: &quot;link&quot;, name: &quot;type&quot;, price: 370 },         { value: &quot;\u0427\u0435\u0442\u044b\u0440\u0435 \u0441\u044b\u0440\u0430&quot;, type: &quot;link&quot;, name: &quot;type&quot;, price: 380 },       ]     },     size: {       body: &quot;\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0440\u0430\u0437\u043c\u0435\u0440&quot;,       inputs: function() {         var price;         price = this.session.input(&quot;type&quot;).price;         return [           { value: &quot;30&quot;, type: &quot;link&quot;, name: &quot;size&quot;, price: price },           { value: &quot;40&quot;, type: &quot;link&quot;, name: &quot;size&quot;, price: price*1.2 },           { value: &quot;50&quot;, type: &quot;link&quot;, name: &quot;size&quot;, price: price*1.5 },         ];       },       onSubmit: &quot;address&quot;     },     address: {       body: &quot;\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0430\u0434\u0440\u0435\u0441&quot;,       inputs: [ { name: &quot;address&quot;, type: &quot;text&quot;, placeholder: &quot;\u0443\u043b\u0438\u0446\u0430, \u0434\u043e\u043c, \u043f\u043e\u0434\u044a\u0435\u0437\u0434, \u043a\u0432\u0430\u0440\u0442\u0438\u0440\u0430&quot; }, { type: &quot;submit&quot;, value: &quot;\u0414\u0430\u043b\u0435\u0435&quot; } ]     },     phone: {       body: &quot;\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0442\u0435\u043b\u0435\u0444\u043e\u043d&quot;,       inputs: [ { name: &quot;phone&quot;, type: &quot;text&quot;, placeholder: &quot;+7 xxx xx xx&quot; }, { type: &quot;submit&quot;, value: &quot;\u0414\u0430\u043b\u0435\u0435&quot; }],       onSubmit: function() {         this.data(&quot;orders&quot;).push(this.session.values());         this.data(&quot;email&quot;).push(email_template(this.session.values()));         return &quot;success&quot;;       }     },     success: {       body: &quot;\u0412\u0430\u0448\u0430 \u043f\u0438\u0446\u0446\u0430 \u0443\u0436\u0435 \u0435\u0434\u0435\u0442 \u043a \u0432\u0430\u043c&quot;,       image: function() {         return &quot;\/images\/&quot; + (this.session.value(&quot;type&quot;)) + &quot;.jpg&quot;;       }     }   },   data: {     orders: {       type: &quot;spreadsheet&quot;,       url: &quot;https:\/\/docs.google.com\/spreadsheet\/ccc?key=0Au4e-jj1-69ZdEloMW03UExKLXI3cGRlbkJteGZFSUE#gid=0&quot;     },     email: {       type: &quot;email&quot;,       to: &quot;1@interactiff.net&quot;     }   } });  server.listen(&quot;3000&quot;);<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u041f\u0435\u0440\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u043e\u0439 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442 widget \u0438 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0432 \u043d\u0435\u0433\u043e \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439.<br \/>  \u041e\u0431\u044a\u0435\u043a\u0442 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u041a\u0430\u0436\u0434\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u2013 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u044d\u043a\u0440\u0430\u043d, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u0432\u0438\u0434\u0438\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0432 \u044d\u0442\u043e\u043c \u0432\u0438\u0434\u0436\u0435\u0442\u0435.<\/p>\n<p>  \u041a\u0430\u0436\u0434\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u0443 \u0434\u043b\u044f \u0438\u0445 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438. \u0412 \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u2013 \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043c\u0430\u0441\u0441\u0438\u0432, \u0432 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u2013 REST \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, MongoDB, Google Spreadsheet \u0438 \u043f\u0440\u043e\u0447\u0438\u0435.<\/p>\n<p>  \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439, \u043a\u0430\u043a \u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0435 (\u0432 \u0442.\u0447. standalone), \u0442\u0430\u043a \u0438 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 node.js. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043a\u0440\u044b\u0442\u044c \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u0438\u043b\u0438 \u0435\u0433\u043e \u0447\u0430\u0441\u0442\u044c \u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u043a\u0430\u043b\u044c\u043a\u0443\u043b\u044f\u0442\u043e\u0440\u0430 \u043a\u0440\u0435\u0434\u0438\u0442\u0430 \u0438\u043b\u0438 \u0432\u0438\u043a\u0442\u043e\u0440\u0438\u043d\u044b \u0441 \u0440\u043e\u0437\u044b\u0433\u0440\u044b\u0448\u0435\u043c \u043f\u0440\u0438\u0437\u043e\u0432, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0434\u0430\u0451\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u043c \u0438 API, \u0430\u0433\u0440\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438.<br \/>  \u041a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0432\u0438\u0434\u0436\u0435\u0442\u0430 \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0438 \u043f\u0438\u0446\u0446\u044b, \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0443\u0441\u0442\u0430\u044f:<\/p>\n<pre><code class=\"coffeescript\">client=new Widlib.Client   # \u0437\u0434\u0435\u0441\u044c \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u0442 \u0436\u0435 \u0441\u0430\u043c\u044b\u0439 \u043a\u043e\u0434, \u0447\u0442\u043e \u0438 \u0432 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438.   # pages: ...   # data: ...   server: &quot;\/&quot;   container: &quot;#container&quot; <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/356\/a7b\/8bd\/356a7b8bd5dc0333df3b9be86bd84346.png\"\/><\/p>\n<p>  \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0443 \u0434\u0430\u0436\u0435 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u0431\u043e\u0442\u0438\u0442\u044c\u0441\u044f, \u043a\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e, \u0438 \u0432 \u043a\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0431\u043c\u0435\u043d\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c. \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u0438\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u043d\u0435\u0437\u0430\u043c\u0435\u0442\u043d\u043e \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u0440\u0430 \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442 \u0438\u0445 \u0443 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 (\u0438\u043b\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442), \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f RPC. \u0421\u0435\u0440\u0432\u0435\u0440\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u043e\u0431\u043b\u0430\u0434\u0430\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043b\u043d\u044b\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u043e\u043c, \u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0438 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0435\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043d\u0435 \u0431\u0435\u0441\u043f\u043e\u043a\u043e\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440 \u043f\u043e \u043f\u0443\u0441\u0442\u044f\u043a\u0430\u043c.<\/p>\n<h5>\u0424\u0438\u0447\u0438<\/h5>\n<ul>\n<li>\u0414\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0441\u0442\u0438\u043b\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f<\/li>\n<li>\u0414\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043d\u0430\u0432\u044b\u043a\u043e\u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f<\/li>\n<li>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u044b (\u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0442\u0430\u043a\u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u0438 \u0432\u0438\u0437\u0430\u0440\u0434\u044b \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0432\u0438\u0434\u0436\u0435\u0442\u043e\u0432 \u043e\u0431\u044b\u0432\u0430\u0442\u0435\u043b\u044f\u043c\u0438)<\/li>\n<li>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e html-\u0448\u0430\u0431\u043b\u043e\u043d\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u0438 \u0431\u0438\u043d\u0434\u0438\u043d\u0433\u0430 <a href=\"http:\/\/rivetsjs.com\/\">rivets.js<\/a> (\u043f\u043e\u0434\u043e\u0431\u0435\u043d \u0442\u0430\u043a\u043e\u0432\u043e\u043c\u0443 \u0432 AngularJS). \u0421\u043a\u0440\u0438\u043f\u0442 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430<\/li>\n<li>\u041d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u043e\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 DOM<\/li>\n<li>\u0420\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u0439 \u043a\u043e\u0434 \u043c\u0435\u0436\u0434\u0443 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u043c \u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c<\/li>\n<li>\u041d\u0435\u0437\u0430\u043c\u0435\u0442\u043d\u044b\u0439 fallback \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u043e\u0433\u043e \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u043c\u0443 \u0441\u043a\u0440\u0438\u043f\u0442\u0443.<\/li>\n<\/ul>\n<p>  \u0412\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 WidLib \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0443\u0436\u0435 \u0432 \u0434\u0435\u043a\u0430\u0431\u0440\u0435.<br \/>  \u041f\u0440\u0438\u0437\u044b\u0432\u0430\u044e \u0432\u0430\u0441 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445 \u043e\u043f\u0438\u0441\u0430\u0442\u044c, \u0433\u0434\u0435 \u0431\u044b \u0432\u044b \u0445\u043e\u0442\u0435\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a.<\/p>\n<p>  P.S. \u0434\u043b\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0438\u0441\u0447\u0435\u0440\u043f\u044b\u0432\u0430\u044e\u0449\u0430\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f, \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0438 \u0432\u0438\u0437\u0430\u0440\u0434\u043e\u0432, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u0432\u0435\u0440\u0445\u0448\u0443\u0441\u0442\u0440\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0432\u0438\u0434\u0436\u0435\u0442\u043e\u0432 \u0441 \u043f\u043b\u044e\u0448\u043a\u0430\u043c\u0438 \u0432 \u0432\u0438\u0434\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c API.  \t\t\t\t<\/p>\n<div class=\"polling\">\n<form action=\"\/json\/polling\/\" class=\"poll\" method=\"post\">\n<div class=\"poll_title\">\u041d\u0443\u0436\u0435\u043d \u043b\u0438 \u0432\u0430\u043c \u0442\u0430\u043a\u043e\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a?<\/div>\n<p>  \t\t<input type=\"hidden\" name=\"post_id\" value=\"202484\"\/> \t\t<input type=\"hidden\" name=\"polling_question_id\" value=\"9582\"\/>  \t\t<\/p>\n<table class=\"answer\">\n<tr>\n<td class=\"input\"> \t\t\t\t\t<input type=\"radio\" id=\"vv48874\" \t\t\t\t\t\tclass=\"radio js-field-data\" \t\t\t\t\t\tname=\"variant[]\" \t\t\t\t\t\tvalue=\"48874\" \/> \t\t\t\t<\/td>\n<td class=\"label\"> \t\t\t\t\t<label for=\"vv48874\">\u0414\u0430, \u043d\u0443\u0436\u0435\u043d<\/label> \t\t\t\t<\/td>\n<\/tr>\n<tr>\n<td class=\"input\"> \t\t\t\t\t<input type=\"radio\" id=\"vv48876\" \t\t\t\t\t\tclass=\"radio js-field-data\" \t\t\t\t\t\tname=\"variant[]\" \t\t\t\t\t\tvalue=\"48876\" \/> \t\t\t\t<\/td>\n<td class=\"label\"> \t\t\t\t\t<label for=\"vv48876\">\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f<\/label> \t\t\t\t<\/td>\n<\/tr>\n<tr>\n<td class=\"input\"> \t\t\t\t\t<input type=\"radio\" id=\"vv48878\" \t\t\t\t\t\tclass=\"radio js-field-data\" \t\t\t\t\t\tname=\"variant[]\" \t\t\t\t\t\tvalue=\"48878\" \/> \t\t\t\t<\/td>\n<td class=\"label\"> \t\t\t\t\t<label for=\"vv48878\">\u041d\u0435\u0442, \u0434\u043b\u044f \u044d\u0442\u0438\u0445 \u0446\u0435\u043b\u0435\u0439 \u044f \u043b\u0443\u0447\u0448\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u2026 (\u043f\u0440\u043e\u0448\u0443 \u043e\u0442\u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445)<\/label> \t\t\t\t<\/td>\n<\/tr>\n<tr>\n<td class=\"input\"> \t\t\t\t\t<input type=\"radio\" id=\"vv48880\" \t\t\t\t\t\tclass=\"radio js-field-data\" \t\t\t\t\t\tname=\"variant[]\" \t\t\t\t\t\tvalue=\"48880\" \/> \t\t\t\t<\/td>\n<td class=\"label\"> \t\t\t\t\t<label for=\"vv48880\">\u042f \u043d\u0435 \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0441\u044c \u0442\u0430\u043a\u0438\u043c\u0438 \u0432\u0435\u0449\u0430\u043c\u0438<\/label> \t\t\t\t<\/td>\n<\/tr>\n<\/table>\n<p class=\"for_users_only_msg\">\u0422\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043c\u043e\u0433\u0443\u0442 \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432 \u043e\u043f\u0440\u043e\u0441\u0435. <a href=\"https:\/\/auth.habrahabr.ru\/login\/\">\u0412\u043e\u0439\u0434\u0438\u0442\u0435<\/a>, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430.<\/p>\n<p class=\"total\">\u041f\u0440\u043e\u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043b 1 \u0447\u0435\u043b\u043e\u0432\u0435\u043a. \u0412\u043e\u0437\u0434\u0435\u0440\u0436\u0430\u0432\u0448\u0438\u0445\u0441\u044f \u043d\u0435\u0442.<\/p>\n<\/p><\/form>\n<\/p><\/div>\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\/202484\/\"> http:\/\/habrahabr.ru\/post\/202484\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u044f \u0445\u043e\u0442\u0435\u043b \u0431\u044b \u0430\u043d\u043e\u043d\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c js-\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0434\u0438\u0430\u043b\u043e\u0433\u043e\u0432\u044b\u0435 \u043c\u0438\u043a\u0440\u043e-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0440\u043e\u043a js-\u043a\u043e\u0434\u0430, \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u043c\u043e\u0433\u043e \u043c\u0435\u0436\u0434\u0443 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u043c \u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c.<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/8d5\/9df\/36e\/8d59df36e210e0392894d63cd90c921f.png\"\/><\/p>\n<p>  <i>\u0418\u0434\u0435\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e, \u0443\u0434\u043e\u0431\u043d\u043e\u0433\u043e \u0438 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u0434 \u0434\u0438\u0430\u043b\u043e\u0433\u043e\u0432\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0444\u0440\u0435\u0439\u043c\u043e\u0432\u043e\u0440\u043a\u0430 \u0440\u043e\u0434\u0438\u043b\u0430\u0441\u044c \u043f\u043e\u0441\u043b\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043b\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430\u0448\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0441 \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u043c\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c\u0438. \u041d\u0430\u043c \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u0432\u0438\u0434\u0436\u0435\u0442\u043e\u0432, \u043d\u0435 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0439 \u0441\u043b\u043e\u0436\u043d\u044b\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u043d\u0430\u043b\u043e\u043c \u0438 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0437\u0430\u0442\u043e\u0447\u0435\u043d\u043d\u044b\u0439 \u043f\u043e\u0434 \u043a\u043e\u043d\u043a\u0440\u0435\u043d\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443. \u0412 \u0438\u0442\u043e\u0433\u0435 \u043c\u044b \u043f\u0440\u0438\u0448\u043b\u0438 \u043a \u0440\u0435\u0448\u0435\u043d\u0438\u044e \u043f\u0435\u0440\u0435\u043a\u0440\u043e\u0438\u0442\u044c \u043d\u0430\u0448\u0438 \u043d\u0430\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044e \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430.<\/i><\/p>\n<p>  \u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0430 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432, WidLib \u043d\u0435 \u043f\u0440\u0435\u0442\u0435\u043d\u0434\u0443\u0435\u0442 \u043d\u0430 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c: \u043e\u043d \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043c\u043d\u043e\u0433\u043e\u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043d\u044b\u0445 \u0434\u0438\u0430\u043b\u043e\u0433\u043e\u0432\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439.  <\/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-202484","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/202484","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=202484"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/202484\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=202484"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=202484"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=202484"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}