uki 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/bin/uki +1 -1
- data/frameworks/uki/README.rdoc +1 -1
- data/frameworks/uki/examples/core-examples/controls/controls.js +6 -6
- data/frameworks/uki/examples/core-examples/flow/flow.js +4 -4
- data/frameworks/uki/examples/core-examples/linearGradient/gradient.svg +11 -0
- data/frameworks/uki/examples/core-examples/linearGradient/linearGradient.js +87 -0
- data/frameworks/uki/examples/core-examples/popup/popup.js +23 -10
- data/frameworks/uki/examples/core-examples/resizeToContents/resizeToContents.js +12 -1
- data/frameworks/uki/examples/core-examples/slider/slider.js +1 -1
- data/frameworks/uki/examples/core-examples/splitPaneExtended/splitPaneExtended.js +1 -1
- data/frameworks/uki/examples/core-examples/table/table.js +19 -2
- data/frameworks/uki/examples/core-examples/wave/wave-theme.js +1 -1
- data/frameworks/uki/examples/core-examples/wave/wave.js +1 -1
- data/frameworks/uki/examples/more-examples/radioButton/radioButton.js +3 -3
- data/frameworks/uki/examples/more-examples/select/select.js +35 -0
- data/frameworks/uki/examples/touch-examples/scrollPane/scrollPane.js +53 -0
- data/frameworks/uki/spec/unit/background.spec.js +1 -1
- data/frameworks/uki/spec/unit/selector.spec.js +28 -12
- data/frameworks/uki/spec/unit/utils.spec.js +14 -0
- data/frameworks/uki/src/uki-core.js +3 -1
- data/frameworks/uki/src/uki-core/after.js +57 -0
- data/frameworks/uki/src/uki-core/attachment.js +15 -6
- data/frameworks/uki/src/uki-core/background.js +4 -3
- data/frameworks/uki/src/uki-core/background/css.js +1 -0
- data/frameworks/uki/src/uki-core/background/cssBox.js +5 -3
- data/frameworks/uki/src/uki-core/background/linearGradient.js +112 -0
- data/frameworks/uki/src/uki-core/background/multi.js +2 -2
- data/frameworks/uki/src/uki-core/background/rows.js +1 -0
- data/frameworks/uki/src/uki-core/background/sliced9.js +5 -2
- data/frameworks/uki/src/uki-core/builder.js +5 -4
- data/frameworks/uki/src/uki-core/collection.js +18 -13
- data/frameworks/uki/src/uki-core/dom/browser.js +114 -0
- data/frameworks/uki/src/uki-core/dom/event.js +3 -0
- data/frameworks/uki/src/uki-core/image.js +1 -26
- data/frameworks/uki/src/uki-core/selector.js +5 -0
- data/frameworks/uki/src/uki-core/theme.js +24 -23
- data/frameworks/uki/src/uki-core/theme/template.js +1 -1
- data/frameworks/uki/src/uki-core/uki.js +7 -4
- data/frameworks/uki/src/uki-core/utils.js +51 -26
- data/frameworks/uki/src/uki-core/view.js +6 -3
- data/frameworks/uki/src/uki-core/view/base.js +16 -1
- data/frameworks/uki/src/uki-core/view/container.js +15 -5
- data/frameworks/uki/src/uki-core/view/focusable.js +17 -4
- data/frameworks/uki/src/uki-core/view/observable.js +15 -2
- data/frameworks/uki/src/uki-core/view/styleable.js +4 -11
- data/frameworks/uki/src/uki-data/ajax.js +4 -30
- data/frameworks/uki/src/uki-data/json.js +191 -0
- data/frameworks/uki/src/uki-data/localStore.js +37 -0
- data/frameworks/uki/src/uki-data/model.js +1 -1
- data/frameworks/uki/src/uki-more.js +4 -0
- data/frameworks/uki/src/uki-more/more/background.js +2 -0
- data/frameworks/uki/src/uki-more/more/color.js +168 -0
- data/frameworks/uki/src/uki-more/more/utils.js +5 -12
- data/frameworks/uki/src/uki-more/more/view.js +3 -1
- data/frameworks/uki/src/uki-more/more/view/form.js +30 -0
- data/frameworks/uki/src/uki-more/more/view/hTile.js +59 -0
- data/frameworks/uki/src/uki-more/more/view/nativeButton.js +3 -0
- data/frameworks/uki/src/uki-more/more/view/nativeCheckbox.js +38 -0
- data/frameworks/uki/src/uki-more/more/view/nativeControl.js +40 -0
- data/frameworks/uki/src/uki-more/more/view/nativeInput.js +78 -0
- data/frameworks/uki/src/uki-more/more/view/nativeSelect.js +29 -0
- data/frameworks/uki/src/uki-more/more/view/radioButton.js +1 -1
- data/frameworks/uki/src/uki-more/more/view/select-theme.js +55 -0
- data/frameworks/uki/src/uki-more/more/view/select.js +208 -0
- data/frameworks/uki/src/uki-theme/airport.js +145 -88
- data/frameworks/uki/src/uki-theme/airport/i/table/a-down.png +0 -0
- data/frameworks/uki/src/uki-theme/airport/i/table/a-up.png +0 -0
- data/frameworks/uki/src/uki-touch.js +2 -0
- data/frameworks/uki/src/uki-touch/touch.js +1 -0
- data/frameworks/uki/src/uki-touch/touch/const.js +24 -0
- data/frameworks/uki/src/uki-touch/touch/setup.js +52 -0
- data/frameworks/uki/src/uki-touch/touch/view.js +4 -0
- data/frameworks/uki/src/uki-touch/touch/view/scrollPane.js +505 -0
- data/frameworks/uki/src/uki-touch/touch/view/scrollableList.js +27 -0
- data/frameworks/uki/src/uki-view/view/box.js +9 -0
- data/frameworks/uki/src/uki-view/view/button.js +36 -1
- data/frameworks/uki/src/uki-view/view/checkbox.js +32 -3
- data/frameworks/uki/src/uki-view/view/flow.js +37 -9
- data/frameworks/uki/src/uki-view/view/image.js +14 -1
- data/frameworks/uki/src/uki-view/view/label.js +72 -11
- data/frameworks/uki/src/uki-view/view/list.js +143 -13
- data/frameworks/uki/src/uki-view/view/list/render.js +1 -0
- data/frameworks/uki/src/uki-view/view/popup.js +46 -2
- data/frameworks/uki/src/uki-view/view/radio.js +19 -4
- data/frameworks/uki/src/uki-view/view/scrollPane.js +91 -33
- data/frameworks/uki/src/uki-view/view/slider.js +67 -54
- data/frameworks/uki/src/uki-view/view/splitPane.js +102 -9
- data/frameworks/uki/src/uki-view/view/table.js +59 -2
- data/frameworks/uki/src/uki-view/view/table/column.js +45 -17
- data/frameworks/uki/src/uki-view/view/table/header.js +40 -12
- data/frameworks/uki/src/uki-view/view/table/render.js +4 -0
- data/frameworks/uki/src/uki-view/view/textField.js +75 -21
- data/frameworks/uki/src/uki-view/view/toolbar.js +16 -0
- data/lib/uki/builder.rb +1 -1
- data/lib/uki/include_js.rb +2 -2
- data/lib/uki/project.rb +14 -14
- data/templates/index.html.erb +2 -2
- data/templates/myapp.js.erb +2 -2
- data/uki.gemspec +34 -48
- metadata +44 -47
- data/frameworks/uki/src/uki-core/dom/nativeLayout.js +0 -18
- 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/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/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/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.
|
1
|
+
1.1.2
|
data/bin/uki
CHANGED
@@ -148,7 +148,7 @@ command :ie_images do |c|
|
|
148
148
|
c.description = 'Creates image files for IE6,7 from
|
149
149
|
data urls in the theme file.
|
150
150
|
|
151
|
-
[file] defaults to <
|
151
|
+
[file] defaults to <name>/theme.js
|
152
152
|
'
|
153
153
|
c.when_called do |args, option|
|
154
154
|
project = Uki::Project.new('.')
|
data/frameworks/uki/README.rdoc
CHANGED
@@ -26,7 +26,7 @@ It comes with a rich view-component library ranging from Sliders to Grids and Sp
|
|
26
26
|
5. uki() calls return Collection of Views. This is similar to jQuery('expression') result. You can
|
27
27
|
access individual views with [index]. You can manipulate all views at the same
|
28
28
|
time with a number of collection methods (http://ukijs.org/docs/symbols/uki.Collection.html)
|
29
|
-
uki('Label')[
|
29
|
+
uki('Label')[2] // get 3-d found label
|
30
30
|
6. Events are bound to Views (not individual DOM nodes) with the bind() function
|
31
31
|
uki('Label')[0].bind('click', function() { handle the event here }) // bind click to the first label
|
32
32
|
uki('Label').bind('click', function() { handle the event here }) // bind click to all labels
|
@@ -3,7 +3,7 @@
|
|
3
3
|
@example_order 20
|
4
4
|
@example_html
|
5
5
|
<style>body, html { overflow: hidden; margin: 0; padding: 0; }</style>
|
6
|
-
<div id="test" style="width:
|
6
|
+
<div id="test" style="width: 100%; height: 300px;"></div>
|
7
7
|
<script src="/src/uki.cjs"></script>
|
8
8
|
<script src="controls.js"></script>
|
9
9
|
*/
|
@@ -13,23 +13,23 @@
|
|
13
13
|
function views() {
|
14
14
|
return [
|
15
15
|
{ view: 'Button', rect: '10 10 200 24', anchors: 'left top', text: 'focusable button!' },
|
16
|
-
{ view: 'MultilineTextField', rect: '10
|
16
|
+
{ view: 'MultilineTextField', rect: '10 40 200 40', anchors: 'left top', value: 'textarea' },
|
17
17
|
|
18
|
-
{ view: 'Checkbox', rect: '250 10 24 24', anchors: 'left top', name: 'probe' },
|
18
|
+
{ view: 'Checkbox', rect: '250 10 24 24', anchors: 'left top', name: 'probe', focusable: true },
|
19
19
|
{ view: 'Label', rect: '275 10 100 24', anchors: 'left top', html: 'Checkbox 1' },
|
20
20
|
{ view: 'Checkbox', rect: '250 35 24 24', anchors: 'left top', checked: true },
|
21
21
|
{ view: 'Label', rect: '275 35 100 24', anchors: 'left top', text: 'Checkbox 2' },
|
22
22
|
|
23
|
-
{ view: 'Radio', rect: '720 10 24 24', anchors: 'left top', name: 'probe', group: 'radio_1' },
|
23
|
+
{ view: 'Radio', rect: '720 10 24 24', anchors: 'left top', name: 'probe', group: 'radio_1', focusable: true },
|
24
24
|
{ view: 'Label', rect: '745 10 100 24', anchors: 'left top', html: 'Radio 1' },
|
25
25
|
{ view: 'Radio', rect: '720 35 24 24', anchors: 'left top', checked: true, group: 'radio_1' },
|
26
26
|
{ view: 'Label', rect: '745 35 100 24', anchors: 'left top', text: 'Radio 2' },
|
27
27
|
|
28
28
|
{ view: 'TextField',rect: '400 10 100 24', anchors: 'left top', value: "Small input", placeholder: 'text' },
|
29
|
-
{ view: 'PasswordTextField',rect: '400
|
29
|
+
{ view: 'PasswordTextField',rect: '400 40 100 24', anchors: 'left top', value: "Small input", placeholder: 'text' },
|
30
30
|
{ view: 'Button', rect: '510 10 200 24', anchors: 'left top', text: 'button without focus!', focusable: false },
|
31
31
|
{ view: 'TextField',rect: '820 10 100 34', anchors: 'right top', value: "Big input" },
|
32
|
-
{ view: 'Slider', rect: '400
|
32
|
+
{ view: 'Slider', rect: '400 70 150 24', anchors: 'right top left width' }
|
33
33
|
];
|
34
34
|
}
|
35
35
|
|
@@ -27,15 +27,15 @@ for (var i=1; i < 11; i++) {
|
|
27
27
|
};
|
28
28
|
|
29
29
|
// resize to the number of labels appended and layout
|
30
|
-
uki('VFlow')
|
31
|
-
uki('HFlow')
|
30
|
+
uki('VFlow');
|
31
|
+
uki('HFlow');
|
32
32
|
|
33
33
|
// create button to remove items from vertical flow
|
34
34
|
uki({ view: 'Button', rect: '0 0 100 22', text: 'Remove' }).attachTo(window, '100 100').click(function() {
|
35
|
-
uki('VFlow').removeChild(uki('VFlow').childViews()[1])
|
35
|
+
uki('VFlow').removeChild(uki('VFlow').childViews()[1]);
|
36
36
|
});
|
37
37
|
|
38
38
|
// create button to remove items from horizontal flow
|
39
39
|
uki({ view: 'Button', rect: '0 30 100 22', text: 'Remove from list 2'}).attachTo(window, '100 100').resizeToContents('width').layout().click(function() {
|
40
|
-
uki('HFlow').removeChild(uki('HFlow').childViews()[1])
|
40
|
+
uki('HFlow').removeChild(uki('HFlow').childViews()[1]);
|
41
41
|
})
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<?xml version="1.0" standalone="no"?>
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
3
|
+
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewPort="0 0 100 100">
|
4
|
+
<defs>
|
5
|
+
<linearGradient id="MyGradient">
|
6
|
+
<stop offset="0%" stop-color="black"/>
|
7
|
+
<stop offset="100%" stop-color="white"/>
|
8
|
+
</linearGradient>
|
9
|
+
</defs>
|
10
|
+
<rect fill="url(#MyGradient)" stroke-width="0" width="100%" height="100%"/>
|
11
|
+
</svg>
|
@@ -0,0 +1,87 @@
|
|
1
|
+
/**
|
2
|
+
@example_title uki Linear Gradient
|
3
|
+
@example_order 4200
|
4
|
+
@example_html
|
5
|
+
<style>body, html { overflow: hidden; margin: 0; padding: 0; }</style>
|
6
|
+
<script src="/src/uki.cjs"></script>
|
7
|
+
<script src="linearGradient.js"></script>
|
8
|
+
*/
|
9
|
+
|
10
|
+
uki({
|
11
|
+
view: 'Box',
|
12
|
+
rect: '100 100 100 100',
|
13
|
+
anchors: 'left top',
|
14
|
+
background: new uki.background.LinearGradient({
|
15
|
+
startColor: '#FFFFFF',
|
16
|
+
endColor: '#E6E6E6',
|
17
|
+
css: ';border: 1px solid #CCC;'
|
18
|
+
})
|
19
|
+
}).attachTo(window, '1000 1000');
|
20
|
+
|
21
|
+
uki(
|
22
|
+
{
|
23
|
+
view: 'Box',
|
24
|
+
rect: '1000 80',
|
25
|
+
anchors: 'left top right',
|
26
|
+
background: new uki.background.LinearGradient({
|
27
|
+
startColor: '#E4E5EB',
|
28
|
+
endColor: '#AFB2B8',
|
29
|
+
stops: [ { pos: 0.75, color: '#ADAEB3' } ]
|
30
|
+
}),
|
31
|
+
childViews: [
|
32
|
+
{
|
33
|
+
view: 'Label',
|
34
|
+
rect: '100 28 100 44',
|
35
|
+
anchors: 'left top',
|
36
|
+
text: 'Button',
|
37
|
+
style: { textAlign: 'center', fontWeight: 'bold', color: '#333' },
|
38
|
+
background: new uki.background.LinearGradient({
|
39
|
+
startColor: '#FDFEFF',
|
40
|
+
stops: [
|
41
|
+
{ pos: 0.15, color: '#F5F7FD' },
|
42
|
+
{ pos: 0.8, color: '#C9CACF' }
|
43
|
+
],
|
44
|
+
endColor: '#C7CBD2',
|
45
|
+
|
46
|
+
innerHTML: '<div style="position:absolute;z-index:1;left:1px;bottom:0px;right:1px;height:1px;overflow:hidden;background:rgba(255,255,255,0.4)"></div>',
|
47
|
+
css: 'border:1px solid #666;' +
|
48
|
+
'-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;' +
|
49
|
+
'box-shadow:0 1px 0 rgba(255,255,255,0.5);-webkit-box-shadow:0 1px 0 rgba(255,255,255,0.5);' +
|
50
|
+
'-moz-box-shadow:0 1px 0 rgba(255,255,255,0.5);'
|
51
|
+
})
|
52
|
+
},
|
53
|
+
{
|
54
|
+
view: 'Label',
|
55
|
+
rect: '340 28 100 44',
|
56
|
+
anchors: 'left top',
|
57
|
+
text: 'Hover',
|
58
|
+
style: { textAlign: 'center', fontWeight: 'bold', color: '#333' },
|
59
|
+
background: new uki.background.LinearGradient({
|
60
|
+
startColor: '#FFFFFF',
|
61
|
+
stops: [
|
62
|
+
{ pos: 0.7, color: '#D7DAE4' }
|
63
|
+
],
|
64
|
+
endColor: '#D9DEE6',
|
65
|
+
css: 'border:1px solid #666;' + uki.browser.cssBorderRadius() + ':3px;' + uki.browser.cssBoxShadow() + ':0 1px 0 rgba(255,255,255,0.5);'
|
66
|
+
})
|
67
|
+
},
|
68
|
+
|
69
|
+
{ view: 'Button', rect: '220 28 100 44', anchors: 'left top', text: 'Original' }
|
70
|
+
]
|
71
|
+
}
|
72
|
+
).attachTo(window, '1000 1000');
|
73
|
+
|
74
|
+
uki({
|
75
|
+
view: 'Box',
|
76
|
+
rect: '250 100 400 400',
|
77
|
+
anchors: 'left top',
|
78
|
+
background: new uki.background.LinearGradient({
|
79
|
+
startColor: '#FFFFFF',
|
80
|
+
endColor: '#E6E6E6',
|
81
|
+
css: ';border: 1px solid #CCC;',
|
82
|
+
stops: [
|
83
|
+
{ pos: 0.5, color: '#CCCCCC' }
|
84
|
+
],
|
85
|
+
horizontal: true
|
86
|
+
})
|
87
|
+
}).attachTo(window, '1000 1000');
|
@@ -11,14 +11,21 @@
|
|
11
11
|
// create 8 buttons
|
12
12
|
uki({ view: 'Box', rect: '1000 400', anchors: 'left top', childViews: [
|
13
13
|
{ view: 'Button', rect: '10 370 100 24', anchors: 'left top', text: 'Left Bottom', id: 'left_bottom' },
|
14
|
-
{ view: 'Button', rect: '
|
14
|
+
{ view: 'Button', rect: '160 370 100 24', anchors: 'left top', text: 'Mid Bottom', id: 'mid_bottom' },
|
15
|
+
{ view: 'Button', rect: '320 370 100 24', anchors: 'left top', text: 'Right Bottom', id: 'right_bottom' },
|
15
16
|
{ view: 'Button', rect: '10 10 100 24', anchors: 'left top', text: 'Left Top', id: 'left_top' },
|
16
|
-
{ view: 'Button', rect: '
|
17
|
-
{ view: '
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
17
|
+
{ view: 'Button', rect: '160 10 100 24', anchors: 'left top', text: 'Mid Top', id: 'mid_top' },
|
18
|
+
{ view: 'Button', rect: '320 10 100 24', anchors: 'left top', text: 'Rigth Top', id: 'right_top' },
|
19
|
+
|
20
|
+
{ view: 'Button', rect: '450 190 100 24', anchors: 'left top', text: 'Mid', id: 'mid' },
|
21
|
+
|
22
|
+
{ view: 'Box', rect: '640 0 400 400', anchors: 'left top', childViews: [
|
23
|
+
{ view: 'Button', rect: '70 370 100 24', anchors: 'left top', text: 'Left Bottom', id: 'h_left_bottom' },
|
24
|
+
{ view: 'Button', rect: '180 370 100 24', anchors: 'left top', text: 'Right Bottom', id: 'h_right_bottom' },
|
25
|
+
{ view: 'Button', rect: '70 190 100 24', anchors: 'left top', text: 'Left Mid', id: 'h_left_mid' },
|
26
|
+
{ view: 'Button', rect: '70 10 100 24', anchors: 'left top', text: 'Left Top', id: 'h_left_top' },
|
27
|
+
{ view: 'Button', rect: '180 10 100 24', anchors: 'left top', text: 'Rigth Top', id: 'h_right_top' },
|
28
|
+
{ view: 'Button', rect: '180 190 100 24', anchors: 'left top', text: 'Right Mid', id: 'h_right_mid' }
|
22
29
|
] }
|
23
30
|
] }).attachTo( window, '1000 400' );
|
24
31
|
|
@@ -30,12 +37,18 @@ uki('Button').click(function() {
|
|
30
37
|
});
|
31
38
|
|
32
39
|
// attach on popup per button
|
33
|
-
uki({ view: 'Popup', rect: '120 120', anchors: 'left bottom',
|
34
|
-
uki({ view: 'Popup', rect: '120 120', anchors: '
|
40
|
+
uki({ view: 'Popup', rect: '120 120', anchors: 'left bottom', relativeTo: uki('#left_bottom')[0] })[0].show();
|
41
|
+
uki({ view: 'Popup', rect: '120 120', anchors: 'bottom', relativeTo: uki('#mid_bottom')[0] })[0].show();
|
42
|
+
uki({ view: 'Popup', rect: '120 120', anchors: 'left top', visible: true, relativeTo: uki('#left_top')[0] }).show();
|
43
|
+
uki({ view: 'Popup', rect: '120 120', anchors: 'top', visible: true, relativeTo: uki('#mid_top')[0] }).show();
|
35
44
|
uki({ view: 'Popup', rect: '120 120', anchors: 'right bottom', relativeTo: uki('#right_bottom')[0] }).show();
|
36
45
|
uki({ view: 'Popup', rect: '120 120', anchors: 'right top', relativeTo: uki('#right_top')[0] }).show();
|
37
46
|
|
47
|
+
uki({ view: 'Popup', rect: '120 120', anchors: '', relativeTo: uki('#mid')[0] }).show();
|
48
|
+
|
38
49
|
uki({ view: 'Popup', rect: '120 120', anchors: 'left bottom', horizontal: true, relativeTo: uki('#h_left_bottom')[0] }).show();
|
39
50
|
uki({ view: 'Popup', rect: '120 120', anchors: 'left top', horizontal: true, relativeTo: uki('#h_left_top')[0] }).show();
|
40
51
|
uki({ view: 'Popup', rect: '120 120', anchors: 'right bottom', horizontal: true, relativeTo: uki('#h_right_bottom')[0] }).show();
|
41
|
-
uki({ view: 'Popup', rect: '120 120', anchors: 'right top', horizontal: true, relativeTo: uki('#h_right_top')[0] }).show();
|
52
|
+
uki({ view: 'Popup', rect: '120 120', anchors: 'right top', horizontal: true, relativeTo: uki('#h_right_top')[0] }).show();
|
53
|
+
uki({ view: 'Popup', rect: '120 120', anchors: 'left', horizontal: true, relativeTo: uki('#h_left_mid')[0] }).show();
|
54
|
+
uki({ view: 'Popup', rect: '120 120', anchors: 'right', horizontal: true, relativeTo: uki('#h_right_mid')[0] }).show();
|
@@ -20,10 +20,21 @@ uki({
|
|
20
20
|
text: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.',
|
21
21
|
inset: '3 3', id: 'target'}
|
22
22
|
},
|
23
|
-
{view: 'Button', rect: '10 10 100 24', anchors: 'left top', text: 'resize', id: 'doIt' }
|
23
|
+
{view: 'Button', rect: '10 10 100 24', anchors: 'left top', text: 'resize', id: 'doIt' },
|
24
|
+
|
25
|
+
{ view: 'VFlow', rect: '300 10 200 100', background: '#CCC', anchors: 'left top right', childViews: [
|
26
|
+
{ view: 'Label', rect: '0 0 200 100', anchors: 'left top right',
|
27
|
+
multiline: true,
|
28
|
+
adaptToContents: true,
|
29
|
+
background: 'blue',
|
30
|
+
text: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.' },
|
31
|
+
{ view: 'Label', rect: '0 0 100 100', anchors: 'left top', text: 'stop' }
|
32
|
+
] }
|
24
33
|
]
|
25
34
|
}).attachTo( document.getElementById('test'), '1000 600' )
|
26
35
|
|
36
|
+
uki('VFlow Label').resizeToContents('height');
|
37
|
+
|
27
38
|
// on click
|
28
39
|
uki('#doIt').click(function () {
|
29
40
|
uki('#target')
|
@@ -9,7 +9,7 @@
|
|
9
9
|
|
10
10
|
uki({ view: 'Box', rect: '500 100', anchors: 'left top right bottom', childViews: [
|
11
11
|
{ view: 'Label', rect: '10 12 70 18', anchors: 'left top', text: 'Continuous' },
|
12
|
-
{ view: 'Slider', rect: '90 12 300 18', anchors: 'left right top' },
|
12
|
+
{ view: 'Slider', rect: '90 12 300 18', anchors: 'left right top', min: -5, max: 20, value: 3 },
|
13
13
|
{ view: 'TextField', rect: '400 10 90 22', anchors: 'right top' },
|
14
14
|
{ view: 'Label', rect: '10 68 70 18', anchors: 'left top', text: 'With steps' },
|
15
15
|
{ view: 'Slider', rect: '90 68 300 18', anchors: 'left right top', values: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] },
|
@@ -9,7 +9,7 @@
|
|
9
9
|
|
10
10
|
uki(
|
11
11
|
{ view: 'HSplitPane', rect: '1000 600', anchors: 'left top right bottom', handlePosition: 200, rightMin: 500, handleWidth: 1, id: 'top',
|
12
|
-
leftPane: { background: '#FFF' },
|
12
|
+
throttle: 42, leftPane: { background: '#FFF' },
|
13
13
|
rightChildViews: { view: 'HSplitPane', rect: '799 600', anchors: 'left top right bottom', id: 'second',
|
14
14
|
handlePosition: 300, autogrowRight: true, autogrowLeft: false, leftMin: 200, rightMin: 300, handleWidth: 1,
|
15
15
|
leftPane: { background: '#D0D7E2', childViews: [
|
@@ -31,7 +31,7 @@ uki({ view: 'HSplitPane', rect: '1000 1000', anchors: 'left top right bottom', h
|
|
31
31
|
] },
|
32
32
|
rightChildViews: [ // table with resizable columns
|
33
33
|
{ view: 'Table', rect: '0 0 800 1000', minSize: '0 200', anchors: 'left top right bottom', columns: [
|
34
|
-
{ view: 'table.NumberColumn', label: 'ID', width: 40 },
|
34
|
+
{ view: 'table.NumberColumn', label: 'ID', width: 40, sort: 'ASC' },
|
35
35
|
{ view: 'table.CustomColumn', label: 'Name', resizable: true, minWidth: 100, width: 250, formatter: formatHlted },
|
36
36
|
{ view: 'table.NumberColumn', label: 'Time', resizable: true, width: 50, formatter: formatTime },
|
37
37
|
{ view: 'table.CustomColumn', label: 'Artist', resizable: true, minWidth: 100, width: 150, formatter: formatHlted },
|
@@ -69,8 +69,25 @@ window.onLibraryLoad = function(data) {
|
|
69
69
|
model.bind('search.foundInChunk', function(chunk) {
|
70
70
|
table.data(table.data().concat(chunk)).layout();
|
71
71
|
});
|
72
|
+
|
73
|
+
table.find('Header').bind('columnClick', function(e) {
|
74
|
+
var header = this;
|
75
|
+
|
76
|
+
if (e.column.sort() == 'ASC') e.column.sort('DESC');
|
77
|
+
else e.column.sort('ASC');
|
78
|
+
|
79
|
+
header.redrawColumn(e.columnIndex);
|
80
|
+
uki.each(header.columns(), function(i, col) {
|
81
|
+
if (col != e.column && col.sort()) {
|
82
|
+
col.sort('');
|
83
|
+
header.redrawColumn(i);
|
84
|
+
}
|
85
|
+
});
|
86
|
+
model.items = e.column.sortData(model.items);
|
87
|
+
table.data(model.items);
|
88
|
+
})
|
72
89
|
|
73
|
-
table.data(model.items)
|
90
|
+
table.data(model.items);
|
74
91
|
|
75
92
|
uki('TextField').bind('keyup click', function() {
|
76
93
|
if (this.value().toLowerCase() == lastQuery) return;
|
@@ -134,7 +134,7 @@
|
|
134
134
|
return new uki.background.Sliced9({
|
135
135
|
v: [u(prefix + "v.png"), "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAYCAYAAADpnJ2CAAAD5klEQVRIx61Vi0+TdxTtH7UZBXQLZOFhMpgmGzHb1LklZi6Zc7Ch9GGdpQjIY0VYS4tACwUpopRXnM4NJiogaheYFFkHbLUP2lrGV/rk7Lu/ytYiFoSe5Cb9ve7pua9PIEiAJqOwpLrtE7NUk8edrNmFl+1NfFnzBs6qc7kq/bEZui/YDuihUJkZ/Ip3WlibhqL6dAhVmRCrciBp2P+f0Zr26bxAkQK6L1ZlR16LmBTRw9O8k9KWfKi6C9E3rMHE5BAs8zN49swKm83GbGHhT5im72Lgjgbq6wUo1ebjjDIdpxS7oLx60rUpWWnT+56vv98DefMHaO2X4f7jHzHPOyXnDocDi4uLcLlccLvdL5lz0YHH00PovFWG8rZDKKxLQaX+aCShMiIr132M67frMWt5woicTidz6PV6sby8DJ/Pl9CcbituT7RC0fUpvv0hFc39xZENc0ZFQMoofHO8KrvdztQsLS0xR4FAAKFQCOFwmNlGWDvzB1bw8yMdqg0foki1B2NTA/HhFSkzQ5R4bZ+UKSMyUkWK/H4/I4pEIlhdXcVWQPeWOBeMd6vwnTYL8rY82o4WkuaaSEZFckF7iM/ZjTgyUvU6ROsxax1Hfe8xCBv3wjR7KxpaRcfnDwpr90LTU4S/rX+xMMaS7QTBsB/dd0og1WXwaitpSyaQt+S7T9dn4OY9PSsQyhmFcadka3gw04uS9myoB06wpYCmBTUv9ROFkgqEcrbdMK6H1TWNC1fehagplZZuRihSZcNsMbHST6Y6gpdzoLzzPQibU9g6StiQhd+mR1jugsFg0tRFFZpRdiX3f0LKYbEyAz+NtYLjOBbOZGLcbIRMnwXN4BdRQqrSb+r2QTcoxnOv65VNvR2EwgFc/VWGc60Z6B+tieawsVd8vkCxG5UdH2HKMpJUwjm7ifWhuCUNU/ND0SolSNQ5EZH6HVwbrsA/Pk9SyJZXPBgcr4W8fT8uGg6ubcsY4eUeiaygbjeq+Nk3ZGpFIOjbWcOHVnDv9y7UGY/GqgvFzdMG4ynXGXUalMbjuP+kG5z/+TaVuTEy1QFV/3Gc1b7N5/B8vLpYKLo+iwgv78OlniMYGFNgwTnJt8jWejIUDsJie4i+0Wr+/WFItG/xlXli7dj8yu+i/qYkUtyYihJ9DguJYfgcJp72we75g4UqFv4gB5v7KUanu2EYkrL7NMZEzWmxyjybfvkfzd5wVXQeYA+ppOXtOfy0yEOF4QAudh1kRr/JyjpzGYlUl87uU4G8yFliZetBMZ+c+yVCfXTJeIR3lhpnNDnWrJZPASmKIQptmLOtEtM/5Y3bJI3ci3sJif4Fqpeom/ECPK8AAAAASUVORK5CYII=", u(prefix + "v.gif")],
|
136
136
|
m: [u(prefix + "m.png"), "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAATYAAAAYCAYAAABwbdFbAAAAo0lEQVR42u3XIQ7CABBE0T0VSeEGVHIRfEuQKAQa0zoM96qqrGqyWBwK0c17yb/CJBPnxy4lqVJxfbYpSZWKaZpSkioV8zynJFUqlmVJSapUrOuakrSlfokEKMawAYYNwLABGDYAwwZg2ADDBmDYAAwbgGEDMGyAYQMwbACGDeBvw3Z/n1KSttztdfyqzbiMh5SkLdeP++yGJruhyX5oXFGgng9Zp0b7vJwDoAAAAABJRU5ErkJggg=="]
|
137
|
-
}, "0 14 0 14", {inset: '0 -24 0 -8'});
|
137
|
+
}, "0 14 0 14", {inset: '0 -24 0 -8', zIndex: 2});
|
138
138
|
},
|
139
139
|
|
140
140
|
'panel-white': function() {
|
@@ -79,7 +79,7 @@ uki({ view: 'HSplitPane', id: 'splitMain', rect: '15 50 975 950', minSize: '800
|
|
79
79
|
{ view: 'Button', rect: '58 16 33 24', backgroundPrefix: 'plus-big-button-', anchors: 'left bottom', focusable: false }
|
80
80
|
] },
|
81
81
|
{ view: 'Toolbar', rect: '0 79 470 24', anchors: 'left top right', background: 'theme(toolbar-normal)', buttons: [
|
82
|
-
toolbarButton('Reply', '-128px 0'), toolbarButton('Playback', '-144px 0'), toolbarButton('Unfollow', '-16px 0'), toolbarButton('Archive', '-32px 0'), toolbarButton('Spam', '-48px 0'), toolbarButton('Read', '-64px 0'), toolbarButton('Unread', '-80px 0'), toolbarButton('Trash', '-96px 0'), toolbarButton('Move
|
82
|
+
toolbarButton('Reply', '-128px 0'), toolbarButton('Playback', '-144px 0'), toolbarButton('Unfollow', '-16px 0'), toolbarButton('Archive', '-32px 0'), toolbarButton('Spam', '-48px 0'), toolbarButton('Read', '-64px 0'), toolbarButton('Unread', '-80px 0'), toolbarButton('Trash', '-96px 0'), toolbarButton('Move to', '-112px 0')
|
83
83
|
] },
|
84
84
|
{ view: 'Label', id: 'message', rect: '0 103 470 791', anchors: 'left top right bottom', multiline: true, scrollable: true, inset: '2 2', textSelectable: true },
|
85
85
|
{ view: 'Box', rect: '0 894 470 32', background: 'theme(box-lblue-bottom)', anchors: 'left bottom right', childViews: [
|
@@ -9,9 +9,9 @@
|
|
9
9
|
*/
|
10
10
|
|
11
11
|
uki([
|
12
|
-
{ view: 'uki.more.view.RadioButton', rect: '15 40 70 24', text: 'Group 1', group: 'group_1' },
|
12
|
+
{ view: 'uki.more.view.RadioButton', rect: '15 40 70 24', text: 'Group 1', group: 'group_1', checked: true },
|
13
13
|
{ view: 'uki.more.view.RadioButton', rect: '90 40 70 24', text: 'Group 1', group: 'group_1' },
|
14
14
|
|
15
|
-
{ view: 'uki.more.view.RadioButton', rect: '200 40 70 24', text: 'Group 2', group: 'group_2' },
|
16
|
-
{ view: 'uki.more.view.RadioButton', rect: '275 40 70 24', text: 'Group 2', group: 'group_2'
|
15
|
+
{ view: 'uki.more.view.RadioButton', rect: '200 40 70 24', text: 'Group 2', group: 'group_2', checked: true },
|
16
|
+
{ view: 'uki.more.view.RadioButton', rect: '275 40 70 24', text: 'Group 2', group: 'group_2' }
|
17
17
|
]).attachTo( document.getElementById('test'), '400 100' );
|
@@ -0,0 +1,35 @@
|
|
1
|
+
/**
|
2
|
+
@example_title uki.more Select
|
3
|
+
@example_order 4200
|
4
|
+
@example_html
|
5
|
+
<style>body, html { overflow: hidden; margin: 0; padding: 0; }</style>
|
6
|
+
<script src="/src/uki.cjs"></script>
|
7
|
+
<script src="/src/uki-more.cjs"></script>
|
8
|
+
<script src="select.js"></script>
|
9
|
+
*/
|
10
|
+
|
11
|
+
var options = uki.map(uki.range(0, 100), function(i) {
|
12
|
+
return { value: i, text: 'option ' + i }
|
13
|
+
});
|
14
|
+
|
15
|
+
uki([
|
16
|
+
{
|
17
|
+
view: 'Select',
|
18
|
+
rect: '40 50 300 22',
|
19
|
+
anchors: 'left top',
|
20
|
+
rowHeight: 22,
|
21
|
+
options: options
|
22
|
+
},
|
23
|
+
|
24
|
+
{ view: 'TextField', rect: '40 10 100 22', anchors: 'left top', value: '0' },
|
25
|
+
|
26
|
+
{ view: 'Button', rect: '150 10 100 22', anchors: 'left top', text: 'Set value' }
|
27
|
+
]).attachTo(window, '1000 1000');
|
28
|
+
|
29
|
+
uki('Select').change(function() {
|
30
|
+
uki('TextField').value(this.value());
|
31
|
+
});
|
32
|
+
|
33
|
+
uki('Button').click(function() {
|
34
|
+
uki('Select').value(uki('TextField').value());
|
35
|
+
});
|
@@ -0,0 +1,53 @@
|
|
1
|
+
/**
|
2
|
+
@example_title Touch Scroll pane
|
3
|
+
@example_order 10001
|
4
|
+
@example_html
|
5
|
+
<style>body, html { overflow: hidden; margin: 0; padding: 0; }</style>
|
6
|
+
<script src="/src/uki.cjs"></script>
|
7
|
+
<script src="/src/uki-touch.cjs"></script>
|
8
|
+
<script src="scrollPane.js"></script>
|
9
|
+
*/
|
10
|
+
|
11
|
+
uki.touch.view.ScrollPane.prototype._touch = uki.touch.view.ScrollPane.prototype._touch || /webkit/i.test(navigator.userAgent); // force touch
|
12
|
+
uki.touch.setup({});
|
13
|
+
|
14
|
+
uki([
|
15
|
+
{
|
16
|
+
view: 'Label',
|
17
|
+
rect: '0 0 1000 49',
|
18
|
+
background: 'theme(panel)',
|
19
|
+
html: 'Panel' + (uki.touch.view.ScrollPane.prototype._touch ? '' : ' <strong style="color: #C00">Works only on webkit browsers</strong>'),
|
20
|
+
anchors: 'top left right',
|
21
|
+
inset: '10 10'
|
22
|
+
},
|
23
|
+
{
|
24
|
+
view: 'ScrollPane',
|
25
|
+
rect: '0 50 1000 950',
|
26
|
+
anchors: 'top left right bottom',
|
27
|
+
scrollableH: true, scrollableV: true,
|
28
|
+
childViews:
|
29
|
+
{
|
30
|
+
view: 'Box',
|
31
|
+
rect: '2000 2000',
|
32
|
+
anchors: 'top left',
|
33
|
+
background: '#CCF',
|
34
|
+
id: 'contents'
|
35
|
+
}
|
36
|
+
}
|
37
|
+
]).attachTo( window, '1000 1000' );
|
38
|
+
|
39
|
+
function rand () {
|
40
|
+
return 127 + (Math.random()*127 | 0);
|
41
|
+
}
|
42
|
+
|
43
|
+
for (var i=0; i < 10; i++) {
|
44
|
+
for (var j=0; j < 10; j++) {
|
45
|
+
uki('#contents').append(uki({
|
46
|
+
view: 'Box',
|
47
|
+
rect: new uki.geometry.Rect(i*200, j*200, 200, 200),
|
48
|
+
background: new uki.background.Css('rgb(' + [rand(), rand(), rand()].join(',') + ')'),
|
49
|
+
anchors: 'left top'
|
50
|
+
}));
|
51
|
+
}
|
52
|
+
};
|
53
|
+
uki('#contents').append(uki({ view: 'Label', rect: '10 10 100 20', anchors: 'left top', html: '2000×2000 pane' })).layout();
|
@@ -2,7 +2,7 @@ describe 'uki.background'
|
|
2
2
|
|
3
3
|
it 'should unserialize themed backgrounds'
|
4
4
|
b = uki.background('theme(panel)')
|
5
|
-
b.should.be_an_instance_of uki.background.
|
5
|
+
b.should.be_an_instance_of uki.background.LinearGradient
|
6
6
|
end
|
7
7
|
|
8
8
|
it 'should unserialize cssBox backgrounds'
|