Skip to content

Commit 3b73455

Browse files
committed
fix: merge conflict
2 parents 5eb6e23 + ce8e68f commit 3b73455

File tree

5 files changed

+19
-12
lines changed
  • 1-js
  • 2-ui/2-events/03-event-delegation/4-behavior-tooltip
  • 5-network/11-websocket

5 files changed

+19
-12
lines changed

1-js/01-getting-started/4-devtools/article.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,19 @@ The exact look of developer tools depends on your version of Chrome. It changes
2929
- Here we can see the red-colored error message. In this case, the script contains an unknown "lalala" command.
3030
- On the right, there is a clickable link to the source `bug.html:12` with the line number where the error has occurred.
3131

32-
Below the error message, there is a blue `>` symbol. It marks a "command line" where we can type JavaScript commands. Press `key:Enter` to run them (`key:Shift+Enter` to input multi-line commands).
32+
Below the error message, there is a blue `>` symbol. It marks a "command line" where we can type JavaScript commands. Press `key:Enter` to run them.
3333

3434
Now we can see errors, and that's enough for a start. We'll come back to developer tools later and cover debugging more in-depth in the chapter <info:debugging-chrome>.
3535

36+
<<<<<<< HEAD
37+
=======
38+
```smart header="Multi-line input"
39+
Usually, when we put a line of code into the console, and then press `key:Enter`, it executes.
40+
41+
To insert multiple lines, press `key:Shift+Enter`. This way one can enter long fragments of JavaScript code.
42+
```
43+
44+
>>>>>>> ce8e68f21c9dd6abebfa373e05832b9a9054c355
3645
## Firefox, Edge, and others
3746

3847
Most other browsers use `key:F12` to open developer tools.
@@ -49,12 +58,6 @@ Open Preferences and go to the "Advanced" pane. There's a checkbox at the bottom
4958

5059
Now `key:Cmd+Opt+C` can toggle the console. Also, note that the new top menu item named "Develop" has appeared. It has many commands and options.
5160

52-
```smart header="Multi-line input"
53-
Usually, when we put a line of code into the console, and then press `key:Enter`, it executes.
54-
55-
To insert multiple lines, press `key:Shift+Enter`. This way one can enter long fragments of JavaScript code.
56-
```
57-
5861
## Summary
5962

6063
- Developer tools allow us to see errors, run commands, examine variables, and much more.

1-js/05-data-types/11-date/8-format-date-relative/solution.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ function formatDate(date) {
6262
year = year.toString().slice(-2);
6363
month = month < 10 ? '0' + month : month;
6464
dayOfMonth = dayOfMonth < 10 ? '0' + dayOfMonth : dayOfMonth;
65+
hour = hour < 10 ? '0' + hour : hour;
66+
minutes = minutes < 10 ? '0' + minutes : minutes;
6567

6668
if (diffSec < 1) {
6769
return 'right now';

1-js/06-advanced-functions/09-call-apply-decorators/article.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ let user = { name: "John" };
149149
let admin = { name: "Admin" };
150150

151151
// use call to pass different objects as "this"
152-
sayHi.call( user ); // this = John
153-
sayHi.call( admin ); // this = Admin
152+
sayHi.call( user ); // John
153+
sayHi.call( admin ); // Admin
154154
```
155155

156156
And here we use `call` to call `say` with the given context and phrase:

2-ui/2-events/03-event-delegation/4-behavior-tooltip/task.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ In this task we assume that all elements with `data-tooltip` have only text insi
2222

2323
Details:
2424

25+
- The distance between the element and the tooltip should be `5px`.
26+
- The tooltip should be centered relative to the element, if possible.
2527
- The tooltip should not cross window edges. Normally it should be above the element, but if the element is at the page top and there's no space for the tooltip, then below it.
26-
- The tooltip is given in the `data-tooltip` attribute. It can be arbitrary HTML.
28+
- The tooltip content is given in the `data-tooltip` attribute. It can be arbitrary HTML.
2729

2830
You'll need two events here:
2931
- `mouseover` triggers when a pointer comes over an element.

5-network/11-websocket/article.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,9 @@ For instance:
119119

120120
- `Sec-WebSocket-Extensions: deflate-frame` means that the browser supports data compression. An extension is something related to transferring the data, functionality that extends WebSocket protocol. The header `Sec-WebSocket-Extensions` is sent automatically by the browser, with the list of all extenions it supports.
121121

122-
- `Sec-WebSocket-Protocol: soap, wamp` means that we'd like to transfer not just any data, but the data in [SOAP](http://en.wikipedia.org/wiki/SOAP) or WAMP ("The WebSocket Application Messaging Protocol") protocols. WebSocket subprotocols are registered in the [IANA catalogue](http://www.iana.org/assignments/websocket/websocket.xml).
122+
- `Sec-WebSocket-Protocol: soap, wamp` means that we'd like to transfer not just any data, but the data in [SOAP](http://en.wikipedia.org/wiki/SOAP) or WAMP ("The WebSocket Application Messaging Protocol") protocols. WebSocket subprotocols are registered in the [IANA catalogue](http://www.iana.org/assignments/websocket/websocket.xml). So, this header describes data formats that we're going to use.
123123

124-
This optional header is set by us, to tell the server which subprotocols our code supports, using the second (optional) parameter of `new WebSocket`. That's the array of subprotocols, e.g. if we'd like to use SOAP or WAMP:
124+
This optional header is set using the second parameter of `new WebSocket`. That's the array of subprotocols, e.g. if we'd like to use SOAP or WAMP:
125125

126126
```js
127127
let socket = new WebSocket("wss://javascript.info/chat", ["soap", "wamp"]);

0 commit comments

Comments
 (0)