forked from tastejs/todomvc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pageLaxMode.js
73 lines (59 loc) · 1.42 KB
/
pageLaxMode.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
'use strict';
var Page = require('./page');
module.exports = function PageLaxMode() {
Page.apply(this, arguments);
this.getMainSectionCss = function () {
return 'section section';
};
this.getFooterSectionCss = function () {
return 'section footer';
};
this.getListCss = function (suffixCss) {
return [
'section > ul',
'section > div > ul',
'ul#todo-list'
].map(function (listCss) {
return listCss + (suffixCss || '');
}).join(', ');
};
this.getToggleAllCss = function () {
return [
'section > input[type="checkbox"]',
'section > * > input[type="checkbox"]',
'input#toggle-all'
].join(', ');
};
this.getClearCompletedButtonCss = function () {
return [
'footer > button',
'footer > * > button',
'button#clear-completed'
].join(', ');
};
this.getItemCountCss = function () {
return [
'footer > span',
'footer > * > span'
].join(', ');
};
this.getFilterCss = function (index) {
return 'footer ul li:nth-child(' + (index + 1) + ') a';
};
this.getNewInputCss = function () {
return [
'header > input',
'header > * > input',
'input#new-todo'
].join(', ');
};
this.getListItemToggleCss = function (index) {
return this.getListItemCss(index, ' input[type="checkbox"]');
};
this.getListItemInputCss = function (index) {
return [
this.getListItemCss(index, ' input.edit'),
this.getListItemCss(index, ' input[type="text"]')
].join(', ');
};
};