uki 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +7 -0
- data/.gitmodules +3 -0
- data/LICENSE +20 -0
- data/Rakefile +23 -0
- data/Readme.rdoc +9 -0
- data/VERSION +1 -0
- data/bin/uki +102 -0
- data/frameworks/jspec/lib/images/bg.png +0 -0
- data/frameworks/jspec/lib/images/hr.png +0 -0
- data/frameworks/jspec/lib/images/loading.gif +0 -0
- data/frameworks/jspec/lib/images/sprites.bg.png +0 -0
- data/frameworks/jspec/lib/images/sprites.png +0 -0
- data/frameworks/jspec/lib/images/vr.png +0 -0
- data/frameworks/jspec/lib/jspec.css +149 -0
- data/frameworks/jspec/lib/jspec.growl.js +115 -0
- data/frameworks/jspec/lib/jspec.jquery.js +72 -0
- data/frameworks/jspec/lib/jspec.js +1756 -0
- data/frameworks/jspec/lib/jspec.shell.js +39 -0
- data/frameworks/jspec/lib/jspec.timers.js +90 -0
- data/frameworks/jspec/lib/jspec.xhr.js +195 -0
- data/frameworks/uki/README.rdoc +179 -0
- data/frameworks/uki/compiler.jar +0 -0
- data/frameworks/uki/run.rb +2 -0
- data/frameworks/uki/spec/commands/example_command.rb +19 -0
- data/frameworks/uki/spec/dom.html +39 -0
- data/frameworks/uki/spec/support/images/bg.png +0 -0
- data/frameworks/uki/spec/support/images/hr.png +0 -0
- data/frameworks/uki/spec/support/images/loading.gif +0 -0
- data/frameworks/uki/spec/support/images/sprites.bg.png +0 -0
- data/frameworks/uki/spec/support/images/sprites.png +0 -0
- data/frameworks/uki/spec/support/images/vr.png +0 -0
- data/frameworks/uki/spec/support/jspec.css +149 -0
- data/frameworks/uki/spec/support/jspec.js +1773 -0
- data/frameworks/uki/spec/support/jspec.xhr.js +193 -0
- data/frameworks/uki/spec/support/spec.helper.js +1 -0
- data/frameworks/uki/spec/unit/background.spec.js +29 -0
- data/frameworks/uki/spec/unit/builder.spec.js +51 -0
- data/frameworks/uki/spec/unit/data/model.spec.js +29 -0
- data/frameworks/uki/spec/unit/dom/dnd.spec.js +71 -0
- data/frameworks/uki/spec/unit/dom/event.spec.js +78 -0
- data/frameworks/uki/spec/unit/dom.spec.js +28 -0
- data/frameworks/uki/spec/unit/geometry.spec.js +79 -0
- data/frameworks/uki/spec/unit/selector.spec.js +140 -0
- data/frameworks/uki/spec/unit/theme/template.spec.js +31 -0
- data/frameworks/uki/spec/unit/utils.spec.js +176 -0
- data/frameworks/uki/spec/unit/view/base.spec.js +86 -0
- data/frameworks/uki/spec/unit/view/container.spec.js +73 -0
- data/frameworks/uki/spec/unit/view.spec.js +13 -0
- data/frameworks/uki/src/airport.js +1 -0
- data/frameworks/uki/src/uki-core/attachment.js +175 -0
- data/frameworks/uki/src/uki-core/background/css.js +37 -0
- data/frameworks/uki/src/uki-core/background/cssBox.js +73 -0
- data/frameworks/uki/src/uki-core/background/multi.js +20 -0
- data/frameworks/uki/src/uki-core/background/null.js +10 -0
- data/frameworks/uki/src/uki-core/background/rows.js +77 -0
- data/frameworks/uki/src/uki-core/background/sliced9.js +206 -0
- data/frameworks/uki/src/uki-core/background.js +35 -0
- data/frameworks/uki/src/uki-core/builder.js +68 -0
- data/frameworks/uki/src/uki-core/collection.js +278 -0
- data/frameworks/uki/src/uki-core/const.js +17 -0
- data/frameworks/uki/src/uki-core/dom/dnd.js +93 -0
- data/frameworks/uki/src/uki-core/dom/event.js +194 -0
- data/frameworks/uki/src/uki-core/dom/nativeLayout.js +18 -0
- data/frameworks/uki/src/uki-core/dom/offset.js +130 -0
- data/frameworks/uki/src/uki-core/dom/w3cdnd.js +333 -0
- data/frameworks/uki/src/uki-core/dom.js +109 -0
- data/frameworks/uki/src/uki-core/geometry.js +658 -0
- data/frameworks/uki/src/uki-core/image.js +90 -0
- data/frameworks/uki/src/uki-core/selector.js +201 -0
- data/frameworks/uki/src/uki-core/theme/base.js +39 -0
- data/frameworks/uki/src/uki-core/theme/template.js +26 -0
- data/frameworks/uki/src/uki-core/theme.js +45 -0
- data/frameworks/uki/src/uki-core/uki.js +45 -0
- data/frameworks/uki/src/uki-core/utils.js +399 -0
- data/frameworks/uki/src/uki-core/view/base.js +480 -0
- data/frameworks/uki/src/uki-core/view/container.js +155 -0
- data/frameworks/uki/src/uki-core/view/focusable.js +93 -0
- data/frameworks/uki/src/uki-core/view/observable.js +66 -0
- data/frameworks/uki/src/uki-core/view/styleable.js +70 -0
- data/frameworks/uki/src/uki-core/view/utils.js +66 -0
- data/frameworks/uki/src/uki-core/view.js +21 -0
- data/frameworks/uki/src/uki-core.js +36 -0
- data/frameworks/uki/src/uki-data/data.js +1 -0
- data/frameworks/uki/src/uki-data/model.js +28 -0
- data/frameworks/uki/src/uki-data/observable.js +34 -0
- data/frameworks/uki/src/uki-data.js +1 -0
- data/frameworks/uki/src/uki-more/more/utils.js +20 -0
- data/frameworks/uki/src/uki-more/more/view/listContainer.js +4 -0
- data/frameworks/uki/src/uki-more/more/view/multiselectList.js +196 -0
- data/frameworks/uki/src/uki-more/more/view/radioButton.js +27 -0
- data/frameworks/uki/src/uki-more/more/view/splitTable.js +79 -0
- data/frameworks/uki/src/uki-more/more/view/toggleButton.js +24 -0
- data/frameworks/uki/src/uki-more/more/view/treeList/render.js +53 -0
- data/frameworks/uki/src/uki-more/more/view/treeList.js +110 -0
- data/frameworks/uki/src/uki-more/more/view.js +2 -0
- data/frameworks/uki/src/uki-more/more.js +1 -0
- data/frameworks/uki/src/uki-more.js +4 -0
- data/frameworks/uki/src/uki-theamless.js +15 -0
- data/frameworks/uki/src/uki-theme/airport/i/button/down-c.gif +0 -0
- data/frameworks/uki/src/uki-theme/airport/i/button/down-c.png +0 -0
- data/frameworks/uki/src/uki-theme/airport/i/button/down-h.gif +0 -0
- data/frameworks/uki/src/uki-theme/airport/i/button/down-h.png +0 -0
- data/frameworks/uki/src/uki-theme/airport/i/button/down-m.png +0 -0
- data/frameworks/uki/src/uki-theme/airport/i/button/down-v.png +0 -0
- data/frameworks/uki/src/uki-theme/airport/i/button/focusRing-c.png +0 -0
- data/frameworks/uki/src/uki-theme/airport/i/button/focusRing-h.png +0 -0
- data/frameworks/uki/src/uki-theme/airport/i/button/focusRing-m.png +0 -0
- data/frameworks/uki/src/uki-theme/airport/i/button/focusRing-v.png +0 -0
- data/frameworks/uki/src/uki-theme/airport/i/button/focusRing.png +0 -0
- data/frameworks/uki/src/uki-theme/airport/i/button/hover-c.gif +0 -0
- data/frameworks/uki/src/uki-theme/airport/i/button/hover-c.png +0 -0
- data/frameworks/uki/src/uki-theme/airport/i/button/hover-h.gif +0 -0
- data/frameworks/uki/src/uki-theme/airport/i/button/hover-h.png +0 -0
- data/frameworks/uki/src/uki-theme/airport/i/button/hover-m.png +0 -0
- data/frameworks/uki/src/uki-theme/airport/i/button/hover-v.png +0 -0
- data/frameworks/uki/src/uki-theme/airport/i/button/hover.png +0 -0
- data/frameworks/uki/src/uki-theme/airport/i/button/normal-c.gif +0 -0
- data/frameworks/uki/src/uki-theme/airport/i/button/normal-c.png +0 -0
- data/frameworks/uki/src/uki-theme/airport/i/button/normal-h.gif +0 -0
- data/frameworks/uki/src/uki-theme/airport/i/button/normal-h.png +0 -0
- data/frameworks/uki/src/uki-theme/airport/i/button/normal-m.png +0 -0
- data/frameworks/uki/src/uki-theme/airport/i/button/normal-v.png +0 -0
- data/frameworks/uki/src/uki-theme/airport/i/button/normal.png +0 -0
- data/frameworks/uki/src/uki-theme/airport/i/checkbox/checkbox.png +0 -0
- data/frameworks/uki/src/uki-theme/airport/i/checkbox/focus.png +0 -0
- data/frameworks/uki/src/uki-theme/airport/i/checkbox/normal.gif +0 -0
- data/frameworks/uki/src/uki-theme/airport/i/checkbox/normal.png +0 -0
- data/frameworks/uki/src/uki-theme/airport/i/panel/dark-h.gif +0 -0
- data/frameworks/uki/src/uki-theme/airport/i/panel/dark-h.png +0 -0
- data/frameworks/uki/src/uki-theme/airport/i/panel/dark-m.png +0 -0
- data/frameworks/uki/src/uki-theme/airport/i/panel/dark.png +0 -0
- data/frameworks/uki/src/uki-theme/airport/i/popup/normal.png +0 -0
- data/frameworks/uki/src/uki-theme/airport/i/radio/focus.png +0 -0
- data/frameworks/uki/src/uki-theme/airport/i/radio/normal.gif +0 -0
- data/frameworks/uki/src/uki-theme/airport/i/radio/normal.png +0 -0
- data/frameworks/uki/src/uki-theme/airport/i/radio/radio.png +0 -0
- data/frameworks/uki/src/uki-theme/airport/i/shadow/large-c.png +0 -0
- data/frameworks/uki/src/uki-theme/airport/i/shadow/large-h.png +0 -0
- data/frameworks/uki/src/uki-theme/airport/i/shadow/large-m.png +0 -0
- data/frameworks/uki/src/uki-theme/airport/i/shadow/large-v.png +0 -0
- data/frameworks/uki/src/uki-theme/airport/i/shadow/large.png +0 -0
- data/frameworks/uki/src/uki-theme/airport/i/slider/bar-m.gif +0 -0
- data/frameworks/uki/src/uki-theme/airport/i/slider/bar-m.png +0 -0
- data/frameworks/uki/src/uki-theme/airport/i/slider/bar-v.gif +0 -0
- data/frameworks/uki/src/uki-theme/airport/i/slider/bar-v.png +0 -0
- data/frameworks/uki/src/uki-theme/airport/i/slider/bar.png +0 -0
- data/frameworks/uki/src/uki-theme/airport/i/slider/focus.png +0 -0
- data/frameworks/uki/src/uki-theme/airport/i/slider/handle.gif +0 -0
- data/frameworks/uki/src/uki-theme/airport/i/splitPane/horizontal.gif +0 -0
- data/frameworks/uki/src/uki-theme/airport/i/splitPane/horizontal.png +0 -0
- data/frameworks/uki/src/uki-theme/airport/i/splitPane/vertical.gif +0 -0
- data/frameworks/uki/src/uki-theme/airport/i/x.gif +0 -0
- data/frameworks/uki/src/uki-theme/airport.js +322 -0
- data/frameworks/uki/src/uki-theme/aristo/i/button/down-c.gif +0 -0
- data/frameworks/uki/src/uki-theme/aristo/i/button/down-c.png +0 -0
- data/frameworks/uki/src/uki-theme/aristo/i/button/down-h.png +0 -0
- data/frameworks/uki/src/uki-theme/aristo/i/button/down-m.png +0 -0
- data/frameworks/uki/src/uki-theme/aristo/i/button/down-v.png +0 -0
- data/frameworks/uki/src/uki-theme/aristo/i/button/down.png +0 -0
- data/frameworks/uki/src/uki-theme/aristo/i/button/focusRing-c.png +0 -0
- data/frameworks/uki/src/uki-theme/aristo/i/button/focusRing-h.png +0 -0
- data/frameworks/uki/src/uki-theme/aristo/i/button/focusRing-m.png +0 -0
- data/frameworks/uki/src/uki-theme/aristo/i/button/focusRing-v.png +0 -0
- data/frameworks/uki/src/uki-theme/aristo/i/button/focusRing.png +0 -0
- data/frameworks/uki/src/uki-theme/aristo/i/button/normal-c.gif +0 -0
- data/frameworks/uki/src/uki-theme/aristo/i/button/normal-c.png +0 -0
- data/frameworks/uki/src/uki-theme/aristo/i/button/normal-h.png +0 -0
- data/frameworks/uki/src/uki-theme/aristo/i/button/normal-m.png +0 -0
- data/frameworks/uki/src/uki-theme/aristo/i/button/normal-v.png +0 -0
- data/frameworks/uki/src/uki-theme/aristo/i/button/normal.png +0 -0
- data/frameworks/uki/src/uki-theme/aristo/i/checkbox/focus.png +0 -0
- data/frameworks/uki/src/uki-theme/aristo/i/checkbox/normal.gif +0 -0
- data/frameworks/uki/src/uki-theme/aristo/i/checkbox/normal.png +0 -0
- data/frameworks/uki/src/uki-theme/aristo/i/panel/normal-h.png +0 -0
- data/frameworks/uki/src/uki-theme/aristo/i/panel/normal-m.png +0 -0
- data/frameworks/uki/src/uki-theme/aristo/i/panel/normal.png +0 -0
- data/frameworks/uki/src/uki-theme/aristo/i/popup/normal.png +0 -0
- data/frameworks/uki/src/uki-theme/aristo/i/radio/focus.png +0 -0
- data/frameworks/uki/src/uki-theme/aristo/i/radio/normal.gif +0 -0
- data/frameworks/uki/src/uki-theme/aristo/i/radio/normal.png +0 -0
- data/frameworks/uki/src/uki-theme/aristo/i/shadow/large-c.png +0 -0
- data/frameworks/uki/src/uki-theme/aristo/i/shadow/large-h.png +0 -0
- data/frameworks/uki/src/uki-theme/aristo/i/shadow/large-m.png +0 -0
- data/frameworks/uki/src/uki-theme/aristo/i/shadow/large-v.png +0 -0
- data/frameworks/uki/src/uki-theme/aristo/i/shadow/large.png +0 -0
- data/frameworks/uki/src/uki-theme/aristo/i/slider/bar-m.gif +0 -0
- data/frameworks/uki/src/uki-theme/aristo/i/slider/bar-m.png +0 -0
- data/frameworks/uki/src/uki-theme/aristo/i/slider/bar-v.gif +0 -0
- data/frameworks/uki/src/uki-theme/aristo/i/slider/bar-v.png +0 -0
- data/frameworks/uki/src/uki-theme/aristo/i/slider/bar.png +0 -0
- data/frameworks/uki/src/uki-theme/aristo/i/slider/handle.gif +0 -0
- data/frameworks/uki/src/uki-theme/aristo/i/slider/handle.png +0 -0
- data/frameworks/uki/src/uki-theme/aristo/i/splitPane/horizontal.gif +0 -0
- data/frameworks/uki/src/uki-theme/aristo/i/splitPane/horizontal.png +0 -0
- data/frameworks/uki/src/uki-theme/aristo/i/splitPane/vertical.gif +0 -0
- data/frameworks/uki/src/uki-theme/aristo/i/x.gif +0 -0
- data/frameworks/uki/src/uki-theme/aristo.js +217 -0
- data/frameworks/uki/src/uki-view/view/box.js +1 -0
- data/frameworks/uki/src/uki-view/view/button.js +126 -0
- data/frameworks/uki/src/uki-view/view/checkbox.js +36 -0
- data/frameworks/uki/src/uki-view/view/flow.js +48 -0
- data/frameworks/uki/src/uki-view/view/image.js +9 -0
- data/frameworks/uki/src/uki-view/view/label.js +123 -0
- data/frameworks/uki/src/uki-view/view/list/render.js +23 -0
- data/frameworks/uki/src/uki-view/view/list.js +442 -0
- data/frameworks/uki/src/uki-view/view/popup.js +113 -0
- data/frameworks/uki/src/uki-view/view/radio.js +57 -0
- data/frameworks/uki/src/uki-view/view/scrollPane.js +139 -0
- data/frameworks/uki/src/uki-view/view/slider.js +154 -0
- data/frameworks/uki/src/uki-view/view/splitPane.js +213 -0
- data/frameworks/uki/src/uki-view/view/table/column.js +96 -0
- data/frameworks/uki/src/uki-view/view/table/header.js +53 -0
- data/frameworks/uki/src/uki-view/view/table/render.js +25 -0
- data/frameworks/uki/src/uki-view/view/table.js +71 -0
- data/frameworks/uki/src/uki-view/view/textField.js +145 -0
- data/frameworks/uki/src/uki-view/view/toolbar.js +93 -0
- data/frameworks/uki/src/uki-view.js +15 -0
- data/frameworks/uki/src/uki.js +2 -0
- data/frameworks/uki/thin.yaml +11 -0
- data/frameworks/uki/uki.rb +38 -0
- data/frameworks/uki/uki.ru +2 -0
- data/lib/uki/include_js.rb +50 -0
- data/lib/uki/project.rb +207 -0
- data/lib/uki/routes.rb +20 -0
- data/lib/uki/server.rb +42 -0
- data/lib/uki.rb +9 -0
- data/templates/index.html.erb +10 -0
- data/templates/model.js.erb +5 -0
- data/templates/myapp.js.erb +44 -0
- data/templates/package.js.erb +3 -0
- data/templates/spec.html.erb +23 -0
- data/templates/spec.js.erb +6 -0
- data/templates/view.js.erb +10 -0
- data/uki.gemspec +281 -0
- metadata +317 -0
@@ -0,0 +1,140 @@
|
|
1
|
+
describe 'uki.Selector'
|
2
|
+
it 'should tokenize expression'
|
3
|
+
tokens = uki.Selector.tokenize('label > * > project.views.CustomView Label[name^="wow"]')[0];
|
4
|
+
tokens.should_eql ['label', '>', '*', '>', 'project.views.CustomView', 'Label[name^="wow"]']
|
5
|
+
end
|
6
|
+
|
7
|
+
it 'should copy find to uki'
|
8
|
+
uki.find.should.not.be_undefined
|
9
|
+
end
|
10
|
+
|
11
|
+
describe 'filtering'
|
12
|
+
before_each
|
13
|
+
tree = uki.build([
|
14
|
+
{ view: 'Box', rect: '0 0 1000 1000', name: 'top', childViews: [
|
15
|
+
{ view: 'Box', rect: '0 0 1000 1000', name: 'second', childViews: [
|
16
|
+
{ view: 'Box', rect: '10 10 100 100', name: 'third', someAttribute: true, childViews: [
|
17
|
+
{ view: 'Label', rect: '10 10 100 100', name: 'label1', someAttribute: false }
|
18
|
+
]},
|
19
|
+
{ view: 'Label', rect: '200 10 100 100', name: 'label2' }
|
20
|
+
]}
|
21
|
+
]}
|
22
|
+
]);
|
23
|
+
|
24
|
+
end
|
25
|
+
|
26
|
+
it 'by *'
|
27
|
+
elements = uki.Selector.find('*', tree);
|
28
|
+
elements.length.should.be 4
|
29
|
+
uki.attr(elements[0], 'name').should.be 'second'
|
30
|
+
uki.attr(elements[1], 'name').should.be 'third'
|
31
|
+
uki.attr(elements[2], 'name').should.be 'label1'
|
32
|
+
uki.attr(elements[3], 'name').should.be 'label2'
|
33
|
+
end
|
34
|
+
|
35
|
+
it 'by * *'
|
36
|
+
elements = uki.Selector.find('* *', tree);
|
37
|
+
elements.length.should.be 3
|
38
|
+
uki.attr(elements[0], 'name').should.be 'third'
|
39
|
+
uki.attr(elements[1], 'name').should.be 'label1'
|
40
|
+
uki.attr(elements[2], 'name').should.be 'label2'
|
41
|
+
end
|
42
|
+
|
43
|
+
it 'by full typeName()'
|
44
|
+
elements = uki.Selector.find('uki.view.Label', tree);
|
45
|
+
elements.length.should.be 2
|
46
|
+
uki.attr(elements[0], 'name').should.be 'label1'
|
47
|
+
uki.attr(elements[1], 'name').should.be 'label2'
|
48
|
+
end
|
49
|
+
|
50
|
+
it 'by contracted typeName()'
|
51
|
+
elements = uki.Selector.find('Box', tree);
|
52
|
+
elements.length.should.be 2
|
53
|
+
uki.attr(elements[0], 'name').should.be 'second'
|
54
|
+
uki.attr(elements[1], 'name').should.be 'third'
|
55
|
+
end
|
56
|
+
|
57
|
+
it 'by attribute'
|
58
|
+
elements = uki.Selector.find('[name=second]', tree);
|
59
|
+
elements.length.should.be 1
|
60
|
+
uki.attr(elements[0], 'name').should.be 'second'
|
61
|
+
end
|
62
|
+
|
63
|
+
it 'by attribute in brackets'
|
64
|
+
elements = uki.Selector.find('[name="second"]', tree);
|
65
|
+
elements.length.should.be 1
|
66
|
+
uki.attr(elements[0], 'name').should.be 'second'
|
67
|
+
end
|
68
|
+
|
69
|
+
it 'by attribute and typeName()'
|
70
|
+
elements = uki.Selector.find('Box[name=second]', tree);
|
71
|
+
elements.length.should.be 1
|
72
|
+
uki.attr(elements[0], 'name').should.be 'second'
|
73
|
+
end
|
74
|
+
|
75
|
+
it 'by ^= attribute'
|
76
|
+
elements = uki.Selector.find('[name^="label"]', tree);
|
77
|
+
elements.length.should.be 2
|
78
|
+
uki.attr(elements[0], 'name').should.be 'label1'
|
79
|
+
uki.attr(elements[1], 'name').should.be 'label2'
|
80
|
+
end
|
81
|
+
|
82
|
+
it 'by $= attribute'
|
83
|
+
elements = uki.Selector.find('*[name$="bel1"]', tree);
|
84
|
+
elements.length.should.be 1
|
85
|
+
uki.attr(elements[0], 'name').should.be 'label1'
|
86
|
+
end
|
87
|
+
|
88
|
+
it 'by ~= attribute'
|
89
|
+
elements = uki.Selector.find('*[name~="abe"]', tree);
|
90
|
+
elements.length.should.be 2
|
91
|
+
uki.attr(elements[0], 'name').should.be 'label1'
|
92
|
+
uki.attr(elements[1], 'name').should.be 'label2'
|
93
|
+
end
|
94
|
+
|
95
|
+
it 'by attribute presence'
|
96
|
+
elements = uki.Selector.find('*[someAttribute]', tree);
|
97
|
+
elements.length.should.be 1
|
98
|
+
uki.attr(elements[0], 'name').should.be 'third'
|
99
|
+
end
|
100
|
+
|
101
|
+
it 'direct children with >'
|
102
|
+
elements = uki.Selector.find('>', [tree[0].childViews()[0]]);
|
103
|
+
elements.length.should.be 2
|
104
|
+
uki.attr(elements[0], 'name').should.be 'third'
|
105
|
+
uki.attr(elements[1], 'name').should.be 'label2'
|
106
|
+
end
|
107
|
+
|
108
|
+
it 'direct children with > *'
|
109
|
+
elements = uki.Selector.find('> *', [tree[0].childViews()[0]]);
|
110
|
+
elements.length.should.be 2
|
111
|
+
uki.attr(elements[0], 'name').should.be 'third'
|
112
|
+
uki.attr(elements[1], 'name').should.be 'label2'
|
113
|
+
end
|
114
|
+
|
115
|
+
it 'right after with +'
|
116
|
+
elements = uki.Selector.find('Box + Label', tree);
|
117
|
+
elements.length.should.be 1
|
118
|
+
uki.attr(elements[0], 'name').should.be 'label2'
|
119
|
+
end
|
120
|
+
|
121
|
+
it 'direct children within container >'
|
122
|
+
elements = uki.Selector.find('Box > Label', tree);
|
123
|
+
elements.length.should.be 2
|
124
|
+
uki.attr(elements[0], 'name').should.be 'label2'
|
125
|
+
uki.attr(elements[1], 'name').should.be 'label1'
|
126
|
+
end
|
127
|
+
|
128
|
+
it 'by :eq modifier'
|
129
|
+
elements = uki.Selector.find('Box:eq(0) > Label:eq(0)', tree);
|
130
|
+
elements.length.should.be 1
|
131
|
+
uki.attr(elements[0], 'name').should.be 'label2'
|
132
|
+
end
|
133
|
+
|
134
|
+
it 'by :gt modifier'
|
135
|
+
elements = uki.Selector.find('Box:gt(0)', tree);
|
136
|
+
elements.length.should.be 1
|
137
|
+
uki.attr(elements[0], 'name').should.be 'third'
|
138
|
+
end
|
139
|
+
end
|
140
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
describe 'uki.theme.Template'
|
2
|
+
it 'should replace single value'
|
3
|
+
var t = new uki.theme.Template('<code>${value}</code>')
|
4
|
+
t.render({value: '111'}).should.be '<code>111</code>'
|
5
|
+
end
|
6
|
+
|
7
|
+
it 'should replace at the beggining of a string'
|
8
|
+
var t = new uki.theme.Template('${before}<code>${value}</code>')
|
9
|
+
t.render({before: '000', value: '111'}).should.be '000<code>111</code>'
|
10
|
+
end
|
11
|
+
|
12
|
+
it 'should replace at the end of a string'
|
13
|
+
var t = new uki.theme.Template('<code>${value}</code>${after}')
|
14
|
+
t.render({value: '111', after: '222'}).should.be '<code>111</code>222'
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'should replace several same values'
|
18
|
+
var t = new uki.theme.Template('<code>${value} ${value}</code>');
|
19
|
+
t.render({value: '111'}).should.be '<code>111 111</code>'
|
20
|
+
end
|
21
|
+
|
22
|
+
it 'should replace adjacent values'
|
23
|
+
var t = new uki.theme.Template('<code>${a}${b}</code>');
|
24
|
+
t.render({a: '111', b: '222'}).should.be '<code>111222</code>'
|
25
|
+
end
|
26
|
+
|
27
|
+
it 'should work with brackets'
|
28
|
+
var t = new uki.theme.Template('<code>${a} {something} ${b} .css { some code }</code>');
|
29
|
+
t.render({a: '111', b: '222'}).should.be '<code>111 {something} 222 .css { some code }</code>'
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,176 @@
|
|
1
|
+
describe 'uki.utils'
|
2
|
+
utils = uki.utils;
|
3
|
+
|
4
|
+
it 'should test isFunction'
|
5
|
+
var f1 = function() {};
|
6
|
+
function f2 () {};
|
7
|
+
utils.isFunction(function() {}).should.be_true('anonimous function')
|
8
|
+
utils.isFunction(f1).should.be_true('var f = function')
|
9
|
+
utils.isFunction(f2).should.be_true('function f')
|
10
|
+
utils.isFunction({}).should.not.be_true('object')
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'should test isArray'
|
14
|
+
var x = [1, 2]
|
15
|
+
utils.isArray([]).should.be_true('anonimous array')
|
16
|
+
utils.isArray(x).should.be_true('x = []')
|
17
|
+
utils.isArray({}).should.not.be_true('object')
|
18
|
+
end
|
19
|
+
|
20
|
+
describe '.each()'
|
21
|
+
it 'should iterate over array'
|
22
|
+
var count = 0;
|
23
|
+
utils.each([1, 1, 1], function() {
|
24
|
+
count ++;
|
25
|
+
});
|
26
|
+
count.should.be 3
|
27
|
+
end
|
28
|
+
|
29
|
+
it 'should set this to current element'
|
30
|
+
utils.each([1, 1, 1], function() {
|
31
|
+
this.valueOf().should.eql 1
|
32
|
+
});
|
33
|
+
end
|
34
|
+
|
35
|
+
it 'should iterate with given context'
|
36
|
+
var context = {};
|
37
|
+
utils.each([1, 1, 1], function() {
|
38
|
+
this.should.be context
|
39
|
+
}, context);
|
40
|
+
end
|
41
|
+
|
42
|
+
it 'should iterave over hash'
|
43
|
+
utils.each({a: 1, b: 1, c: 1}, function() {
|
44
|
+
this.valueOf().should.be 1
|
45
|
+
});
|
46
|
+
end
|
47
|
+
|
48
|
+
it 'should iterate over hash with given context'
|
49
|
+
var context = {};
|
50
|
+
utils.each({a: 1, b: 1, c: 1}, function() {
|
51
|
+
this.should.be context
|
52
|
+
}, context);
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
it 'should trim text'
|
57
|
+
utils.trim(' TEST TEST ').should.be 'TEST TEST'
|
58
|
+
end
|
59
|
+
|
60
|
+
it 'should escape html'
|
61
|
+
utils.escapeHTML('<span class="a">1</span>').should.be '<span class="a">1</span>'
|
62
|
+
end
|
63
|
+
|
64
|
+
it 'should test if is inArray'
|
65
|
+
utils.inArray(1, [0, 1, 2]).should.be 1
|
66
|
+
utils.inArray(3, [0, 1, 2]).should.be -1
|
67
|
+
end
|
68
|
+
|
69
|
+
it 'should make uniq array'
|
70
|
+
utils.unique([1, 1, 2, 3]).should.eql [1, 2, 3]
|
71
|
+
end
|
72
|
+
|
73
|
+
it 'should grep array for items'
|
74
|
+
var result = utils.grep([1, 2, 3, 4], function(v) {
|
75
|
+
return v > 2;
|
76
|
+
});
|
77
|
+
result.should.eql [3, 4]
|
78
|
+
end
|
79
|
+
|
80
|
+
it 'should map array'
|
81
|
+
var result = utils.map([1, 2, 3, 4], function(v) {
|
82
|
+
return -v;
|
83
|
+
});
|
84
|
+
result.should.eql [-1, -2, -3, -4]
|
85
|
+
end
|
86
|
+
|
87
|
+
it 'should reduce array'
|
88
|
+
var result = utils.reduce(1, [1,2,3,4], function(x, e) { return e*x; });
|
89
|
+
result.should.be 2*3*4
|
90
|
+
end
|
91
|
+
|
92
|
+
it 'should map in given context'
|
93
|
+
var context = {};
|
94
|
+
var result = utils.map([1, 2, 3, 4], function(v) {
|
95
|
+
this.should.be context
|
96
|
+
}, context);
|
97
|
+
end
|
98
|
+
|
99
|
+
it 'should map by field name (shortcut)'
|
100
|
+
var result = utils.map([{a: 1}, {a: 2}, {a: 3}], 'a');
|
101
|
+
result.should.eql [1, 2, 3]
|
102
|
+
end
|
103
|
+
|
104
|
+
it 'should map extend objects'
|
105
|
+
var e = utils.extend({a: 1}, {b: 2}, {c: 3, d: undefined});
|
106
|
+
e.should.eql {a: 1, b: 2, c: 3}
|
107
|
+
end
|
108
|
+
|
109
|
+
it 'should extend uki with utils'
|
110
|
+
var functions = ['isFunction', 'isArray', 'trim', 'escapeHTML', 'each', 'inArray', 'unique', 'grep', 'map', 'extend'];
|
111
|
+
utils.each(functions, function() {
|
112
|
+
uki[this].should.not.be_null
|
113
|
+
});
|
114
|
+
end
|
115
|
+
|
116
|
+
it 'should extend new class with base class'
|
117
|
+
base = function() {};
|
118
|
+
called = {};
|
119
|
+
base.prototype = {
|
120
|
+
a: function() {
|
121
|
+
called.a = true;
|
122
|
+
}
|
123
|
+
}
|
124
|
+
var sub = uki.newClass(base, { init: uki.F });
|
125
|
+
(new sub()).a();
|
126
|
+
called.a.should.be_true
|
127
|
+
end
|
128
|
+
|
129
|
+
it 'should extend new class with mixins'
|
130
|
+
base = function() {};
|
131
|
+
called = {};
|
132
|
+
base.prototype = {
|
133
|
+
a: function() {
|
134
|
+
called.a = true;
|
135
|
+
}
|
136
|
+
}
|
137
|
+
var sub = uki.newClass(base, { b: function() { called.b = true} }, { init: uki.F });
|
138
|
+
(new sub()).a();
|
139
|
+
(new sub()).b();
|
140
|
+
called.a.should.be_true
|
141
|
+
called.b.should.be_true
|
142
|
+
end
|
143
|
+
|
144
|
+
it 'should use function as a last parameter passing base classes to it'
|
145
|
+
base = function() {};
|
146
|
+
called = false;
|
147
|
+
base.prototype = {
|
148
|
+
a: function() {
|
149
|
+
called.a = true;
|
150
|
+
}
|
151
|
+
}
|
152
|
+
var sub = uki.newClass(base, { b: function() { called.b = true} }, function(b, mixin) {
|
153
|
+
called = true;
|
154
|
+
b.should.be base.prototype
|
155
|
+
mixin.b.should.not.be_null
|
156
|
+
this.init = uki.F;
|
157
|
+
this.b = uki.F;
|
158
|
+
});
|
159
|
+
(new sub()).b.should.not.be_null
|
160
|
+
called.should.be_true
|
161
|
+
end
|
162
|
+
|
163
|
+
it 'should filter unique elements in array'
|
164
|
+
a = [1, 2, 3, 1, 4]
|
165
|
+
uki.unique(a).should.eql [1, 2, 3, 4]
|
166
|
+
end
|
167
|
+
|
168
|
+
it 'should filter unique elements in array of objects'
|
169
|
+
x = {a: 1}
|
170
|
+
y = {b: 1}
|
171
|
+
z = {c: 1}
|
172
|
+
a = [x, y, x, y, z]
|
173
|
+
uki.unique(a).should.eql [x, y, z]
|
174
|
+
end
|
175
|
+
|
176
|
+
end
|
@@ -0,0 +1,86 @@
|
|
1
|
+
describe 'uki.view.Base'
|
2
|
+
|
3
|
+
before_each
|
4
|
+
v = new uki.view.Base('100 100');
|
5
|
+
end
|
6
|
+
|
7
|
+
it 'should create a dom node upon construction'
|
8
|
+
v.dom().should.not.be_null
|
9
|
+
end
|
10
|
+
|
11
|
+
it 'should delegate className to dom'
|
12
|
+
v.className('test')
|
13
|
+
v.className().should.be 'test'
|
14
|
+
v.dom().className.should.be 'test'
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'should delegate id to dom'
|
18
|
+
v.id('test')
|
19
|
+
v.id().should.be 'test'
|
20
|
+
v.dom().id.should.be 'test'
|
21
|
+
end
|
22
|
+
|
23
|
+
it 'should register id in a hash'
|
24
|
+
called = false
|
25
|
+
stub(uki, 'registerId').and_return(function(view) {
|
26
|
+
view.id().should.be 'test1'
|
27
|
+
called = true
|
28
|
+
});
|
29
|
+
v.id('test1')
|
30
|
+
called.should.be_true
|
31
|
+
end
|
32
|
+
|
33
|
+
it 'should unregister id from hash on change'
|
34
|
+
called = false
|
35
|
+
stub(uki, 'unregisterId').and_return(function(view) {
|
36
|
+
view.id().should.be 'test2'
|
37
|
+
called = true
|
38
|
+
});
|
39
|
+
v.id('test2')
|
40
|
+
v.id('test3')
|
41
|
+
called.should.be_true
|
42
|
+
end
|
43
|
+
|
44
|
+
it 'should attach background'
|
45
|
+
var bg = new uki.background.Null()
|
46
|
+
called = false
|
47
|
+
stub(bg, 'attachTo').and_return(function(view) {
|
48
|
+
view.should.be v
|
49
|
+
called = true
|
50
|
+
})
|
51
|
+
v.background(bg)
|
52
|
+
called.should.be_true
|
53
|
+
end
|
54
|
+
|
55
|
+
it 'should return default background if none specified'
|
56
|
+
v._defaultBackground = '#CCC'
|
57
|
+
v.background().should.be_an_instance_of uki.background.Css
|
58
|
+
end
|
59
|
+
|
60
|
+
it 'should set rect property'
|
61
|
+
v.rect('0 10 20 30')
|
62
|
+
v.rect().should.be_an_instance_of uki.geometry.Rect
|
63
|
+
end
|
64
|
+
|
65
|
+
it 'should set minSize and maxSize properties'
|
66
|
+
v.minSize('10 20').maxSize('100 200')
|
67
|
+
v.dom().style.minWidth.should.be '10px'
|
68
|
+
v.dom().style.minHeight.should.be '20px'
|
69
|
+
v.dom().style.maxWidth.should.be '100px'
|
70
|
+
v.dom().style.maxHeight.should.be '200px'
|
71
|
+
v.minSize().should.eql new uki.geometry.Size(10, 20)
|
72
|
+
v.maxSize().should.eql new uki.geometry.Size(100, 200)
|
73
|
+
end
|
74
|
+
|
75
|
+
it 'should normailze rect according to min and max sizes'
|
76
|
+
v.minSize('110 10')
|
77
|
+
v.rect().width.should.be 110
|
78
|
+
v.maxSize('200 50')
|
79
|
+
v.rect().height.should.be 50
|
80
|
+
end
|
81
|
+
|
82
|
+
it 'should return null for next/prev views'
|
83
|
+
v.nextView().should.be_null
|
84
|
+
v.prevView().should.be_null
|
85
|
+
end
|
86
|
+
end
|
@@ -0,0 +1,73 @@
|
|
1
|
+
describe 'uki.view.Container'
|
2
|
+
before_each
|
3
|
+
parentView = new uki.view.Container('100 200')
|
4
|
+
end
|
5
|
+
|
6
|
+
it 'should append child views'
|
7
|
+
child = new uki.view.Base('10 10')
|
8
|
+
parentView.appendChild(child)
|
9
|
+
parentView.childViews().length.should.be 1
|
10
|
+
parentView.childViews().should.eql [child]
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'should insert child before'
|
14
|
+
firstChild = new uki.view.Base('10 10')
|
15
|
+
secondChild = new uki.view.Base('10 10')
|
16
|
+
parentView.appendChild(secondChild)
|
17
|
+
parentView.insertBefore(firstChild, secondChild)
|
18
|
+
parentView.childViews().should.eql [firstChild, secondChild]
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'should set correct parent'
|
22
|
+
child = new uki.view.Base('10 10')
|
23
|
+
parentView.appendChild(child)
|
24
|
+
child.parent().should.be parentView
|
25
|
+
end
|
26
|
+
|
27
|
+
it 'should remove children'
|
28
|
+
child = new uki.view.Base('10 10')
|
29
|
+
parentView.appendChild(child)
|
30
|
+
parentView.removeChild(child)
|
31
|
+
child.parent().should.be_null
|
32
|
+
end
|
33
|
+
|
34
|
+
it 'should allow childViews() writing'
|
35
|
+
child = new uki.view.Base('10 10')
|
36
|
+
parentView.childViews([child])
|
37
|
+
parentView.childViews().should.eql [child]
|
38
|
+
end
|
39
|
+
|
40
|
+
it 'should remove children on childViews() write'
|
41
|
+
firstChild = new uki.view.Base('10 10')
|
42
|
+
secondChild = new uki.view.Base('10 10')
|
43
|
+
thirdChild = new uki.view.Base('10 10')
|
44
|
+
parentView.childViews([firstChild, secondChild])
|
45
|
+
parentView.childViews([secondChild, thirdChild])
|
46
|
+
firstChild.parent().should.be_null
|
47
|
+
secondChild.parent().should.be parentView
|
48
|
+
thirdChild.parent().should.be parentView
|
49
|
+
end
|
50
|
+
|
51
|
+
it 'should allow nextView, prevView accessors for children'
|
52
|
+
secondChild = new uki.view.Base('10 10')
|
53
|
+
firstChild = new uki.view.Base('10 10')
|
54
|
+
parentView.appendChild(firstChild)
|
55
|
+
parentView.appendChild(secondChild)
|
56
|
+
firstChild.nextView().should.be secondChild
|
57
|
+
secondChild.prevView().should.be firstChild
|
58
|
+
firstChild.prevView().should.be_null
|
59
|
+
secondChild.nextView().should.be_null
|
60
|
+
end
|
61
|
+
|
62
|
+
it 'should resize children on rect resize'
|
63
|
+
child = new uki.view.Base('10 10')
|
64
|
+
called = 0
|
65
|
+
stub(child, 'parentResized').and_return(function() {
|
66
|
+
called++;
|
67
|
+
});
|
68
|
+
parentView.appendChild(child)
|
69
|
+
parentView.rect('200 200')
|
70
|
+
called.should.be 1
|
71
|
+
end
|
72
|
+
|
73
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
describe 'uki.view'
|
2
|
+
it 'should declare new views'
|
3
|
+
called = false
|
4
|
+
uki.view.declare('tmp.view.TestView', uki.view.Base, function(base) {
|
5
|
+
base.should.be uki.view.Base.prototype
|
6
|
+
called = true
|
7
|
+
});
|
8
|
+
tmp.view.TestView.should.not.be_null
|
9
|
+
called.should.be_true
|
10
|
+
(new tmp.view.TestView()).typeName().should.be 'tmp.view.TestView'
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
include('uki-theme/airport.js');
|
@@ -0,0 +1,175 @@
|
|
1
|
+
include('const.js');
|
2
|
+
include('utils.js');
|
3
|
+
include('dom.js');
|
4
|
+
include('geometry.js');
|
5
|
+
include('view/observable.js');
|
6
|
+
|
7
|
+
(function() {
|
8
|
+
var self = uki.Attachment = uki.newClass(uki.view.Observable, /** @lends uki.Attachment.prototype */ {
|
9
|
+
/**
|
10
|
+
* Attachment serves as a connection between a uki view and a dom container.
|
11
|
+
* It notifies its view with parentResized on window resize.
|
12
|
+
* Attachment supports part of uki.view.Base API like #domForChild or #rectForChild
|
13
|
+
*
|
14
|
+
* @param {Element} dom Container element
|
15
|
+
* @param {uki.view.Base} view Attached view
|
16
|
+
* @param {uki.geometry.Rect} rect Initial size
|
17
|
+
*
|
18
|
+
* @see uki.view.Base#parentResized
|
19
|
+
* @name uki.Attachment
|
20
|
+
* @augments uki.view.Observable
|
21
|
+
* @constructor
|
22
|
+
*/
|
23
|
+
init: function( dom, view, rect ) {
|
24
|
+
uki.initNativeLayout();
|
25
|
+
|
26
|
+
this._dom = dom = dom || root;
|
27
|
+
this._view = view;
|
28
|
+
this._rect = Rect.create(rect) || this.rect();
|
29
|
+
|
30
|
+
uki.dom.offset.initialize();
|
31
|
+
|
32
|
+
view.parent(this);
|
33
|
+
this.domForChild().appendChild(view.dom());
|
34
|
+
|
35
|
+
if (dom != root && dom.tagName != 'BODY') {
|
36
|
+
var computedStyle = dom.runtimeStyle || dom.ownerDocument.defaultView.getComputedStyle(dom, null);
|
37
|
+
if (!computedStyle.position || computedStyle.position == 'static') dom.style.position = 'relative';
|
38
|
+
}
|
39
|
+
self.register(this);
|
40
|
+
|
41
|
+
this.layout();
|
42
|
+
},
|
43
|
+
|
44
|
+
/**
|
45
|
+
* Returns document.body if attached to window. Otherwise returns dom
|
46
|
+
* uki.view.Base api
|
47
|
+
*
|
48
|
+
* @type Element
|
49
|
+
*/
|
50
|
+
domForChild: function() {
|
51
|
+
return this._dom === root ? doc.body : this._dom;
|
52
|
+
},
|
53
|
+
|
54
|
+
/**
|
55
|
+
* uki.view.Base api
|
56
|
+
*
|
57
|
+
* @type uki.geometry.Rect
|
58
|
+
*/
|
59
|
+
rectForChild: function(child) {
|
60
|
+
return this.rect();
|
61
|
+
},
|
62
|
+
|
63
|
+
/**
|
64
|
+
* uki.view.Base api
|
65
|
+
*/
|
66
|
+
scroll: function() {
|
67
|
+
// TODO: support window scrolling
|
68
|
+
},
|
69
|
+
|
70
|
+
/**
|
71
|
+
* uki.view.Base api
|
72
|
+
*/
|
73
|
+
scrollTop: function() {
|
74
|
+
// TODO: support window scrolling
|
75
|
+
return this._dom.scrollTop || 0;
|
76
|
+
},
|
77
|
+
|
78
|
+
/**
|
79
|
+
* uki.view.Base api
|
80
|
+
*/
|
81
|
+
scrollLeft: function() {
|
82
|
+
// TODO: support window scrolling
|
83
|
+
return this._dom.scrollLeft || 0;
|
84
|
+
},
|
85
|
+
|
86
|
+
/**
|
87
|
+
* uki.view.Base api
|
88
|
+
*/
|
89
|
+
parent: function() {
|
90
|
+
return null;
|
91
|
+
},
|
92
|
+
|
93
|
+
/**
|
94
|
+
* On window resize resizes and layout its child view
|
95
|
+
* @fires event:layout
|
96
|
+
*/
|
97
|
+
layout: function() {
|
98
|
+
var oldRect = this._rect;
|
99
|
+
|
100
|
+
// if (rect.eq(this._rect)) return;
|
101
|
+
var newRect = this._rect = this.rect();
|
102
|
+
this._view.parentResized(oldRect, newRect);
|
103
|
+
if (this._view._needsLayout) this._view.layout();
|
104
|
+
this.trigger('layout', {source: this, rect: newRect});
|
105
|
+
},
|
106
|
+
|
107
|
+
/**
|
108
|
+
* @return {Element} Container dom
|
109
|
+
*/
|
110
|
+
dom: function() {
|
111
|
+
return this._dom;
|
112
|
+
},
|
113
|
+
|
114
|
+
/**
|
115
|
+
* @return {Element} Child view
|
116
|
+
*/
|
117
|
+
view: function() {
|
118
|
+
return this._view;
|
119
|
+
},
|
120
|
+
|
121
|
+
/**
|
122
|
+
* @private
|
123
|
+
* @return {uki.geometry.Rect} Size of the container
|
124
|
+
*/
|
125
|
+
rect: function() {
|
126
|
+
var width = this._dom === root || this._dom === doc.body ?
|
127
|
+
MAX(getRootElement().clientWidth, this._dom.offsetWidth || 0) :
|
128
|
+
this._dom.offsetWidth,
|
129
|
+
height = this._dom === root || this._dom === doc.body ?
|
130
|
+
MAX(getRootElement().clientHeight, this._dom.offsetHeight || 0) :
|
131
|
+
this._dom.offsetHeight;
|
132
|
+
|
133
|
+
return new Rect(width, height);
|
134
|
+
}
|
135
|
+
});
|
136
|
+
|
137
|
+
function getRootElement() {
|
138
|
+
return doc.compatMode == "CSS1Compat" && doc.documentElement || doc.body;
|
139
|
+
}
|
140
|
+
|
141
|
+
self.instances = [];
|
142
|
+
|
143
|
+
/**
|
144
|
+
* @memberOf uki.Attachment
|
145
|
+
*/
|
146
|
+
self.register = function(a) {
|
147
|
+
if (self.instances.length == 0) {
|
148
|
+
var timeout = false;
|
149
|
+
uki.dom.bind(root, 'resize', function() {
|
150
|
+
if (!timeout) {
|
151
|
+
timeout = true;
|
152
|
+
setTimeout(function() {
|
153
|
+
timeout = false;
|
154
|
+
uki.each(self.instances, function() { this.layout(); });
|
155
|
+
}, 1)
|
156
|
+
}
|
157
|
+
});
|
158
|
+
}
|
159
|
+
self.instances.push(a);
|
160
|
+
};
|
161
|
+
|
162
|
+
/**
|
163
|
+
* @memberOf uki.Attachment
|
164
|
+
*/
|
165
|
+
self.childViews = function() {
|
166
|
+
return uki.map(self.instances, 'view');
|
167
|
+
};
|
168
|
+
|
169
|
+
/**
|
170
|
+
* @memberOf uki.Attachment
|
171
|
+
*/
|
172
|
+
uki.top = function() {
|
173
|
+
return [self];
|
174
|
+
};
|
175
|
+
})();
|