1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 | var Atrule = require('./atrule');
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 | var Media = module.exports = function Media(val){
|
22 | Atrule.call(this, 'media');
|
23 | this.val = val;
|
24 | };
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 | Media.prototype.__proto__ = Atrule.prototype;
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 | Media.prototype.clone = function(parent){
|
40 | var clone = new Media;
|
41 | clone.val = this.val.clone(parent, clone);
|
42 | clone.block = this.block.clone(parent, clone);
|
43 | clone.lineno = this.lineno;
|
44 | clone.column = this.column;
|
45 | clone.filename = this.filename;
|
46 | return clone;
|
47 | };
|
48 |
|
49 |
|
50 |
|
51 |
|
52 |
|
53 |
|
54 |
|
55 |
|
56 | Media.prototype.toJSON = function(){
|
57 | return {
|
58 | __type: 'Media',
|
59 | val: this.val,
|
60 | block: this.block,
|
61 | lineno: this.lineno,
|
62 | column: this.column,
|
63 | filename: this.filename
|
64 | };
|
65 | };
|
66 |
|
67 |
|
68 |
|
69 |
|
70 |
|
71 |
|
72 |
|
73 |
|
74 | Media.prototype.toString = function(){
|
75 | return '@media ' + this.val;
|
76 | };
|