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
@@ -1,40 +1,60 @@
|
|
1
|
+
/**
|
2
|
+
* Editable Text Field
|
3
|
+
*
|
4
|
+
* @author voloko
|
5
|
+
* @name uki.view.TextField
|
6
|
+
* @class
|
7
|
+
* @extends uki.view.Base
|
8
|
+
* @implements uki.view.Focusable
|
9
|
+
*/
|
1
10
|
uki.view.declare('uki.view.TextField', uki.view.Base, uki.view.Focusable, function(Base, Focusable) {
|
2
11
|
var emptyInputHeight = {};
|
3
12
|
|
4
|
-
function getEmptyInputHeight (
|
5
|
-
if (!emptyInputHeight[
|
6
|
-
var node = uki.createElement('input', Base.defaultCss + "border:none;padding:0;border:0;overflow:hidden;
|
13
|
+
function getEmptyInputHeight (css) {
|
14
|
+
if (!emptyInputHeight[css]) {
|
15
|
+
var node = uki.createElement('input', Base.defaultCss + "border:none;padding:0;border:0;margin:0;overflow:hidden;left:-999em;top:0;line-height:1;" + css);
|
7
16
|
uki.dom.probe(
|
8
17
|
node,
|
9
18
|
function(probe) {
|
10
|
-
emptyInputHeight[
|
19
|
+
emptyInputHeight[css] = probe.offsetHeight;
|
11
20
|
}
|
12
21
|
);
|
13
22
|
}
|
14
|
-
return emptyInputHeight[
|
23
|
+
return emptyInputHeight[css];
|
15
24
|
}
|
16
25
|
|
17
26
|
function nativePlaceholder (node) {
|
18
27
|
return typeof node.placeholder == 'string';
|
19
28
|
}
|
29
|
+
|
30
|
+
this._backgroundPrefix = '';
|
31
|
+
this._tagName = 'input';
|
32
|
+
this._type = 'text';
|
20
33
|
|
21
34
|
this._setup = function() {
|
22
35
|
Base._setup.apply(this, arguments);
|
23
36
|
uki.extend(this, {
|
24
37
|
_value: '',
|
25
38
|
_multiline: false,
|
26
|
-
_placeholder: ''
|
27
|
-
_backgroundPrefix: '',
|
28
|
-
_tagName: 'input',
|
29
|
-
_type: 'text'
|
39
|
+
_placeholder: ''
|
30
40
|
});
|
31
|
-
this.defaultCss += "margin:0;border:none;outline:none;padding:0;left:2px;top:0;z-index:100;resize:none;background: url(" + uki.theme.imageSrc('x') + ");" + uki.theme.style('input');
|
41
|
+
this.defaultCss += "margin:0;border:none;outline:none;padding:0;left:2px;top:0;z-index:100;-moz-resize:none;resize:none;background: url(" + uki.theme.imageSrc('x') + ");" + uki.theme.style('input');
|
32
42
|
};
|
33
43
|
|
34
44
|
this._updateBg = function() {
|
35
45
|
this._input.style.color = this._disabled ? '#999' : '#000';
|
36
46
|
};
|
37
47
|
|
48
|
+
/**
|
49
|
+
* @function
|
50
|
+
* @name uki.view.TextField#name
|
51
|
+
*/
|
52
|
+
uki.delegateProp(this, 'name', '_input');
|
53
|
+
|
54
|
+
/**
|
55
|
+
* @function
|
56
|
+
* @name uki.view.TextField#value
|
57
|
+
*/
|
38
58
|
this.value = function(value) {
|
39
59
|
if (value === undefined) return this._input.value;
|
40
60
|
|
@@ -43,6 +63,11 @@ uki.view.declare('uki.view.TextField', uki.view.Base, uki.view.Focusable, functi
|
|
43
63
|
return this;
|
44
64
|
};
|
45
65
|
|
66
|
+
/**
|
67
|
+
* Cross browser placeholder implementation
|
68
|
+
* @function
|
69
|
+
* @name uki.view.TextField#placeholder
|
70
|
+
*/
|
46
71
|
this.placeholder = uki.newProp('_placeholder', function(v) {
|
47
72
|
this._placeholder = v;
|
48
73
|
if (!this._multiline && nativePlaceholder(this._input)) {
|
@@ -54,7 +79,7 @@ uki.view.declare('uki.view.TextField', uki.view.Base, uki.view.Focusable, functi
|
|
54
79
|
this._dom.appendChild(this._placeholderDom);
|
55
80
|
this._updatePlaceholderVis();
|
56
81
|
uki.each(['fontSize', 'fontFamily', 'fontWeight'], function(i, name) {
|
57
|
-
this._placeholderDom.style[name] = this.style
|
82
|
+
this._placeholderDom.style[name] = this._input.style[name];
|
58
83
|
}, this);
|
59
84
|
|
60
85
|
uki.dom.bind(this._placeholderDom, 'mousedown', uki.proxy(function(e) {
|
@@ -68,20 +93,31 @@ uki.view.declare('uki.view.TextField', uki.view.Base, uki.view.Focusable, functi
|
|
68
93
|
});
|
69
94
|
|
70
95
|
this._style = function(name, value) {
|
71
|
-
if (
|
72
|
-
|
73
|
-
|
74
|
-
|
96
|
+
if (uki.inArray(name, uki.browser.textStyles) != -1) {
|
97
|
+
if (value === undefined) return this._input.style[name];
|
98
|
+
this._input.style[name] = value;
|
99
|
+
if (this._placeholderDom) this._placeholderDom.style[name] = value;
|
100
|
+
}
|
101
|
+
return Base._style.call(this, name, value);
|
75
102
|
};
|
76
103
|
|
104
|
+
/**
|
105
|
+
* @function
|
106
|
+
* @name uki.view.TextField#backgroundPrefix
|
107
|
+
*/
|
77
108
|
uki.addProps(this, ['backgroundPrefix']);
|
78
109
|
|
110
|
+
/**
|
111
|
+
* @function
|
112
|
+
* @name uki.view.TextField#defaultBackground
|
113
|
+
*/
|
79
114
|
this.defaultBackground = function() {
|
80
115
|
return uki.theme.background(this._backgroundPrefix + 'input');
|
81
116
|
};
|
82
117
|
|
83
118
|
this._createDom = function() {
|
84
|
-
this._dom = uki.createElement('div', Base.defaultCss + ';cursor:text;overflow:visible');
|
119
|
+
this._dom = uki.createElement('div', Base.defaultCss + ';cursor:text;overflow:visible;');
|
120
|
+
this._initClassName();
|
85
121
|
this._input = uki.createElement(this._tagName, this.defaultCss + (this._multiline ? '' : ';overflow:hidden;'));
|
86
122
|
|
87
123
|
this._input.value = this._value;
|
@@ -108,11 +144,11 @@ uki.view.declare('uki.view.TextField', uki.view.Base, uki.view.Focusable, functi
|
|
108
144
|
this._input.style.top = 2 + PX;
|
109
145
|
margin = '2px 0';
|
110
146
|
} else {
|
111
|
-
var o = (this._rect.height - getEmptyInputHeight(this.style('fontSize'))) / 2;
|
147
|
+
var o = (this._rect.height - getEmptyInputHeight( 'font-size:' + this.style('fontSize') + ';font-family:' + this.style('fontFamily') )) / 2;
|
112
148
|
margin = CEIL(o) + 'px 0 ' + FLOOR(o) + 'px 0';
|
113
|
-
this._input.style.
|
149
|
+
this._input.style.padding = margin;
|
114
150
|
}
|
115
|
-
if (this._placeholderDom) this._placeholderDom.style.
|
151
|
+
if (this._placeholderDom) this._placeholderDom.style.padding = margin;
|
116
152
|
};
|
117
153
|
|
118
154
|
this._updatePlaceholderVis = function() {
|
@@ -137,15 +173,32 @@ uki.view.declare('uki.view.TextField', uki.view.Base, uki.view.Focusable, functi
|
|
137
173
|
};
|
138
174
|
});
|
139
175
|
|
176
|
+
/**
|
177
|
+
* Multiline Editable Text Field (textarea)
|
178
|
+
*
|
179
|
+
* @author voloko
|
180
|
+
* @name uki.view.MultilineTextField
|
181
|
+
* @class
|
182
|
+
* @extends uki.view.TextField
|
183
|
+
*/
|
140
184
|
uki.view.declare('uki.view.MultilineTextField', uki.view.TextField, function(Base) {
|
185
|
+
this._tagName = 'textarea';
|
186
|
+
this._type = '';
|
187
|
+
|
141
188
|
this._setup = function() {
|
142
189
|
Base._setup.call(this);
|
143
|
-
this._tagName = 'textarea';
|
144
|
-
this._type = '';
|
145
190
|
this._multiline = true;
|
146
191
|
};
|
147
192
|
});
|
148
193
|
|
194
|
+
/**
|
195
|
+
* Password Field
|
196
|
+
*
|
197
|
+
* @author voloko
|
198
|
+
* @name uki.view.PasswordTextField
|
199
|
+
* @class
|
200
|
+
* @extends uki.view.TextField
|
201
|
+
*/
|
149
202
|
uki.view.declare('uki.view.PasswordTextField', uki.view.TextField, function(Base) {
|
150
203
|
this._setup = function() {
|
151
204
|
Base._setup.call(this);
|
@@ -153,3 +206,4 @@ uki.view.declare('uki.view.PasswordTextField', uki.view.TextField, function(Base
|
|
153
206
|
};
|
154
207
|
});
|
155
208
|
|
209
|
+
uki.Collection.addAttrs(['placeholder']);
|
@@ -3,6 +3,14 @@ include('flow.js');
|
|
3
3
|
|
4
4
|
uki.view.toolbar = {};
|
5
5
|
|
6
|
+
/**
|
7
|
+
* Toolbar
|
8
|
+
*
|
9
|
+
* @author voloko
|
10
|
+
* @name uki.view.Toolbar
|
11
|
+
* @class
|
12
|
+
* @extends uki.view.Container
|
13
|
+
*/
|
6
14
|
uki.view.declare('uki.view.Toolbar', uki.view.Container, function(Base) {
|
7
15
|
|
8
16
|
this.typeName = function() { return 'uki.view.Toolbar'; };
|
@@ -15,6 +23,10 @@ uki.view.declare('uki.view.Toolbar', uki.view.Container, function(Base) {
|
|
15
23
|
this._widths = [];
|
16
24
|
};
|
17
25
|
|
26
|
+
/**
|
27
|
+
* @function
|
28
|
+
* @name uki.view.Toolbar#buttons
|
29
|
+
*/
|
18
30
|
this.buttons = uki.newProp('_buttons', function(b) {
|
19
31
|
this._buttons = b;
|
20
32
|
var buttons = uki.build(uki.map(this._buttons, this._createButton, this)).resizeToContents('width');
|
@@ -22,6 +34,10 @@ uki.view.declare('uki.view.Toolbar', uki.view.Container, function(Base) {
|
|
22
34
|
this._totalWidth = uki.reduce(0, this._flow.childViews(), function(s, v) { return s + v.rect().width; });
|
23
35
|
});
|
24
36
|
|
37
|
+
/**
|
38
|
+
* @function
|
39
|
+
* @name uki.view.Toolbar#moreWidth
|
40
|
+
*/
|
25
41
|
uki.moreWidth = uki.newProp('_moreWidth', function(v) {
|
26
42
|
this._moreWidth = v;
|
27
43
|
this._updateMoreVisible();
|
data/lib/uki/builder.rb
CHANGED
data/lib/uki/include_js.rb
CHANGED
@@ -24,7 +24,7 @@ module Uki
|
|
24
24
|
else
|
25
25
|
include_path = File.expand_path File.join(base, $2)
|
26
26
|
unless included[include_path]
|
27
|
-
$1 + include_js(include_path, included, stack + [include_path]) + $3
|
27
|
+
$1 + include_js(include_path, included, stack + [include_path], &block) + $3
|
28
28
|
else
|
29
29
|
$1 + $3
|
30
30
|
end
|
@@ -40,7 +40,7 @@ module Uki
|
|
40
40
|
else
|
41
41
|
File.read(path)
|
42
42
|
end
|
43
|
-
|
43
|
+
(code || '').to_json
|
44
44
|
end
|
45
45
|
|
46
46
|
def self.extract_includes path
|
data/lib/uki/project.rb
CHANGED
@@ -15,10 +15,14 @@ class Uki::Project
|
|
15
15
|
@dest = dest
|
16
16
|
end
|
17
17
|
|
18
|
+
# def name
|
19
|
+
# File.basename File.expand_path(dest)
|
20
|
+
# end
|
21
|
+
|
18
22
|
def name
|
19
|
-
File.basename
|
23
|
+
File.basename(File.expand_path(dest)).sub(/[^a-z0-9_$]+/, '_')
|
20
24
|
end
|
21
|
-
|
25
|
+
|
22
26
|
def create options
|
23
27
|
verify_empty
|
24
28
|
init_dest
|
@@ -161,9 +165,9 @@ class Uki::Project
|
|
161
165
|
end
|
162
166
|
|
163
167
|
def init_dest
|
164
|
-
FileUtils.mkdir_p File.join(dest,
|
165
|
-
['view', 'model', 'layout', 'controller'].each do |
|
166
|
-
FileUtils.mkdir_p File.join(dest,
|
168
|
+
FileUtils.mkdir_p File.join(dest, name)
|
169
|
+
['view', 'model', 'layout', 'controller'].each do |n|
|
170
|
+
FileUtils.mkdir_p File.join(dest, name, n)
|
167
171
|
end
|
168
172
|
end
|
169
173
|
|
@@ -171,25 +175,21 @@ class Uki::Project
|
|
171
175
|
File.open(File.join(dest, 'index.html'), 'w') do |f|
|
172
176
|
f.write template('index.html').result(binding)
|
173
177
|
end
|
174
|
-
File.open(File.join(dest, "#{
|
178
|
+
File.open(File.join(dest, "#{name}.js"), 'w') do |f|
|
175
179
|
f.write template('myapp.js').result(binding)
|
176
180
|
end
|
177
181
|
|
178
|
-
create_function 'layout.js', "#{
|
182
|
+
create_function 'layout.js', "#{name}.layout.main"
|
179
183
|
|
180
|
-
['view', 'model', 'layout', 'controller'].each do |
|
181
|
-
File.open(File.join(dest,
|
182
|
-
package_name = "#{
|
184
|
+
['view', 'model', 'layout', 'controller'].each do |n|
|
185
|
+
File.open(File.join(dest, name, "#{n}.js"), 'w') do |f|
|
186
|
+
package_name = "#{name}.#{n}"
|
183
187
|
f.write template('package.js').result(binding)
|
184
188
|
end
|
185
189
|
end
|
186
190
|
|
187
191
|
end
|
188
192
|
|
189
|
-
def project_name
|
190
|
-
File.basename dest
|
191
|
-
end
|
192
|
-
|
193
193
|
def copy_frameworks
|
194
194
|
FileUtils.mkdir_p File.join(dest, 'frameworks')
|
195
195
|
frameworks_dest = File.join(dest, 'frameworks', 'uki')
|
data/templates/index.html.erb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
<!DOCTYPE html>
|
2
2
|
<html>
|
3
3
|
<head>
|
4
|
-
<title><%=
|
4
|
+
<title><%= name.capitalize %></title>
|
5
5
|
<style>body, html { margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden };</style>
|
6
6
|
</head>
|
7
7
|
<body>
|
8
|
-
<script src="<%=
|
8
|
+
<script src="<%= name %>.cjs"></script>
|
9
9
|
</body>
|
10
10
|
</html>
|
data/templates/myapp.js.erb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
(function() {
|
2
2
|
// define namespace
|
3
|
-
<%=
|
3
|
+
<%= name %> = {};
|
4
4
|
|
5
5
|
// all core modules
|
6
6
|
include('frameworks/uki/uki-core.js');
|
@@ -34,7 +34,7 @@ uki.theme.airport.imagePath = 'i/';
|
|
34
34
|
// skip interface creation if we're testing
|
35
35
|
if (window.TESTING) return;
|
36
36
|
|
37
|
-
<%=
|
37
|
+
<%= name %>.layout.main().attachTo(window, '300 62');
|
38
38
|
|
39
39
|
uki('Button').click(function() {
|
40
40
|
alert(this.text());
|
data/uki.gemspec
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
# Generated by jeweler
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in
|
3
|
+
# Instead, edit Jeweler::Tasks in rakefile, and run the gemspec command
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{uki}
|
8
|
-
s.version = "1.1.
|
8
|
+
s.version = "1.1.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Vladimir Kolesnikov"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-10-18}
|
13
13
|
s.default_executable = %q{uki}
|
14
14
|
s.description = %q{Project creation, dev server, testing, building for uki apps}
|
15
15
|
s.email = %q{voloko@gmail.com}
|
@@ -44,6 +44,8 @@ Gem::Specification.new do |s|
|
|
44
44
|
"frameworks/uki/examples/core-examples/controls/controls.js",
|
45
45
|
"frameworks/uki/examples/core-examples/dnd/dnd.js",
|
46
46
|
"frameworks/uki/examples/core-examples/flow/flow.js",
|
47
|
+
"frameworks/uki/examples/core-examples/linearGradient/gradient.svg",
|
48
|
+
"frameworks/uki/examples/core-examples/linearGradient/linearGradient.js",
|
47
49
|
"frameworks/uki/examples/core-examples/list/list.js",
|
48
50
|
"frameworks/uki/examples/core-examples/popup/popup.js",
|
49
51
|
"frameworks/uki/examples/core-examples/resizeToContents/resizeToContents.js",
|
@@ -168,12 +170,14 @@ Gem::Specification.new do |s|
|
|
168
170
|
"frameworks/uki/examples/css/index.css",
|
169
171
|
"frameworks/uki/examples/css/reset.css",
|
170
172
|
"frameworks/uki/examples/more-examples/radioButton/radioButton.js",
|
173
|
+
"frameworks/uki/examples/more-examples/select/select.js",
|
171
174
|
"frameworks/uki/examples/more-examples/splitTable/library.js",
|
172
175
|
"frameworks/uki/examples/more-examples/splitTable/searchable.js",
|
173
176
|
"frameworks/uki/examples/more-examples/splitTable/splitTable.js",
|
174
177
|
"frameworks/uki/examples/more-examples/toggleButton/toggleButton.js",
|
175
178
|
"frameworks/uki/examples/more-examples/treeList/i/arrows.png",
|
176
179
|
"frameworks/uki/examples/more-examples/treeList/treeList.js",
|
180
|
+
"frameworks/uki/examples/touch-examples/scrollPane/scrollPane.js",
|
177
181
|
"frameworks/uki/examples/views/example.haml",
|
178
182
|
"frameworks/uki/examples/views/exampleList.haml",
|
179
183
|
"frameworks/uki/server.rb",
|
@@ -204,10 +208,12 @@ Gem::Specification.new do |s|
|
|
204
208
|
"frameworks/uki/spec/unit/view/container.spec.js",
|
205
209
|
"frameworks/uki/src/airport.js",
|
206
210
|
"frameworks/uki/src/uki-core.js",
|
211
|
+
"frameworks/uki/src/uki-core/after.js",
|
207
212
|
"frameworks/uki/src/uki-core/attachment.js",
|
208
213
|
"frameworks/uki/src/uki-core/background.js",
|
209
214
|
"frameworks/uki/src/uki-core/background/css.js",
|
210
215
|
"frameworks/uki/src/uki-core/background/cssBox.js",
|
216
|
+
"frameworks/uki/src/uki-core/background/linearGradient.js",
|
211
217
|
"frameworks/uki/src/uki-core/background/multi.js",
|
212
218
|
"frameworks/uki/src/uki-core/background/null.js",
|
213
219
|
"frameworks/uki/src/uki-core/background/rows.js",
|
@@ -216,9 +222,9 @@ Gem::Specification.new do |s|
|
|
216
222
|
"frameworks/uki/src/uki-core/collection.js",
|
217
223
|
"frameworks/uki/src/uki-core/const.js",
|
218
224
|
"frameworks/uki/src/uki-core/dom.js",
|
225
|
+
"frameworks/uki/src/uki-core/dom/browser.js",
|
219
226
|
"frameworks/uki/src/uki-core/dom/dnd.js",
|
220
227
|
"frameworks/uki/src/uki-core/dom/event.js",
|
221
|
-
"frameworks/uki/src/uki-core/dom/nativeLayout.js",
|
222
228
|
"frameworks/uki/src/uki-core/dom/offset.js",
|
223
229
|
"frameworks/uki/src/uki-core/dom/w3cdnd.js",
|
224
230
|
"frameworks/uki/src/uki-core/geometry.js",
|
@@ -239,14 +245,27 @@ Gem::Specification.new do |s|
|
|
239
245
|
"frameworks/uki/src/uki-data.js",
|
240
246
|
"frameworks/uki/src/uki-data/ajax.js",
|
241
247
|
"frameworks/uki/src/uki-data/data.js",
|
248
|
+
"frameworks/uki/src/uki-data/json.js",
|
249
|
+
"frameworks/uki/src/uki-data/localStore.js",
|
242
250
|
"frameworks/uki/src/uki-data/model.js",
|
243
251
|
"frameworks/uki/src/uki-data/observable.js",
|
244
252
|
"frameworks/uki/src/uki-more.js",
|
245
253
|
"frameworks/uki/src/uki-more/more.js",
|
254
|
+
"frameworks/uki/src/uki-more/more/background.js",
|
255
|
+
"frameworks/uki/src/uki-more/more/color.js",
|
246
256
|
"frameworks/uki/src/uki-more/more/utils.js",
|
247
257
|
"frameworks/uki/src/uki-more/more/view.js",
|
258
|
+
"frameworks/uki/src/uki-more/more/view/form.js",
|
259
|
+
"frameworks/uki/src/uki-more/more/view/hTile.js",
|
248
260
|
"frameworks/uki/src/uki-more/more/view/listContainer.js",
|
261
|
+
"frameworks/uki/src/uki-more/more/view/nativeButton.js",
|
262
|
+
"frameworks/uki/src/uki-more/more/view/nativeCheckbox.js",
|
263
|
+
"frameworks/uki/src/uki-more/more/view/nativeControl.js",
|
264
|
+
"frameworks/uki/src/uki-more/more/view/nativeInput.js",
|
265
|
+
"frameworks/uki/src/uki-more/more/view/nativeSelect.js",
|
249
266
|
"frameworks/uki/src/uki-more/more/view/radioButton.js",
|
267
|
+
"frameworks/uki/src/uki-more/more/view/select-theme.js",
|
268
|
+
"frameworks/uki/src/uki-more/more/view/select.js",
|
250
269
|
"frameworks/uki/src/uki-more/more/view/splitTable.js",
|
251
270
|
"frameworks/uki/src/uki-more/more/view/splitTable/render.js",
|
252
271
|
"frameworks/uki/src/uki-more/more/view/toggleButton.js",
|
@@ -254,59 +273,19 @@ Gem::Specification.new do |s|
|
|
254
273
|
"frameworks/uki/src/uki-more/more/view/treeList/render.js",
|
255
274
|
"frameworks/uki/src/uki-theamless.js",
|
256
275
|
"frameworks/uki/src/uki-theme/airport.js",
|
257
|
-
"frameworks/uki/src/uki-theme/airport/i/button/down-c.gif",
|
258
|
-
"frameworks/uki/src/uki-theme/airport/i/button/down-c.png",
|
259
|
-
"frameworks/uki/src/uki-theme/airport/i/button/down-h.gif",
|
260
|
-
"frameworks/uki/src/uki-theme/airport/i/button/down-h.png",
|
261
|
-
"frameworks/uki/src/uki-theme/airport/i/button/down-m.png",
|
262
|
-
"frameworks/uki/src/uki-theme/airport/i/button/down-v.png",
|
263
|
-
"frameworks/uki/src/uki-theme/airport/i/button/focusRing-c.png",
|
264
|
-
"frameworks/uki/src/uki-theme/airport/i/button/focusRing-h.png",
|
265
|
-
"frameworks/uki/src/uki-theme/airport/i/button/focusRing-m.png",
|
266
|
-
"frameworks/uki/src/uki-theme/airport/i/button/focusRing-v.png",
|
267
|
-
"frameworks/uki/src/uki-theme/airport/i/button/focusRing.png",
|
268
|
-
"frameworks/uki/src/uki-theme/airport/i/button/hover-c.gif",
|
269
|
-
"frameworks/uki/src/uki-theme/airport/i/button/hover-c.png",
|
270
|
-
"frameworks/uki/src/uki-theme/airport/i/button/hover-h.gif",
|
271
|
-
"frameworks/uki/src/uki-theme/airport/i/button/hover-h.png",
|
272
|
-
"frameworks/uki/src/uki-theme/airport/i/button/hover-m.png",
|
273
|
-
"frameworks/uki/src/uki-theme/airport/i/button/hover-v.png",
|
274
|
-
"frameworks/uki/src/uki-theme/airport/i/button/hover.png",
|
275
|
-
"frameworks/uki/src/uki-theme/airport/i/button/normal-c.gif",
|
276
|
-
"frameworks/uki/src/uki-theme/airport/i/button/normal-c.png",
|
277
|
-
"frameworks/uki/src/uki-theme/airport/i/button/normal-h.gif",
|
278
|
-
"frameworks/uki/src/uki-theme/airport/i/button/normal-h.png",
|
279
|
-
"frameworks/uki/src/uki-theme/airport/i/button/normal-m.png",
|
280
|
-
"frameworks/uki/src/uki-theme/airport/i/button/normal-v.png",
|
281
|
-
"frameworks/uki/src/uki-theme/airport/i/button/normal.png",
|
282
276
|
"frameworks/uki/src/uki-theme/airport/i/checkbox/checkbox.png",
|
283
277
|
"frameworks/uki/src/uki-theme/airport/i/checkbox/focus.png",
|
284
278
|
"frameworks/uki/src/uki-theme/airport/i/checkbox/normal.gif",
|
285
279
|
"frameworks/uki/src/uki-theme/airport/i/checkbox/normal.png",
|
286
|
-
"frameworks/uki/src/uki-theme/airport/i/panel/dark-h.gif",
|
287
|
-
"frameworks/uki/src/uki-theme/airport/i/panel/dark-h.png",
|
288
|
-
"frameworks/uki/src/uki-theme/airport/i/panel/dark-m.png",
|
289
|
-
"frameworks/uki/src/uki-theme/airport/i/panel/dark.png",
|
290
|
-
"frameworks/uki/src/uki-theme/airport/i/popup/normal.png",
|
291
280
|
"frameworks/uki/src/uki-theme/airport/i/radio/focus.png",
|
292
281
|
"frameworks/uki/src/uki-theme/airport/i/radio/normal.gif",
|
293
282
|
"frameworks/uki/src/uki-theme/airport/i/radio/normal.png",
|
294
283
|
"frameworks/uki/src/uki-theme/airport/i/radio/radio.png",
|
295
|
-
"frameworks/uki/src/uki-theme/airport/i/shadow/large-c.png",
|
296
|
-
"frameworks/uki/src/uki-theme/airport/i/shadow/large-h.png",
|
297
|
-
"frameworks/uki/src/uki-theme/airport/i/shadow/large-m.png",
|
298
|
-
"frameworks/uki/src/uki-theme/airport/i/shadow/large-v.png",
|
299
|
-
"frameworks/uki/src/uki-theme/airport/i/shadow/large.png",
|
300
|
-
"frameworks/uki/src/uki-theme/airport/i/slider/bar-m.gif",
|
301
|
-
"frameworks/uki/src/uki-theme/airport/i/slider/bar-m.png",
|
302
|
-
"frameworks/uki/src/uki-theme/airport/i/slider/bar-v.gif",
|
303
|
-
"frameworks/uki/src/uki-theme/airport/i/slider/bar-v.png",
|
304
|
-
"frameworks/uki/src/uki-theme/airport/i/slider/bar.png",
|
305
|
-
"frameworks/uki/src/uki-theme/airport/i/slider/focus.png",
|
306
|
-
"frameworks/uki/src/uki-theme/airport/i/slider/handle.gif",
|
307
284
|
"frameworks/uki/src/uki-theme/airport/i/splitPane/horizontal.gif",
|
308
285
|
"frameworks/uki/src/uki-theme/airport/i/splitPane/horizontal.png",
|
309
286
|
"frameworks/uki/src/uki-theme/airport/i/splitPane/vertical.gif",
|
287
|
+
"frameworks/uki/src/uki-theme/airport/i/table/a-down.png",
|
288
|
+
"frameworks/uki/src/uki-theme/airport/i/table/a-up.png",
|
310
289
|
"frameworks/uki/src/uki-theme/airport/i/x.gif",
|
311
290
|
"frameworks/uki/src/uki-theme/aristo.js",
|
312
291
|
"frameworks/uki/src/uki-theme/aristo/i/button/down-c.gif",
|
@@ -352,6 +331,13 @@ Gem::Specification.new do |s|
|
|
352
331
|
"frameworks/uki/src/uki-theme/aristo/i/splitPane/horizontal.png",
|
353
332
|
"frameworks/uki/src/uki-theme/aristo/i/splitPane/vertical.gif",
|
354
333
|
"frameworks/uki/src/uki-theme/aristo/i/x.gif",
|
334
|
+
"frameworks/uki/src/uki-touch.js",
|
335
|
+
"frameworks/uki/src/uki-touch/touch.js",
|
336
|
+
"frameworks/uki/src/uki-touch/touch/const.js",
|
337
|
+
"frameworks/uki/src/uki-touch/touch/setup.js",
|
338
|
+
"frameworks/uki/src/uki-touch/touch/view.js",
|
339
|
+
"frameworks/uki/src/uki-touch/touch/view/scrollPane.js",
|
340
|
+
"frameworks/uki/src/uki-touch/touch/view/scrollableList.js",
|
355
341
|
"frameworks/uki/src/uki-view.js",
|
356
342
|
"frameworks/uki/src/uki-view/view/box.js",
|
357
343
|
"frameworks/uki/src/uki-view/view/button.js",
|
@@ -395,14 +381,14 @@ Gem::Specification.new do |s|
|
|
395
381
|
s.homepage = %q{http://github.com/voloko/uki}
|
396
382
|
s.rdoc_options = ["--charset=UTF-8"]
|
397
383
|
s.require_paths = ["lib"]
|
398
|
-
s.rubygems_version = %q{1.3.
|
384
|
+
s.rubygems_version = %q{1.3.7}
|
399
385
|
s.summary = %q{uki development tools}
|
400
386
|
|
401
387
|
if s.respond_to? :specification_version then
|
402
388
|
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
403
389
|
s.specification_version = 3
|
404
390
|
|
405
|
-
if Gem::Version.new(Gem::
|
391
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
406
392
|
s.add_runtime_dependency(%q<sinatra>, [">= 0"])
|
407
393
|
s.add_runtime_dependency(%q<commander>, [">= 4.0.1"])
|
408
394
|
s.add_runtime_dependency(%q<jspec>, [">= 3.3.2"])
|