Skip to content

Commit 632b089

Browse files
committed
Added syntax highlighting
1 parent 0d5d2a2 commit 632b089

File tree

1 file changed

+79
-70
lines changed

1 file changed

+79
-70
lines changed

README.md

Lines changed: 79 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -114,37 +114,40 @@ objects and accept the same options:
114114

115115
Example:
116116

117-
var clickago = new Clickago()
118-
119-
clickago.register({
120-
method: addUser,
121-
thisArg: window,
122-
arguments: ["Mike", "[email protected]"]
123-
}, {
124-
method: removeUser,
125-
thisArg: window,
126-
arguments: ["[email protected]"]
127-
});
117+
```javascript
118+
var clickago = new Clickago()
128119

120+
clickago.register({
121+
method: addUser,
122+
thisArg: window,
123+
arguments: ["Mike", "[email protected]"]
124+
}, {
125+
method: removeUser,
126+
thisArg: window,
127+
arguments: ["[email protected]"]
128+
});
129+
```
129130
**.undo()**
130131

131132
Use `.undo()` to call the latest registered rollback.
132133

133-
Example
134+
Example:
134135

135-
var clickago = new Clickago()
136-
137-
clickago.register({
138-
method: addUser,
139-
thisArg: window,
140-
arguments: ["Mike", "[email protected]"]
141-
}, {
142-
method: removeUser,
143-
thisArg: window,
144-
arguments: ["[email protected]"]
145-
});
136+
```javascript
137+
var clickago = new Clickago()
146138

147-
clickago.undo(); // Same as calling removeUser.apply(window, ["[email protected]"]);
139+
clickago.register({
140+
method: addUser,
141+
thisArg: window,
142+
arguments: ["Mike", "[email protected]"]
143+
}, {
144+
method: removeUser,
145+
thisArg: window,
146+
arguments: ["[email protected]"]
147+
});
148+
149+
clickago.undo(); // Same as calling removeUser.apply(window, ["[email protected]"]);
150+
```
148151

149152

150153
**.redo()**
@@ -153,21 +156,23 @@ Use redo to call the latest registered action (works only after calling the `.un
153156

154157
Example:
155158

156-
var clickago = new Clickago()
157-
158-
clickago.register({
159-
method: addUser,
160-
thisArg: window,
161-
arguments: ["Mike", "[email protected]"]
162-
}, {
163-
method: removeUser,
164-
thisArg: window,
165-
arguments: ["[email protected]"]
166-
});
167-
168-
clickago.undo(); // Same as calling removeUser.apply(window, ["[email protected]"]);
159+
```javascript
160+
var clickago = new Clickago()
169161

170-
clickago.redo(); // Same as calling addUser.apply(window, ["Mike", "[email protected]"]);
162+
clickago.register({
163+
method: addUser,
164+
thisArg: window,
165+
arguments: ["Mike", "[email protected]"]
166+
}, {
167+
method: removeUser,
168+
thisArg: window,
169+
arguments: ["[email protected]"]
170+
});
171+
172+
clickago.undo(); // Same as calling removeUser.apply(window, ["[email protected]"]);
173+
174+
clickago.redo(); // Same as calling addUser.apply(window, ["Mike", "[email protected]"]);
175+
```
171176

172177
**.disable()**
173178

@@ -176,47 +181,51 @@ method.
176181

177182
Example:
178183

179-
var clickago = new Clickago()
180-
181-
clickago.register({
182-
method: addUser,
183-
thisArg: window,
184-
arguments: ["Mike", "[email protected]"]
185-
}, {
186-
method: removeUser,
187-
thisArg: window,
188-
arguments: ["[email protected]"]
189-
});
190-
191-
clickago.disable();
184+
```javascript
185+
var clickago = new Clickago()
192186

193-
clickago.undo(); // Returns 'undefined' and no actions get called.
187+
clickago.register({
188+
method: addUser,
189+
thisArg: window,
190+
arguments: ["Mike", "[email protected]"]
191+
}, {
192+
method: removeUser,
193+
thisArg: window,
194+
arguments: ["[email protected]"]
195+
});
196+
197+
clickago.disable();
198+
199+
clickago.undo(); // Returns 'undefined' and no actions get called.
200+
```
194201

195202
**.enable()**
196203

197204
Use this method to enable Clickago.
198205

199206
Example:
200207

201-
var clickago = new Clickago()
202-
203-
clickago.register({
204-
method: addUser,
205-
thisArg: window,
206-
arguments: ["Mike", "[email protected]"]
207-
}, {
208-
method: removeUser,
209-
thisArg: window,
210-
arguments: ["[email protected]"]
211-
});
212-
213-
clickago.disable();
214-
215-
clickago.undo(); // Returns 'undefined' and no actions get called.
216-
217-
clickago.enable();
208+
```javascript
209+
var clickago = new Clickago()
218210

219-
clickago.undo(); // Same as calling removeUser.apply(window, ["[email protected]"]);
211+
clickago.register({
212+
method: addUser,
213+
thisArg: window,
214+
arguments: ["Mike", "[email protected]"]
215+
}, {
216+
method: removeUser,
217+
thisArg: window,
218+
arguments: ["[email protected]"]
219+
});
220+
221+
clickago.disable();
222+
223+
clickago.undo(); // Returns 'undefined' and no actions get called.
224+
225+
clickago.enable();
226+
227+
clickago.undo(); // Same as calling removeUser.apply(window, ["[email protected]"]);
228+
```
220229

221230
**.canUndo and .canRedo**
222231

0 commit comments

Comments
 (0)