{"id":224173,"date":"2014-05-27T02:31:03","date_gmt":"2014-05-26T22:31:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=224173"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=224173","title":{"rendered":"<span class=\"post_title\">\u041a\u0430\u043a \u044f \u0434\u0435\u043b\u0430\u043b \u0432\u0438\u0434\u0436\u0435\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u044c\u044e \u0434\u043b\u044f \u0441\u0432\u043e\u0435\u0433\u043e \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u043d\u043e\u0433\u043e \u0441\u0438\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u0430 \u043a\u043e\u0441\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u043e\u043b\u0435\u0442\u043e\u0432<\/span>"},"content":{"rendered":"<div class=\"content html_format\"> \t\t\t\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u044f \u0441\u0434\u0435\u043b\u0430\u043b \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0441\u043d\u0438\u043f\u043f\u0435\u0442 \u043a\u043e\u0434\u0430 \u0434\u043b\u044f \u0441\u0435\u0431\u044f \u0438 \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e\u043c \u0435\u0433\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c \u0438 \u0438\u0441\u0442\u043e\u0440\u0438\u0435\u0439 \u0435\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f. <\/p>\n<p>  \u042f \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0434\u043e\u043b\u0433\u043e \u0440\u044b\u043b\u0441\u044f \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430\u0445 \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0439\u0442\u0438 \u0445\u043e\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u0445\u043e\u0436\u0435\u0435 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e, \u043d\u043e \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u0434\u043e \u0441\u0438\u0445 \u043f\u043e\u0440 \u0441 \u0442\u0430\u043a\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u043d\u0435 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0441\u044f \u0432\u0438\u0434\u0438\u043c\u043e \u0438\u043b\u0438 \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u0440\u0435\u0448\u0438\u043b\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0439 \u0432\u0438\u0434\u0436\u0435\u0442. \u041d\u0430\u0432\u0435\u0440\u043d\u043e\u0435 \u043d\u0438\u043a\u043e\u043c\u0443 \u043d\u0435 \u043d\u0430\u0434\u043e \u0431\u044b\u043b\u043e. <\/p>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u0437\u0432\u0443\u0447\u0443 \u0447\u0435\u0433\u043e \u043c\u043d\u0435 \u0442\u0430\u043a \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c:<br \/>  \u041c\u043d\u0435 \u043d\u0443\u0436\u0435\u043d \u0441\u043b\u0430\u0439\u0434\u0435\u0440 \u2014 \u0430\u043d\u0430\u043b\u043e\u0433 \u0440\u0435\u0433\u0443\u043b\u044f\u0442\u043e\u0440\u0430 \u0433\u0440\u043e\u043c\u043a\u043e\u0441\u0442\u0438, \u0441\u043e\u0432\u043c\u0435\u0449\u0435\u043d\u043d\u044b\u0439 \u0441 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441-\u0431\u0430\u0440\u043e\u043c. \u042d\u0434\u0430\u043a\u0438\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u044c\u044e \u0447\u0435\u0433\u043e-\u043b\u0438\u0431\u043e, \u0441\u043e\u0432\u043c\u0435\u0449\u0435\u043d\u043d\u044b\u0439 \u0441 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0438\u043d\u0434\u0438\u043a\u0430\u0446\u0438\u0435\u0439 \u044d\u0442\u043e\u0439 \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u0438. \u0418\u043d\u043e\u0433\u0434\u0430 \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u044c \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u0435\u0434\u0435\u043b \u0432 100% \u2014 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0432\u044b\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u043d\u0442. \u0418\u043d\u043e\u0433\u0434\u0430 \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u044c \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u043d\u0438\u0436\u0435 \u043d\u0443\u043b\u044f ( \u043d\u0435 \u0437\u043d\u0430\u044e \u043c\u043e\u0436\u0435\u0442 \u043b\u0438 \u2014 \u043d\u043e \u044f \u043d\u0430 \u0432\u0441\u044f\u043a\u0438\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043b \u0442\u0430\u043a\u0443\u044e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c) \u0438 \u044d\u0442\u043e\u0442 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0442\u043e\u0436\u0435 \u043d\u0430\u0434\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c. \u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e, \u0442\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u044b \u0440\u0435\u0433\u0443\u043b\u0438\u0440\u0443\u0435\u043c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u043d\u0435\u0440\u0442\u043d\u044b\u043c \u0438 \u0440\u0430\u0437\u0433\u043e\u043d\u044f\u0442\u044c\u0441\u044f \u043d\u0435 \u0441 \u0442\u043e\u0439 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c\u044e, \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u044b \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435. \u0415\u0441\u043b\u0438 \u0432\u044b \u043d\u0430\u0436\u0430\u043b\u0438 \u043a\u043d\u043e\u043f\u043a\u0443 \u0444\u043e\u0440\u0441\u0430\u0436\u0430 \u043d\u0430 \u0441\u0430\u043c\u043e\u043b\u0435\u0442\u0435 \u2014 \u0442\u043e \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u0438 \u0432\u044b\u0439\u0434\u0443\u0442 \u043d\u0430 \u0444\u043e\u0440\u0441\u0430\u0436\u043d\u044b\u0439 \u0440\u0435\u0436\u0438\u043c \u0447\u0435\u0440\u0435\u0437 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f. \u0422\u043e \u0435\u0441\u0442\u044c \u043d\u0430\u0434\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0431\u0430\u0440\u0430 \u0438 \u0442\u0430\u043a\u0436\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c-\u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u0437\u0443\u043d\u043a\u0430 \u0441\u043b\u0430\u0439\u0434\u0435\u0440\u0430.<\/p>\n<p>  \u041c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u044f \u0438 \u0444\u0438\u0433\u043e\u0432\u044b\u0439 \u0438\u0441\u043a\u0430\u0442\u0435\u043b\u044c, \u043d\u043e \u0432 \u0438\u0442\u043e\u0433\u0435 \u043f\u0441\u0438\u0445\u0430\u043d\u0443\u043b \u2014 \u0440\u0435\u0448\u0438\u043b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0432\u043e\u0439:<br \/>  \u0417\u0434\u0435\u0441\u044c <a href=\"https:\/\/github.com\/stavenko\/power-control-widget\">\u0441\u0441\u044b\u043b\u043a\u0430<\/a> \u043d\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u0430 \u043f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h4>\u041d\u0430\u0447\u0438\u043d\u0430\u0435\u043c<\/h4>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u0430\u0440\u043a\u0430\u0441 \u0432\u0438\u0434\u0436\u0435\u0442\u0430:  <\/p>\n<pre><code class=\"javascript\">var PowerControlWidget = function(settings){      this.container = settings.container || undefined ;      this.canvas = document.createElement('CANVAS');      this.canvas.height = this.height;      this.canvas.width = this.width; \t \tthis.container.appendChild(this.canvas); \t \tthis.ctx = this.canvas.getContext('2d');\t          \/\/ --- \u041d\u0430\u0431\u043e\u0440 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439  \tthis.set_value(0); \tthis.redraw() }  <\/code><\/pre>\n<p>  \u0421\u0440\u0430\u0437\u0443 \u043e\u0433\u043e\u0432\u043e\u0440\u044e\u0441\u044c \u2014 \u043c\u043d\u0435 \u0431\u044b \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u043f\u043e \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c\u0443 \u0431\u044b\u0442\u044c \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u043c \u043e\u0442 jquery.js \u0438 jqueryui.js \u2014 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u043d\u0435 \u0441\u0442\u0430\u043b \u043e\u0444\u043e\u0440\u043c\u043b\u044f\u0442\u044c \u044d\u0442\u043e\u0442 \u0432\u0438\u0434\u0436\u0435\u0442 \u043a\u0430\u043a \u043f\u043b\u0430\u0433\u0438\u043d jQuery.<\/p>\n<h4> \u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 <\/h4>\n<p>  \u0414\u043b\u044f \u0434\u0440\u0430\u0433-\u043d-\u0434\u0440\u043e\u043f\u043e\u0432 \u0432\u0441\u0435 \u0431\u0430\u043d\u0430\u043b\u044c\u043d\u043e: \u043d\u0430 mousedown \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435, \u043d\u0430 mouseup \u2014 \u0441\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u043c.<\/p>\n<pre><code class=\"javascript\">var self = this; this.canvas.addEventListener(&quot;mousedown&quot;, function(event){ \t\tself.mouse_down = true; \t\t \t\tself.value = event.offsetX; \t\t \t\tif(event.offsetX &lt; self.padding_left_right){ \t\t\tself.value = self.padding_left_right; \t\t} \t\tif(event.offsetX &gt; self._line_width - self.padding_left_right){ \t\t\tself.value = self._line_width - self.padding_left_right; \t\t} \t\t \t\tself._percent_value = self._get_percent(self.value); \t\tself.redraw(); \t\tself.onchange(self._percent_value, self.progress_value); \t}) \tthis.canvas.addEventListener(&quot;mouseup&quot;, function(event){ \t\tself.mouse_down = false; \t\t \t\tself._percent_value = self._get_percent(self.value); \t\tself.redraw(); \t\t \t\tself.onchange(self._percent_value, self.progress_value); \t\t \t\t \t})  \t \tthis.canvas.addEventListener(&quot;mousemove&quot;, function(event){ \t\tif (self.mouse_down){ \t\t\tself.value = event.offsetX;  \t\t\tif(event.offsetX &lt; self.padding_left_right){ \t\t\t\tself.value = self.padding_left_right; \t\t\t} \t\t\tif(event.offsetX &gt; self._line_width - self.padding_left_right){ \t\t\t\tself.value = self._line_width - self.padding_left_right; \t\t\t} \t\t\t \t\t\tself._percent_value = self._get_percent(self.value); \t\t\t \t\t\tself.redraw(); \t\t\tself.onslide(self._percent_value, self.progress_value); \t\t\t \t\t} \t}) <\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u0434\u0430\u044e\u0442 \u043f\u043e\u0437\u0438\u0446\u0438\u044e \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043d\u0443\u0436\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u044d\u0442\u043e\u0433\u043e \u043a\u0430\u043d\u0432\u0430\u0441\u0430. \u0412 \u0432\u0438\u0434\u0436\u0435\u0442\u0435, \u043f\u043e\u043c\u0438\u043c\u043e \u0435\u0433\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043d\u0430\u0434\u043e \u0442\u0430\u043a\u0436\u0435 \u0435\u0449\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0438 \u0432\u044b\u0432\u043e\u0434 \u0442\u043e\u0447\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u2014 \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0431\u0430\u0440\u0430 \u0438 \u0441\u043b\u0430\u0439\u0434\u0435\u0440\u0430. \u042f \u0438 \u0440\u0435\u0448\u0438\u043b \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u0430\u043d\u0432\u0430\u0441\u0430, \u0445\u043e\u0442\u044c \u0442\u0443\u0442 \u043c\u044b \u0438 \u043d\u0430\u0442\u044b\u043a\u0430\u0435\u043c\u0441\u044f \u043d\u0430 \u0432\u043f\u043e\u043b\u043d\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0442\u0435\u043a\u0441\u0442\u0430. \u0412\u044b\u0432\u043e\u0434 \u0442\u0435\u043a\u0441\u0442\u0430 \u2014 \u0447\u0443\u0442\u044c \u043f\u043e\u0437\u0436\u0435. <\/p>\n<h4> \u041d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u0435 <\/h4>\n<p>  \u0414\u043b\u044f \u0441\u0430\u043c\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0430 \u0441\u043b\u0430\u0439\u0434\u0435\u0440\u0430 \u043c\u044b \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u043c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u043a\u0430\u043d\u0432\u0430\u0441\u0430. \u041e\u043d \u0443 \u043d\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d:  <\/p>\n<ul>\n<li> \u0448\u0438\u0440\u0438\u043d\u043e\u0439 this._line_width \u2014 \u0428\u0438\u0440\u0438\u043d\u043e\u0439 \u043f\u043e\u043b\u043e\u0441\u043a\u0438 \u0441\u043b\u0430\u0439\u0434\u0435\u0440\u0430 <\/li>\n<li> \u043e\u0442\u0441\u0442\u0443\u043f\u043e\u043c \u0441\u043b\u0435\u0432\u0430-\u0441\u043f\u0440\u0430\u0432\u0430 <\/li>\n<li> \u043e\u0442\u0441\u0442\u0443\u043f\u043e\u043c \u0441\u0432\u0435\u0440\u0445\u0443-\u0441\u043d\u0438\u0437\u0443 <\/li>\n<\/ul>\n<p>  \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"javascript\">this._draw_border = function(){ \t\tvar b = this.padding_top_bottom; \/\/ \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0434\u043b\u044f \u043a\u0440\u0438\u0432\u043e\u0439 \u0431\u0435\u0437\u044c\u0435. \t\tvar a = this.padding_left_right; \t\tvar w = this._line_width - ( 2 * a ); \t\tvar h =  this.height - (2*b); \t\t \t\t \t\tthis.ctx.beginPath(); \t\tthis.ctx.moveTo(a,b); \t\t \t\tthis.ctx.bezierCurveTo(a+(w\/2), b, w-(w\/2)+a, b, a+w, b ); \t\tthis.ctx.bezierCurveTo(a+w+a, b, a+a+w, b+h, a+w, b+h ); \t\tthis.ctx.bezierCurveTo( w\/2+a, b+h, w\/2+a,b+h, a, b+h); \t\tthis.ctx.bezierCurveTo( 0, b+h, 0,b, a,b); \t\t \t\tthis.ctx.closePath(); \t\tthis.ctx.strokeStyle = this.border_color; \t\tthis.ctx.stroke(); \/\/ \u0440\u0438\u0441\u0443\u0435\u043c \u0433\u0440\u0430\u043d\u0438\u0446\u0443 \u043d\u0443\u0436\u043d\u044b\u043c \u0446\u0432\u0435\u0442\u043e\u043c \t\t \t}; <\/code><\/pre>\n<p>  \u041d\u0430\u043f\u043e\u043c\u043d\u044e, \u0447\u0442\u043e \u043a\u0440\u0438\u0432\u0430\u044f \u0431\u0435\u0437\u044c\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432\u043e \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u0445 \u0442\u0440\u0438 \u0442\u043e\u0447\u043a\u0438. \u0427\u0435\u0442\u0432\u0435\u0440\u0442\u0430\u044f \u0442\u043e\u0447\u043a\u0430 \u2014 \u0442\u0435\u043a\u0443\u0449\u0430\u044f, \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0432 \u043d\u0435\u0435 \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e moveTo.<br \/>  \u043e\u0431\u0449\u0438\u0439 \u0441\u043c\u044b\u0441\u043b \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u044f \u0442\u0430\u043a\u043e\u0439 \u043a\u0440\u0438\u0432\u043e\u0439:<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/db7\/a9a\/6d9\/db7a9a6d9999fdfbf749e183f8a5fc73.gif\" alt=\"image\"\/><\/p>\n<p>  \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043a\u0440\u0430\u0441\u0438\u0432\u0443\u044e \u0440\u0430\u043c\u043e\u0447\u043a\u0443 \u0441 \u0437\u0430\u043a\u0440\u0443\u0433\u043b\u0451\u043d\u043d\u044b\u043c\u0438 \u043a\u043e\u043d\u0446\u0430\u043c\u0438.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u043c\u0430\u0433\u0438\u044e: <br \/>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u0437\u043e\u043d\u0443 \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u043d\u0442\u0430\u0436\u0430 \u0438 \u0437\u043e\u043d\u0443 \u0444\u043e\u0440\u0441\u0430\u0436\u0430 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u043b\u0438\u043f\u0430\u043c\u0438. \u041a\u043b\u0438\u043f \u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e, \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0443\u0442\u044c, \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u0435, \u0430 \u043f\u043e\u0442\u043e\u043c \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u043c \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u0435 \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u0441 \u043e\u0434\u043d\u043e \u043b\u0438\u0448\u044c \u0440\u0430\u0437\u043d\u0438\u0446\u0435\u0439 \u2014 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043d\u0435 \u043e\u0431\u0432\u043e\u0434\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u043f\u0443\u0442\u044c, \u0430 \u0437\u0430\u043b\u0438\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0438\u0437\u043d\u0443\u0442\u0440\u0438 \u043d\u0443\u0436\u043d\u044b\u043c \u0446\u0432\u0435\u0442\u043e\u043c. \u0417\u0432\u0443\u0447\u0438\u0442 \u0431\u0430\u043d\u0430\u043b\u044c\u043d\u043e \u0438 \u043f\u0440\u043e\u0441\u0442\u043e, \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u043e\u0436\u0435 \u043d\u0435 \u0441\u043b\u043e\u0436\u043d\u043e. <\/p>\n<p>  \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u043c, \u0434\u043e\u043a\u0443\u0434\u0430 \u0435\u0433\u043e \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c, \u0432\u0441\u0435 \u0447\u0442\u043e \u0434\u043e \u043d\u0443\u043b\u044f \u2014 \u0440\u0438\u0441\u0443\u0435\u043c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c \u0446\u0432\u0435\u0442\u043e\u043c.<\/p>\n<pre><code class=\"javascript\">\t\t\tvar zero = this._get_x(0); \/\/ \u041c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u043d\u043e\u043b\u044c \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c \u043a\u043e\u0434\u0435 \u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043c\u043e\u0436\u043d\u043e  <\/code><\/pre>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438<\/p>\n<pre><code class=\"javascript\">\t\t\tthis.ctx.beginPath(); \t\t\tthis.ctx.rect(0,0, zero, this.height); \t\t\tthis.ctx.clip();  <\/code><\/pre>\n<p>  \u0418 \u0437\u0430\u043b\u0438\u0432\u0430\u0435\u043c \u0442\u0443 \u0436\u0435 \u0441\u0430\u043c\u0443\u044e \u0431\u0435\u0437\u044c\u0435 \u043d\u0443\u0436\u043d\u044b\u043c \u0446\u0432\u0435\u0442\u043e\u043c.<\/p>\n<pre><code class=\"javascript\">\t\t\tthis.ctx.beginPath(); \t\t\tthis.ctx.bezierCurveTo(a+(w\/2), b, w-(w\/2)+a, b, a+w, b ); \t\t\tthis.ctx.bezierCurveTo(a+w+a, b, a+a+w, b+h, a+w, b+h ); \t\t\tthis.ctx.bezierCurveTo( w\/2+a, b+h, w\/2+a,b+h, a, b+h); \t\t\tthis.ctx.bezierCurveTo( 0, b+h, 0,b, a,b); \t\t\tthis.ctx.fillStyle = this.below_z_color; \t\t\tthis.ctx.fill(); \t\t\tthis.ctx.closePath(); \t\t\tthis.ctx.restore();  <\/code><\/pre>\n<p>  \u041f\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438 \u043f\u043e\u0441\u0442\u0443\u043f\u0430\u0435\u043c \u0441 \u043e\u0431\u043b\u0430\u0441\u0442\u044c\u044e \u0432\u044b\u0448\u0435 100%.<\/p>\n<h4>\u041d\u0435\u043c\u043d\u043e\u0436\u043a\u043e \u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f\u0445<\/h4>\n<p>  \u041d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 \u0432\u0438\u0434\u0436\u0435\u0442\u0435 \u0438 \u0437\u0430\u0431\u0438\u0440\u0430\u0442\u044c \u0435\u0433\u043e, \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u044f \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u043a\u0443\u0440\u0441\u043e\u0440\u0430 \u043c\u044b\u0448\u0438 \u0432 \u043f\u0440\u043e\u0446\u0435\u043d\u0442 \u0438 \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442.<br \/>  \u042f \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u0434\u0432\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0438:  <\/p>\n<pre><code class=\"javascript\">\tthis._get_percent = function(x){ \t\t \t\tvar a = this.padding_left_right; \/\/ \u043e\u0442\u0441\u0442\u0443\u043f\u044b \u0441\u043b\u0435\u0432\u0430 \u0438 \u0441\u043f\u0440\u0430\u0432\u0430 \t\tvar w = this._line_width - (2*a); \/\/ \u0448\u0438\u0440\u0438\u043d\u0430 \u0441\u043b\u0430\u0439\u0434\u0435\u0440\u0430 \t\treturn ((x - a) * this._range\/ w)+this.starting_percent ;                  \/\/ \u0412\u044b\u0447\u0438\u0442\u0430\u0435\u043c \u0438\u0437 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u043c\u044b\u0448\u0438 \u0448\u0438\u0440\u0438\u043d\u0443 \u043e\u0442\u0441\u0442\u0443\u043f\u0430, \u0443\u043c\u043d\u043e\u0436\u0430\u0435\u043c \u043d\u0430 \u0440\u0430\u0437\u0431\u0440\u043e\u0441 \u043e\u0442 \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u043d\u0442\u0430 \u0434\u043e \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0433\u043e, \u0434\u0435\u043b\u0438\u043c \u043d\u0430 \u0448\u0438\u0440\u0438\u043d\u0443 \u0441\u043b\u0430\u0439\u0434\u0435\u0440\u0430 \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u043d\u0442.  \t}; \tthis._get_x = function(p){ \t\t \t\tvar a = this.padding_left_right; \t\tvar w = this._line_width - (2*a); \t\treturn a+ (p - this.starting_percent) * w \/ this._range; \/\/ \u041d\u0430\u043e\u0431\u043e\u0440\u043e\u0442 \t\t \t\t \t\t \t}; <\/code><\/pre>\n<h4> \u041d\u0443 \u0438 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043e \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u0438 \u0442\u0435\u043a\u0441\u0442\u0430<\/h4>\n<p>  \u0425\u043e\u0442\u0438\u0442\u0435 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u044b\u043c \u0438 \u0442\u043e\u0447\u043d\u044b\u043c? \u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043d\u043e \u0442\u043e\u0433\u0434\u0430 \u0431\u0435\u0437 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0435 \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c.<br \/>  \u0411\u0443\u0434\u0435\u043c \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u0442\u0435\u043a\u0441\u0442 \u0441\u043f\u0440\u0430\u0432\u0430 \u043e\u0442 \u043b\u0438\u043d\u0435\u0439\u043a\u0438 \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440\u0430. \u041e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0431\u0443\u0434\u0435\u043c \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0441\u043b\u0430\u0439\u0434\u0435\u0440\u0430, \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0431\u0430\u0440\u0430. \u042f \u0434\u0443\u043c\u0430\u044e, \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c, \u043d\u043e \u043f\u043e\u043a\u0430 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0442\u0430\u043a.<\/p>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0431\u0443\u0434\u0435\u043c \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u0438\u043c\u0435\u0435\u043d\u043e \u043f\u0440\u043e\u0446\u0435\u043d\u0442\u044b, \u0430 \u043d\u0435 \u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \u2014 \u0442\u043e \u0435\u0441\u0442\u044c \u0443\u043c\u043d\u043e\u0436\u0438\u043c \u043d\u0430 \u0441\u0442\u043e.  <\/p>\n<pre><code class=\"javascript\">\t\tvar val = this._percent_value * 100 \t\tvar int = Math.floor(val); \t\tvar frac = Math.floor((val - int)*100);  <\/code><\/pre>\n<p>  \u0422\u043e \u0435\u0441\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0446\u0435\u043b\u0443\u044e, \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0434\u0440\u043e\u0431\u043d\u0443\u044e \u0447\u0430\u0441\u0442\u0438. \u0420\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0437\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430, \u043d\u043e \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u043e\u043e\u0431\u0449\u0435 \u043f\u043e\u0434\u0441\u0447\u0438\u0442\u0430\u0435\u043c, \u043a\u0430\u043a\u043e\u0439 \u043d\u0430\u043c \u043b\u0443\u0447\u0448\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0448\u0440\u0438\u0444\u0442. \u042f \u0440\u0435\u0448\u0438\u043b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0435 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0445\u043e\u0440\u043e\u0448\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445:  <\/p>\n<pre><code class=\"javascript\">\t\tvar base_font_size = this.height - (this.padding_top_bottom*2) ; \/\/ \u0440\u0430\u0437\u043c\u0435\u0440 \u0448\u0440\u0438\u0444\u0442\u0430 \u0446\u0435\u043b\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \t\tvar add_font_size = Math.floor(base_font_size \/ 2); \/\/ \u0440\u0430\u0437\u043c\u0435\u0440 \u0448\u0440\u0438\u0444\u0442\u0430 \u0434\u0440\u043e\u0431\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \t\tvar base_marg = base_font_size *2; \/\/ \u041e\u0442\u0441\u0442\u0443\u043f \u0441\u043b\u0435\u0432\u0430  <\/code><\/pre>\n<p>\u041d\u0443 \u0438 \u0432 \u043a\u043e\u043d\u0446\u0435 \u2014 \u043a\u043e\u0434 \u0434\u043b\u044f \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438 \u0442\u0435\u043a\u0441\u0442\u0430<\/p>\n<pre><code class=\"javascript\">\t\tthis.ctx.save() \t\tthis.ctx.translate(this._line_width+ this.padding_top_bottom,  this.height-this.padding_top_bottom); \t\tthis.ctx.fillStyle = &quot;#000&quot;; \t\tthis.ctx.font = base_font_size + &quot;pt Arial&quot;; \t\t \t\tthis.ctx.textAlign = &quot;end&quot;; \/\/ \u0410\u043b\u0438\u0433\u043d \u043f\u043e \u043a\u043e\u043d\u0446\u0443 \u0441\u0442\u0440\u043e\u043a\u0438 \t\tthis.ctx.fillText(&quot;&quot; + (int), base_marg, 0 ) \t\t \t\tthis.ctx.textAlign = &quot;center&quot;; \t\tthis.ctx.font = (base_font_size -2) + &quot;pt Arial&quot;; \t\t \t\tthis.ctx.fillText(&quot;,&quot;, base_marg+1,0 ) \t\t \t\tthis.ctx.font = add_font_size + &quot;pt Arial&quot;; \t\tthis.ctx.textAlign = &quot;start&quot;; \/\/ \u0410\u043b\u0438\u0433\u043d \u043f\u043e \u043d\u0430\u0447\u0430\u043b\u0443 \u0441\u0442\u0440\u043e\u043a\u0438 \t\t \t\tthis.ctx.fillText(&quot;&quot; + (frac), base_marg+3, 0 ) \t\t \t\tthis.ctx.restore();  <\/code><\/pre>\n<p>  <\/p>\n<h4>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h4>\n<p>  \u0413\u043e\u0442\u043e\u0432\u044b\u0439 \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c. \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0446\u0432\u0435\u0442\u043e\u0432 \u0434\u043b\u044f \u043d\u0435\u0433\u043e \u043c\u043e\u0433\u0443\u0442 \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c canvas \u043d\u0435 \u043e\u0441\u0442\u0430\u0432\u0438\u043b\u043e \u0434\u043b\u044f \u043d\u0430\u0441 \u0448\u0438\u0440\u043e\u043a\u0438\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u0434\u043b\u044f \u0440\u0430\u0441\u0441\u043a\u0440\u0430\u0441\u0441\u043a\u0438 \u0435\u0433\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e css, \u041d\u043e \u0443 \u043a\u0430\u043d\u0432\u0430\u0441\u0430 \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 \u2014 \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438 \u0441 \u0435\u0433\u043e \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0432\u0435\u0448\u0438\u0432\u0430\u0442\u044c \u043d\u0430 \u044d\u0442\u043e\u0442 \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0448\u0442\u0440\u0438\u0445\u0438 \u0438 \u043b\u0438\u043d\u0435\u0439\u043a\u0438. \u0411\u043b\u0430\u0433\u043e, \u0447\u0442\u043e \u043a\u0430\u043d\u0432\u0430\u0441 \u043c\u043e\u0436\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u0442\u043e\u0447\u043d\u043e \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0444\u0438\u0433\u0443\u0440\u044b. <\/p>\n<p>  \u0414\u043b\u044f \u0436\u0435\u043b\u0430\u044e\u0449\u0438\u0445 \u043f\u043e\u043a\u043e\u0432\u044b\u0440\u044f\u0442\u044c \u0435\u0433\u043e \u0438\u043b\u0438 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e \u0430\u0434\u0440\u0435\u0441 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f <a href=\"https:\/\/github.com\/stavenko\/power-control-widget\">github.com\/stavenko\/power-control-widget<\/a>. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u044d\u0442\u043e\u0442 \u0432\u0438\u0434\u0436\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u043e\u0434\u043d\u0438\u043c \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u043e\u043c \u2014 Google Chrome, \u0438 \u044f \u0435\u0441\u043b\u0438 \u0447\u0435\u0441\u0442\u043d\u043e \u043d\u0435 \u0443\u0432\u0435\u0440\u0435\u043d, \u0447\u0442\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043e\u0442\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430\u0445. \u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438 \u2014 \u0432 \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u0445 \u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u0431\u044b\u0442\u044c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u043c\u044b\u0448\u0438 \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 offsetX. \u0410 \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e \u2014 \u043d\u0435 \u043d\u0430\u0434\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0442\u044c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u2014 \u043e\u043d\u0438 \u0441\u0440\u0430\u0437\u0443 \u0434\u0430\u044e\u0442\u0441\u044f \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u0435\u0440\u0445\u0430-\u043b\u0435\u0432\u0430 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430. <\/p>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u0432\u0441\u0435. \t\t\t<\/p>\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\/224173\/\"> http:\/\/habrahabr.ru\/post\/224173\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\"> \t\t\t\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u044f \u0441\u0434\u0435\u043b\u0430\u043b \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0441\u043d\u0438\u043f\u043f\u0435\u0442 \u043a\u043e\u0434\u0430 \u0434\u043b\u044f \u0441\u0435\u0431\u044f \u0438 \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e\u043c \u0435\u0433\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c \u0438 \u0438\u0441\u0442\u043e\u0440\u0438\u0435\u0439 \u0435\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f. <\/p>\n<p>  \u042f \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0434\u043e\u043b\u0433\u043e \u0440\u044b\u043b\u0441\u044f \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430\u0445 \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0439\u0442\u0438 \u0445\u043e\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u0445\u043e\u0436\u0435\u0435 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e, \u043d\u043e \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u0434\u043e \u0441\u0438\u0445 \u043f\u043e\u0440 \u0441 \u0442\u0430\u043a\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u043d\u0435 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0441\u044f \u0432\u0438\u0434\u0438\u043c\u043e \u0438\u043b\u0438 \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u0440\u0435\u0448\u0438\u043b\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0439 \u0432\u0438\u0434\u0436\u0435\u0442. \u041d\u0430\u0432\u0435\u0440\u043d\u043e\u0435 \u043d\u0438\u043a\u043e\u043c\u0443 \u043d\u0435 \u043d\u0430\u0434\u043e \u0431\u044b\u043b\u043e. <\/p>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u0437\u0432\u0443\u0447\u0443 \u0447\u0435\u0433\u043e \u043c\u043d\u0435 \u0442\u0430\u043a \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c:<br \/>  \u041c\u043d\u0435 \u043d\u0443\u0436\u0435\u043d \u0441\u043b\u0430\u0439\u0434\u0435\u0440 \u2014 \u0430\u043d\u0430\u043b\u043e\u0433 \u0440\u0435\u0433\u0443\u043b\u044f\u0442\u043e\u0440\u0430 \u0433\u0440\u043e\u043c\u043a\u043e\u0441\u0442\u0438, \u0441\u043e\u0432\u043c\u0435\u0449\u0435\u043d\u043d\u044b\u0439 \u0441 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441-\u0431\u0430\u0440\u043e\u043c. \u042d\u0434\u0430\u043a\u0438\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u044c\u044e \u0447\u0435\u0433\u043e-\u043b\u0438\u0431\u043e, \u0441\u043e\u0432\u043c\u0435\u0449\u0435\u043d\u043d\u044b\u0439 \u0441 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0438\u043d\u0434\u0438\u043a\u0430\u0446\u0438\u0435\u0439 \u044d\u0442\u043e\u0439 \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u0438. \u0418\u043d\u043e\u0433\u0434\u0430 \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u044c \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u0435\u0434\u0435\u043b \u0432 100% \u2014 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0432\u044b\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u043d\u0442. \u0418\u043d\u043e\u0433\u0434\u0430 \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u044c \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u043d\u0438\u0436\u0435 \u043d\u0443\u043b\u044f ( \u043d\u0435 \u0437\u043d\u0430\u044e \u043c\u043e\u0436\u0435\u0442 \u043b\u0438 \u2014 \u043d\u043e \u044f \u043d\u0430 \u0432\u0441\u044f\u043a\u0438\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043b \u0442\u0430\u043a\u0443\u044e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c) \u0438 \u044d\u0442\u043e\u0442 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0442\u043e\u0436\u0435 \u043d\u0430\u0434\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c. \u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e, \u0442\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u044b \u0440\u0435\u0433\u0443\u043b\u0438\u0440\u0443\u0435\u043c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u043d\u0435\u0440\u0442\u043d\u044b\u043c \u0438 \u0440\u0430\u0437\u0433\u043e\u043d\u044f\u0442\u044c\u0441\u044f \u043d\u0435 \u0441 \u0442\u043e\u0439 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c\u044e, \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u044b \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435. \u0415\u0441\u043b\u0438 \u0432\u044b \u043d\u0430\u0436\u0430\u043b\u0438 \u043a\u043d\u043e\u043f\u043a\u0443 \u0444\u043e\u0440\u0441\u0430\u0436\u0430 \u043d\u0430 \u0441\u0430\u043c\u043e\u043b\u0435\u0442\u0435 \u2014 \u0442\u043e \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u0438 \u0432\u044b\u0439\u0434\u0443\u0442 \u043d\u0430 \u0444\u043e\u0440\u0441\u0430\u0436\u043d\u044b\u0439 \u0440\u0435\u0436\u0438\u043c \u0447\u0435\u0440\u0435\u0437 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f. \u0422\u043e \u0435\u0441\u0442\u044c \u043d\u0430\u0434\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0431\u0430\u0440\u0430 \u0438 \u0442\u0430\u043a\u0436\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c-\u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u0437\u0443\u043d\u043a\u0430 \u0441\u043b\u0430\u0439\u0434\u0435\u0440\u0430.<\/p>\n<p>  \u041c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u044f \u0438 \u0444\u0438\u0433\u043e\u0432\u044b\u0439 \u0438\u0441\u043a\u0430\u0442\u0435\u043b\u044c, \u043d\u043e \u0432 \u0438\u0442\u043e\u0433\u0435 \u043f\u0441\u0438\u0445\u0430\u043d\u0443\u043b \u2014 \u0440\u0435\u0448\u0438\u043b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0432\u043e\u0439:<br \/>  \u0417\u0434\u0435\u0441\u044c <a href=\"https:\/\/github.com\/stavenko\/power-control-widget\">\u0441\u0441\u044b\u043b\u043a\u0430<\/a> \u043d\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u0430 \u043f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\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-224173","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/224173","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=224173"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/224173\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=224173"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=224173"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=224173"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}