{"id":167647,"date":"2013-01-30T15:17:03","date_gmt":"2013-01-30T11:17:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=167647"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=167647","title":{"rendered":"<span class=\"post_title\">\u0420\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 HTML \u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/c21\/0d5\/1a1\/c210d51a1baf047683a80049f338426c.png\" alt=\"image\"\/><br \/>  \u0412 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0433\u043e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0441\u0430\u0439\u0442\u0430-\u0437\u0430\u0433\u043b\u0443\u0448\u043a\u0438 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u044c \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441. \u0427\u0442\u043e \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c?<a name=\"habracut\"><\/a><\/p>\n<p>  \u0418\u0442\u0430\u043a \u0446\u0435\u043b\u044c \u2014 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0443\u0434\u043e\u0431\u043d\u043e\u0433\u043e \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 HTML \u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435. \u0420\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u0438\u043c\u0435\u0435\u0442 \u0434\u0432\u0430 \u0440\u0435\u0436\u0438\u043c\u0430. \u0420\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0442\u0435\u043a\u0441\u0442\u0430 \u0438 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 HTML.<br \/>  \u0420\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0442\u0435\u043a\u0441\u0442\u0430 \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043a\u043b\u0438\u043a\u043e\u043c \u043d\u0430 \u043d\u0443\u0436\u043d\u043e\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0435. \u0414\u043b\u044f \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f HTML \u0434\u0435\u043b\u0430\u0435\u043c \u0434\u0432\u043e\u0439\u043d\u044b\u043c \u043a\u043b\u0438\u043a.<br \/>  \u0412 \u0440\u0435\u0436\u0438\u043c\u0435 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f HTML \u043f\u043e\u0434\u0441\u0432\u0435\u0442\u043a\u0430 \u043a\u043e\u0434\u0430 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 google-code-prettify (\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439 \u043f\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 twitter bootstrap) \u0438 jsbeautifier \u0434\u043b\u044f \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u0430.<br \/>  \u0414\u043b\u044f \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0439 node.js \u0441\u0435\u0440\u0432\u0435\u0440 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043a\u043e\u043f\u0438\u044e \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b.<\/p>\n<h5>\u041a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442:<\/h5>\n<p>  \u0410\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u044f WYSIWYG \u0440\u0435\u0436\u0438\u043c \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f  <\/p>\n<pre><code class=\"javascript\">$(document).click(function (event) { \t$(event.target).attr('contentEditable', 'true\u2019'); } <\/code><\/pre>\n<p>  \u0410\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u044f HTML \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430   <\/p>\n<pre><code class=\"javascript\">$(document).dblclick(function (event) {      \/\/\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u0443\u0435\u043c \u043a\u043e\u0434 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 jsbeautifier      var str = style_html( $(current).html() );      \/\/html - text      str = str.replace(\/\\&(?!(\\w+;))\/g, '&amp;').replace(\/&lt;\/g, '&lt;');      \/\/\u0437\u0430\u043c\u0435\u043d\u044f\u0435\u043c html \u043a\u043e\u043d\u0442\u0435\u043d\u0442 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043d\u0430 \u0442\u0435\u043a\u0441\u0442 \u043a\u043e\u043d\u0442\u0435\u043d\u0442      $(current).html('&lt;pre class=&quot;prettyprint&quot;&gt;' + str + '&lt;\/pre&gt;');      \/\/\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c prettify \u043f\u0430\u0440\u0441\u0435\u0440      prettyPrint(); }); <\/code><\/pre>\n<h6>\u041f\u043e\u0441\u043b\u0435 \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044f \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430<\/h6>\n<p>  \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0435\u0441\u043b\u0438 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0441\u044f \u0442\u0435\u043a\u0441\u0442  <\/p>\n<pre><code class=\"javascript\">$(current).html( $( current ).text() ); <\/code><\/pre>\n<p>  \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 HTML \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0447\u0438\u0441\u0442\u0438\u0442\u044c HTML \u043e\u0442 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 prettify \u043f\u0430\u0440\u0441\u0435\u0440\u043e\u043c  <\/p>\n<pre><code class=\"javascript\">var content = \u201c\u201d; $('.prettyprint').children().each(function(i) {      var nodeHtml = $(this).html();      content += nodeHtml; }); \/\/\u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0442\u0435\u043a\u0441 \u0432 \u0445\u0442\u043c\u043b content = content.split('&lt;').join('&lt;'); content = content.split('&gt;').join('&gt;'); $(current).html( content ); <\/code><\/pre>\n<p>  <\/p>\n<h4>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f:<\/h4>\n<p>  \u0414\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 node.js (\u0435\u0441\u043b\u0438 \u0435\u0433\u043e \u043d\u0435\u0442 \u043d\u0430\u0447\u0430\u0442\u044c \u043c\u043e\u0436\u043d\u043e \u0437\u0434\u0435\u0441\u044c <a href=\"http:\/\/habrahabr.ru\/post\/95960\/\">habrahabr.ru\/post\/95960\/<\/a> \u0438\u043b\u0438 \u0437\u0434\u0435\u0441\u044c <a href=\"http:\/\/nodejs.org\/download\/\">nodejs.org\/download\/<\/a>)<\/p>\n<p>  \u0412\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f bootstrap \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u043c \u043e\u0442 initializr  <\/p>\n<pre><code class=\"bash\">git clone https:\/\/github.com\/verekia\/initializr-bootstrap.git cd initializr-bootstrap <\/code><\/pre>\n<p>  \u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440  <\/p>\n<pre><code class=\"bash\">git clone https:\/\/github.com\/xreader\/inplaceeditor.git cp -r inplaceeditor\/* . <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u0430 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 index.html \u043f\u0435\u0440\u0435\u0434  \u0441\u0442\u0440\u043e\u043a\u0443:  <\/p>\n<pre><code class=\"html\">&lt;script src=&quot;js\/inplaceeditor.js&quot;&gt;&lt;\/script&gt; <\/code><\/pre>\n<p>  \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0434\u043b\u044f node.js  <\/p>\n<pre><code class=\"bash\">npm i <\/code><\/pre>\n<p>  \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440  <\/p>\n<pre><code class=\"bash\">node server.js <\/code><\/pre>\n<p>  \u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c <a href=\"http:\/\/localhost:3000\">http:\/\/localhost:3000<\/a> \u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c.<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/68f\/ded\/b67\/68fdedb674d8f5b32b492f35759d1476.png\"\/><br \/>  <b>\u041b\u0435\u0433\u0435\u043d\u0434\u0430:<\/b>  <\/p>\n<ol>\n<li>\u041a\u043b\u0438\u043a \u043d\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0435 \u0434\u043b\u044f \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0442\u0435\u043a\u0441\u0442\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b<\/li>\n<li>\u0414\u0432\u043e\u0439\u043d\u043e\u0439 \u043a\u043b\u0438\u043a \u0434\u043b\u044f \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u0438 \u0440\u0435\u0436\u0438\u043c\u0430 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f HTML<\/li>\n<li>\u0421\u043f\u0440\u0430\u0432\u0430 \u0432\u0432\u0435\u0440\u0445\u0443 \u043a\u043d\u043e\u043f\u043a\u0430 Save \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f. \u041a\u043d\u043e\u043f\u043a\u0430 Copy \u0440\u044f\u0434\u043e\u043c \u0434\u0435\u043b\u0430\u0435\u0442 \u043a\u043e\u043f\u0438\u044e \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0438 \u0434\u0435\u043b\u0430\u0435\u0442 \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043d\u0430 \u043d\u0435\u0451<\/li>\n<li>\u0414\u043b\u044f \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043b\u0438\u043a \u043d\u0430 \u043d\u0435 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0435 \u0438\u043b\u0438 ESC<\/li>\n<\/ol>\n<p>  \u041f\u0435\u0440\u0435\u0434 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u043c \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u0432\u044b\u0437\u043e\u0432 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430!<\/p>\n<p>  \u041a\u043e\u0434 \u043d\u0430 <a href=\"https:\/\/github.com\/xreader\/inplaceeditor\">GitHub<\/a> <\/p>\n<h5>\u0427\u0435\u0433\u043e \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442?<\/h5>\n<p>  <\/p>\n<ul>\n<li>\u041f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430 php<\/li>\n<li>\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435<\/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\/167647\/\"> http:\/\/habrahabr.ru\/post\/167647\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/c21\/0d5\/1a1\/c210d51a1baf047683a80049f338426c.png\" alt=\"image\"\/><br \/>  \u0412 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0433\u043e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0441\u0430\u0439\u0442\u0430-\u0437\u0430\u0433\u043b\u0443\u0448\u043a\u0438 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u044c \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441. \u0427\u0442\u043e \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c?<\/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-167647","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/167647","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=167647"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/167647\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=167647"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=167647"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=167647"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}