lsd_rails 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (110) hide show
  1. data/Packages/Sheet.js/Source/SheetParser.Value.js +1 -1
  2. data/Packages/lsd/Source/Action/Clone.js +2 -12
  3. data/Packages/lsd/Source/Action/Delete.js +1 -7
  4. data/Packages/lsd/Source/Action/Display.js +7 -7
  5. data/Packages/lsd/Source/Action/Edit.js +2 -2
  6. data/Packages/lsd/Source/Action/Invoke.js +2 -2
  7. data/Packages/lsd/Source/Action/Submit.js +2 -0
  8. data/Packages/lsd/Source/Action/Toggle.js +4 -0
  9. data/Packages/lsd/Source/Action/Update.js +2 -1
  10. data/Packages/lsd/Source/Action.js +4 -5
  11. data/Packages/lsd/Source/Document.js +10 -7
  12. data/Packages/lsd/Source/LSD.js +22 -127
  13. data/Packages/lsd/Source/Layer.js +4 -4
  14. data/Packages/lsd/Source/Layout.js +1077 -259
  15. data/Packages/lsd/Source/Mixin/Animation.js +1 -1
  16. data/Packages/lsd/Source/Mixin/Choice.js +2 -2
  17. data/Packages/lsd/Source/Mixin/Command.js +26 -8
  18. data/Packages/lsd/Source/Mixin/ContentEditable.js +2 -1
  19. data/Packages/lsd/Source/{Trait → Mixin}/Date.js +21 -11
  20. data/Packages/lsd/Source/{Trait/Menu.js → Mixin/Details.js} +6 -1
  21. data/Packages/lsd/Source/Mixin/Draggable.js +1 -1
  22. data/Packages/lsd/Source/Mixin/Fieldset.js +51 -49
  23. data/Packages/lsd/Source/Mixin/Focusable.js +38 -39
  24. data/Packages/lsd/Source/Mixin/Invokable.js +13 -14
  25. data/Packages/lsd/Source/Mixin/List.js +9 -17
  26. data/Packages/lsd/Source/Mixin/Placeholder.js +2 -7
  27. data/Packages/lsd/Source/Mixin/Request.js +5 -3
  28. data/Packages/lsd/Source/Mixin/Resizable.js +3 -3
  29. data/Packages/lsd/Source/Mixin/Resource.js +1 -1
  30. data/Packages/lsd/Source/Mixin/Root.js +17 -1
  31. data/Packages/lsd/Source/Mixin/Scrollable.js +1 -1
  32. data/Packages/lsd/Source/{Trait → Mixin}/Slider.js +0 -0
  33. data/Packages/lsd/Source/Mixin/Sortable.js +2 -2
  34. data/Packages/lsd/Source/Mixin/Submittable.js +2 -1
  35. data/Packages/lsd/Source/Mixin/Target.js +11 -6
  36. data/Packages/lsd/Source/Mixin/Touchable.js +2 -2
  37. data/Packages/lsd/Source/Mixin/Unselectable.js +1 -1
  38. data/Packages/lsd/Source/Mixin/Uploader.js +11 -13
  39. data/Packages/lsd/Source/Mixin/Validity.js +35 -9
  40. data/Packages/lsd/Source/Mixin/Value.js +5 -3
  41. data/Packages/lsd/Source/Module/Accessories/Attributes.js +90 -89
  42. data/Packages/lsd/Source/Module/Accessories/Chain.js +40 -25
  43. data/Packages/lsd/Source/Module/Accessories/Element.js +59 -58
  44. data/Packages/lsd/Source/Module/Accessories/Events.js +25 -10
  45. data/Packages/lsd/Source/Module/Accessories/Options.js +11 -13
  46. data/Packages/lsd/Source/Module/Accessories/States.js +42 -5
  47. data/Packages/lsd/Source/Module/Accessories/Styles.js +1 -1
  48. data/Packages/lsd/Source/Module/Accessories/Tag.js +21 -7
  49. data/Packages/lsd/Source/Module/Ambient/Allocations.js +178 -64
  50. data/Packages/lsd/Source/Module/Ambient/DOM.js +98 -55
  51. data/Packages/lsd/Source/Module/Ambient/Expectations.js +57 -8
  52. data/Packages/lsd/Source/Module/Ambient/Interpolations.js +147 -0
  53. data/Packages/lsd/Source/Module/Ambient/Layout.js +52 -15
  54. data/Packages/lsd/Source/Module/Ambient/Proxies.js +44 -36
  55. data/Packages/lsd/Source/Module/Ambient/Relations.js +3 -1
  56. data/Packages/lsd/Source/Module/Ambient/Selectors.js +3 -3
  57. data/Packages/lsd/Source/Module/Ambient.js +2 -2
  58. data/Packages/lsd/Source/Module/Graphics/Layers.js +1 -1
  59. data/Packages/lsd/Source/Module/Graphics/Render.js +1 -1
  60. data/Packages/lsd/Source/Relation.js +19 -20
  61. data/Packages/lsd/Source/Sheet.js +4 -5
  62. data/Packages/lsd/Source/{Behavior.js → Tools/Behavior.js} +0 -0
  63. data/Packages/lsd/Source/Tools/Command.js +190 -0
  64. data/Packages/lsd/Source/Tools/Helpers.js +109 -0
  65. data/Packages/lsd/Source/Tools/Interpolation.js +351 -0
  66. data/Packages/lsd/Source/Tools/Microdata.js +75 -0
  67. data/Packages/lsd/Source/Tools/Object.js +192 -0
  68. data/Packages/lsd/Source/Tools/Position.js +208 -0
  69. data/Packages/lsd/Source/Tools/Require.js +76 -0
  70. data/Packages/lsd/Source/Type.js +2 -2
  71. data/Packages/lsd/package.yml +11 -7
  72. data/Packages/lsd-mobile/Source/Body/Dialog.js +2 -2
  73. data/Packages/lsd-mobile/Source/Input/Date.js +9 -84
  74. data/Packages/lsd-native/Source/Input/Checkbox.js +4 -4
  75. data/Packages/lsd-native/Source/Input/Date.js +46 -6
  76. data/Packages/lsd-native/Source/Input/Radio.js +1 -4
  77. data/Packages/lsd-native/Source/Input.js +5 -6
  78. data/Packages/lsd-widgets/Source/Body/Dialog.js +9 -6
  79. data/Packages/lsd-widgets/Source/Body/Page.js +1 -1
  80. data/Packages/lsd-widgets/Source/Body.js +1 -1
  81. data/Packages/lsd-widgets/Source/Button.js +1 -1
  82. data/Packages/lsd-widgets/Source/Form.js +1 -1
  83. data/Packages/lsd-widgets/Source/Input/Checkbox.js +2 -2
  84. data/Packages/lsd-widgets/Source/Input/Date.js +45 -16
  85. data/Packages/lsd-widgets/Source/Input/File.js +2 -2
  86. data/Packages/lsd-widgets/Source/Input/HTML.js +2 -2
  87. data/Packages/lsd-widgets/Source/Input/Radio.js +1 -1
  88. data/Packages/lsd-widgets/Source/Input/Range.js +2 -2
  89. data/Packages/lsd-widgets/Source/Input/Submit.js +1 -1
  90. data/Packages/lsd-widgets/Source/Input.js +2 -11
  91. data/Packages/lsd-widgets/Source/Label.js +4 -8
  92. data/Packages/lsd-widgets/Source/Menu/List.js +3 -3
  93. data/Packages/lsd-widgets/Source/Menu.js +2 -2
  94. data/Packages/lsd-widgets/Source/Progress.js +1 -1
  95. data/Packages/lsd-widgets/Source/Select.js +7 -6
  96. data/Packages/lsd-widgets/Source/Table/Calendar.js +41 -15
  97. data/Packages/lsd-widgets/Source/Table.js +7 -2
  98. data/Packages/mootools-ext/Source/Core/Class.Mixin.js +43 -38
  99. data/Packages/mootools-ext/Source/Core/Class.States.js +26 -22
  100. data/Packages/mootools-ext/Source/Element/Element.from.js +1 -1
  101. data/Packages/mootools-ext/Source/Element/Properties/Item.js +1 -2
  102. data/Packages/mootools-ext/Source/Request/Request.Statuses.js +9 -7
  103. data/Packages/mootools-ext/Source/Types/{FastArray.js → Object.Array.js} +8 -14
  104. data/Packages/mootools-ext/package.yml +1 -2
  105. data/lib/lsd.rake +28 -0
  106. metadata +15 -11
  107. data/Packages/lsd/Source/Command.js +0 -135
  108. data/Packages/lsd/Source/Interpolation.js +0 -103
  109. data/Packages/lsd/Source/Module/Ambient/Container.js +0 -56
  110. data/Packages/mootools-ext/Source/Element/Element.onDispose.js +0 -36
@@ -25,6 +25,7 @@ LSD.Widget.Table.Calendar = new Class({
25
25
  date: null,
26
26
  format: {
27
27
  caption: "%B %Y"
28
+
28
29
  },
29
30
  classes: ['calendar'],
30
31
  events: {
@@ -45,7 +46,7 @@ LSD.Widget.Table.Calendar = new Class({
45
46
  },
46
47
 
47
48
  setRow: function(days) {
48
- var row = this.parent.apply(this, arguments);
49
+ var row = LSD.Widget.Table.prototype.setRow.apply(this, arguments);
49
50
  var number = days[0]
50
51
  if ((number <= this.day) && (number + 7 > this.day)) {
51
52
  row.className = 'selected';
@@ -58,13 +59,9 @@ LSD.Widget.Table.Calendar = new Class({
58
59
  },
59
60
 
60
61
  selectDate: function(e) {
61
- var cell = e.target;
62
- this.day = this.getDayFromCell(cell);
63
- this.setCell(this.selected);
64
- this.setDate(this.current.clone().set('date', this.day));
65
- this.fireEvent('set', this.date);
66
- this.selected = cell;
67
- this.setCell(this.selected);
62
+ var date = this.date ? this.date.clone() : new Date;
63
+ var day = this.getDayFromCell(e.target);
64
+ this.setDate(date.set('date', day));
68
65
  },
69
66
 
70
67
  touchDate: function(e) {
@@ -82,8 +79,17 @@ LSD.Widget.Table.Calendar = new Class({
82
79
  return parseInt(cell.innerHTML);
83
80
  },
84
81
 
82
+ getCellByDay: function(day) {
83
+ var index = day + this.firstDay.get('day') - 1;
84
+ var row = this.rows[Math.floor(index / 7)];
85
+ var weekday = index % 7;
86
+ for (var i = 0, j = 0, node, nodes = row.childNodes; node = nodes[i++];)
87
+ if (LSD.toLowerCase(node.tagName) == 'td')
88
+ if (j++ == weekday) return node;
89
+ },
90
+
85
91
  setCell: function(number) {
86
- var cell = this.parent.apply(this, arguments);
92
+ var cell = LSD.Widget.Table.prototype.setCell.apply(this, arguments);
87
93
  if (cell == number) number = this.getDayFromCell(cell);
88
94
  if (number == ' ') {
89
95
  cell.className = 'empty';
@@ -98,12 +104,32 @@ LSD.Widget.Table.Calendar = new Class({
98
104
  return cell;
99
105
  },
100
106
 
107
+ setDay: function(date) {
108
+ var day = date.getDate();
109
+ this.firstDay = date.clone().set('date', 1);
110
+ var monthSet = !this.month || this.firstDay.compare(this.month);
111
+ if (monthSet) this.setMonth(this.firstDay);
112
+ if (monthSet || day != this.day) {
113
+ this.day = day;
114
+ var cell = this.getCellByDay(this.day);
115
+ if (this.selected) this.setCell(this.selected);
116
+ this.selected = cell;
117
+ this.setCell(this.selected);
118
+ this.fireEvent('setDay', [day, cell]);
119
+ }
120
+ },
121
+
101
122
  setDate: function(date) {
102
- this.date = date = (date ? date.clone() : new Date);
103
- var beginning = date.clone().set('date', 1);
104
- if (this.currrent && !beginning.compare(this.currrent)) return; false;
105
- this.current = beginning;
106
- this.day = this.date.getDate();
123
+ if (!date) date = new Date;
124
+ if (this.date && !this.date.compare(date)) return false;
125
+ this.date = date;
126
+ this.fireEvent('set', date);
127
+ this.setDay(date);
128
+ },
129
+
130
+ setMonth: function(date) {
131
+ delete this.selected;
132
+ this.month = date;
107
133
  var table = {
108
134
  caption: date.format(this.options.format.caption),
109
135
  data: [[]],
@@ -111,7 +137,7 @@ LSD.Widget.Table.Calendar = new Class({
111
137
  };
112
138
  var data = table.data;
113
139
  if (this.options.footer !== false) table.footer = table.header;
114
- var day = beginning.get('day');
140
+ var day = date.get('day');
115
141
  var last = date.getLastDayOfMonth();
116
142
  for (var i = 0; i < day; i++) data[0].push(' ');
117
143
  for (var i = 1; i <= last; i++) {
@@ -37,7 +37,7 @@ LSD.Widget.Table = new Class({
37
37
  }
38
38
  },
39
39
  tag: 'table',
40
- pseudos: Array.fast('list')
40
+ pseudos: Array.object('list')
41
41
  },
42
42
 
43
43
  setTable: function(table) {
@@ -51,7 +51,12 @@ LSD.Widget.Table = new Class({
51
51
  setData: function(data) {
52
52
  if (!this.body) this.body = new Element('tbody').inject(this.element);
53
53
  else this.body.empty()
54
- for (var i = 0, row; row = data[i++];) this.body.appendChild(this.setRow(row));
54
+ this.rows = [];
55
+ for (var i = 0, row; row = data[i++];) {
56
+ row = this.setRow(row)
57
+ this.rows.push(row);
58
+ this.body.appendChild(row);
59
+ }
55
60
  },
56
61
 
57
62
  setRow: function(values) {
@@ -20,64 +20,69 @@ provides:
20
20
 
21
21
  Class.mixin = function(instance, klass, light) {
22
22
  var proto = klass.prototype;
23
- for (var name in proto) !function(value) {
24
- if (typeof value !== 'function') return;
23
+ mixing: for (var name in proto) {
25
24
  switch (name) {
26
- case "parent": case "initialize": case "uninitialize": case "$constructor":
27
- return;
28
- }
29
- value = value.$origin;
30
- var origin = instance[name], parent, wrap;
31
- if (origin) {
32
- if (light) return;
33
- if (origin.$mixes) return origin.$mixes.push(value);
34
- parent = origin.$owner;
35
- wrap = origin;
36
- origin = origin.$origin;
37
- };
38
- var wrapper = instance[name] = function() {
39
- var stack = wrapper.$stack;
40
- if (!stack) stack = wrapper.$stack = Array.prototype.slice.call(wrapper.$mixes, 0);
41
- var mix = stack.pop();
42
- wrapper.$owner = {parent: mix ? instance.$constructor : parent}
43
- if (!mix && !(mix = origin)) return;
44
- var caller = this.caller, current = this.$caller;
45
- this.caller = current; this.$caller = wrapper;
46
- var result = (mix || origin).apply(this, arguments);
47
- this.$caller = current; this.caller = caller;
48
- delete wrapper.$stack;
49
- return result;
25
+ case "parent": case "initialize": case "onMix": case "onUnmix": case "$constructor":
26
+ continue mixing;
50
27
  }
51
- wrapper.$mixes = [value];
52
- wrapper.$origin = origin;
53
- wrapper.$name = name;
54
- }(proto[name]);
55
- if (proto.initialize) {
56
- var parent = instance.parent; instance.parent = function(){};
57
- proto.initialize.call(instance, instance);
58
- instance.parent = parent;
28
+ !function(value) {
29
+ if (typeof value !== 'function') return;
30
+ value = value.$origin;
31
+ var origin = instance[name], parent, wrap;
32
+ if (origin) {
33
+ if (light) return;
34
+ if (origin.$mixes) return origin.$mixes.push(value);
35
+ parent = origin.$owner;
36
+ wrap = origin;
37
+ origin = origin.$origin;
38
+ };
39
+ var wrapper = instance[name] = function() {
40
+ var stack = wrapper.$stack;
41
+ if (!stack) stack = wrapper.$stack = Array.prototype.slice.call(wrapper.$mixes, 0);
42
+ var mix = stack.pop();
43
+ wrapper.$owner = {parent: mix ? instance.$constructor : parent}
44
+ if (!mix && !(mix = origin)) return;
45
+ var caller = this.caller, current = this.$caller;
46
+ this.caller = current; this.$caller = wrapper;
47
+ var result = (mix || origin).apply(this, arguments);
48
+ this.$caller = current; this.caller = caller;
49
+ delete wrapper.$stack;
50
+ return result;
51
+ }
52
+ wrapper.$mixes = [value];
53
+ wrapper.$origin = origin;
54
+ wrapper.$name = name;
55
+ }(proto[name]);
59
56
  }
57
+ if (proto.onMix) return proto.onMix.call(instance);
60
58
  };
61
59
 
62
60
  Class.unmix = function(instance, klass, light) {
63
61
  var proto = klass.prototype;
64
- for (var name in proto) !function(value) {
62
+ unmixing: for (var name in proto) {
63
+ switch (name) {
64
+ case "parent": case "initialize": case "onMix": case "onUnmix": case "$constructor":
65
+ continue unmixing;
66
+ }
67
+ var value = proto[name];
65
68
  if (typeof value !== 'function') return;
66
69
  var remixed = instance[name]
67
70
  if (remixed && remixed.$mixes) {
68
- if (light) return;
69
- remixed.$mixes.erase(value.$origin);
71
+ var index = remixed.$mixes.indexOf(value.$origin);
72
+ if (index == -1) return;
73
+ remixed.$mixes.splice(index, 1);
70
74
  if (!remixed.$mixes.length) {
71
75
  if (remixed.$origin) instance[name] = remixed.$origin;
72
76
  else delete instance[name];
73
77
  }
74
78
  }
75
- }(proto[name]);
79
+ }
76
80
  if (proto.uninitialize) {
77
81
  var parent = instance.parent; instance.parent = function(){};
78
82
  proto.uninitialize.call(instance, instance);
79
83
  instance.parent = parent;
80
84
  }
85
+ if (proto.onUnmix) return proto.onUnmix.call(instance);
81
86
  };
82
87
 
83
88
  Class.implement('mixin', function(klass) {
@@ -42,41 +42,44 @@ var States = new Class({
42
42
  if (!this.$states) this.$states = {};
43
43
  if (this.$states[name]) return;
44
44
  this.$states[name] = state;
45
- var enabler = this[state.enabler], disabler = this[state.disabler], toggler = this[state.toggler];
45
+ var prop = state && state.property || name;
46
+ var enabler = this[state.enabler], disabler = this[state.disabler]
46
47
  this[state.enabler] = function() {
47
- return this.setStateTo(name, true, state, arguments, enabler)
48
+ return this.setStateTo(name, true, arguments, enabler, state)
48
49
  }
50
+ if (enabler) this[state.enabler].$overloaded = enabler;
49
51
  this[state.disabler] = function() {
50
- return this.setStateTo(name, false, state, arguments, disabler)
52
+ return this.setStateTo(name, false, arguments, disabler, state)
51
53
  }
52
- this[state.toggler] = function() {
53
- return this.setStateTo(name, !this[state && state.property || name], state, arguments, toggler)
54
+ if (disabler) this[state.disabler].$overloaded = disabler;
55
+ if (state.toggler) {
56
+ this[state.toggler] = function() {
57
+ return this.setStateTo(name, !this[prop], arguments, this[prop] ? disabler : enabler, state)
58
+ }
54
59
  }
55
- if (state.initial || this[state && state.property || name]) this[state.enabler]();
60
+ if (state.initial || this[prop]) this[state.enabler]();
61
+ if (this.fireEvent) this.fireEvent('stateAdded', [name, state, prop])
56
62
  },
57
63
 
58
64
  removeState: function(name, state) {
59
- if (!state) state = States.get(name);
65
+ if (!state || state === true) state = States.get(name);
66
+ var method = this[state.enabler];
67
+ if (method.$overloaded) this[state.enabler] = method.$overloaded
68
+ else delete this[state.enabler];
69
+ method = this[state.disabler];
70
+ if (method.$overloaded) this[state.disabler] = method.$overloaded
71
+ else delete this[state.disabler];
72
+ var prop = state && state.property || name;
73
+ if (this.fireEvent) this.fireEvent('stateRemoved', [name, state, prop])
74
+ if (this[prop]) delete this[prop];
60
75
  delete this.$states[name];
61
76
  },
62
77
 
63
- linkState: function(object, from, to, state) {
64
- var first = this.$states[from] || States.get(from);
65
- var second = object.$states[to] || States.get(to);
66
- var events = (first.events || first), method = (state === false ? 'removeEvent' : 'addEvent');
67
- var enabler = second.enabler, disabler = second.disabler;
68
- if (enabler.indexOf) enabler = (object.bindEvent ? object.bindEvent(enabler) : object[enabler].bind(object));
69
- if (disabler.indexOf) disabler = (object.bindEvent ? object.bindEvent(disabler) : object[disabler].bind(object));
70
- this[method](events.enabler, enabler);
71
- this[method](events.disabler, disabler);
72
- if (object[second.enabler] && this[first.property || from]) object[second.enabler]();
73
- },
74
-
75
78
  unlinkState: function(object, from, to) {
76
79
  return this.linkState(object, from, to, false)
77
80
  },
78
81
 
79
- setStateTo: function(name, value, state, args, callback) {
82
+ setStateTo: function(name, value, args, callback, state) {
80
83
  if (!state || state === true) state = States.get(name);
81
84
  if (this[state && state.property || name] == value) return false;
82
85
  this[state && state.property || name] = !!value;
@@ -85,11 +88,12 @@ var States = new Class({
85
88
  if (result === false) return false;
86
89
  }
87
90
  this.fireEvent((state.events || state)[value ? 'enabler' : 'disabler'], result || args);
88
- if (this.onStateChange && (state.reflect !== false)) this.onStateChange(name, value, result || args);
91
+ if (this.onStateChange && (state.reflect !== false))
92
+ this.onStateChange(name, value, result || args, callback);
89
93
  return true;
90
94
  }
91
95
  });
92
96
 
93
97
  States.get = function() {
94
- return;
98
+ return this.$states[name];
95
99
  };
@@ -30,7 +30,7 @@ document.createFragment = window.innerShiv = (function() {
30
30
 
31
31
  var e = d.cloneNode(true);
32
32
  /*@cc_on document.body.appendChild(e);@*/
33
- e.innerHTML = h.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
33
+ e.innerHTML = h;
34
34
  /*@cc_on document.body.removeChild(e);@*/
35
35
 
36
36
  if (u === false) return e.childNodes;
@@ -10,11 +10,10 @@ license: MIT-style license.
10
10
  requires:
11
11
  - Core/Element
12
12
 
13
- provides: [Element.prototype.getItems, Element.Properties.item, Element.Microdata]
13
+ provides: [Element.prototype.getItems, Element.Properties.item, Element.Microdata, Element.Item]
14
14
 
15
15
  ...
16
16
  */
17
- if (!Element.Item) Element.Item = {};
18
17
  Element.Item = {
19
18
  walk: function(element, callback, memo, prefix) {
20
19
  var prop = element.getAttribute('itemprop');
@@ -30,7 +30,7 @@ provides:
30
30
  is "non successful" (anything but 2xx).
31
31
 
32
32
  */
33
- (function(isSuccess, onSuccess) {
33
+ (function(onSuccess) {
34
34
 
35
35
  var Statuses = Request.Statuses = {
36
36
  200: 'Ok',
@@ -75,16 +75,18 @@ var Statuses = Request.Statuses = {
75
75
  510: "NotExtended"
76
76
  };
77
77
 
78
- Object.append(Request.prototype, {
79
- isSuccess: function() {
80
- return true;
78
+ Object.merge(Request.prototype, {
79
+ options: {
80
+ isSuccess: function() {
81
+ return true;
82
+ }
81
83
  },
82
84
 
83
85
  onSuccess: function() {
86
+ if (this.isSuccess()) this.fireEvent('complete', arguments).fireEvent('success', arguments).callChain.apply(this, arguments);
87
+ else this.onFailure.apply(this, arguments);
84
88
  var status = Request.Statuses[this.status];
85
89
  if (status) this.fireEvent('on' + status, arguments)
86
- if (isSuccess.call(this)) this.fireEvent('complete', arguments).fireEvent('success', arguments).callChain.apply(this, arguments);
87
- else this.onFailure.apply(this, arguments);
88
90
  },
89
91
 
90
92
  onFailure: function(){
@@ -92,4 +94,4 @@ Object.append(Request.prototype, {
92
94
  }
93
95
  });
94
96
 
95
- })(Request.prototype.isSuccess, Request.prototype.onSuccess);
97
+ })(Request.prototype.onSuccess);
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  ---
3
3
 
4
- script: FastArray.js
4
+ script: Object.Array.js
5
5
 
6
6
  description: Array with fast lookup (based on object)
7
7
 
@@ -10,30 +10,24 @@ license: MIT-style license.
10
10
  requires:
11
11
  - Core/Class
12
12
 
13
- provides: [FastArray]
13
+ provides: [Object.Array]
14
14
 
15
15
  ...
16
16
  */
17
17
 
18
- window.FastArray = function() {
18
+ Object.Array = function() {
19
19
  this.push.apply(this, arguments);
20
20
  }
21
21
 
22
- FastArray.from = function(ary) {
23
- var array = new FastArray;
24
- FastArray.prototype.push.apply(array, ary)
25
- return array;
26
- }
27
- Array.fast = function() {
22
+ Array.fast = Array.object = function() {
28
23
  var object = {};
29
24
  for (var i = 0, arg; arg = arguments[i++];) object[arg] = true;
30
25
  return object;
31
26
  };
32
- FastArray.prototype = {
27
+ Object.Array.prototype = {
33
28
  push: function() {
34
- Array.each(arguments, function(argument) {
35
- this[argument] = true;
36
- }, this);
29
+ for (var i = 0, j = arguments.length; i < j; i++)
30
+ this[arguments[i]] = true;
37
31
  },
38
32
 
39
33
  contains: function(argument) {
@@ -52,7 +46,7 @@ FastArray.prototype = {
52
46
  }
53
47
  },
54
48
 
55
- include: function(value) {
49
+ include: function(value, value) {
56
50
  this[value] = true;
57
51
  },
58
52
 
@@ -16,7 +16,7 @@ sources:
16
16
  - "Source/Types/Event.js"
17
17
  - "Source/Types/String.js"
18
18
  - "Source/Types/Object.js"
19
- - "Source/Types/FastArray.js"
19
+ - "Source/Types/Object.Array.js"
20
20
  - "Source/Element/Element.js"
21
21
  - "Source/Element/Events/Keypress.js"
22
22
  - "Source/Element/Events/Input.js"
@@ -24,7 +24,6 @@ sources:
24
24
  - "Source/Element/Properties/Widget.js"
25
25
  - "Source/Element/Element.Selection.js"
26
26
  - "Source/Element/Element.from.js"
27
- - "Source/Element/Element.onDispose.js"
28
27
  - "Source/Element/Properties/Item.js"
29
28
  - "Source/Element/Properties/Data.js"
30
29
  - "Source/Element/Properties/Widget.js"
data/lib/lsd.rake CHANGED
@@ -18,4 +18,32 @@ namespace :lsd do
18
18
  puts "Include js in you views"
19
19
  puts %{<%= jsus_include "#{LSD.detect_project_name}:*", :development => 'include', :production => 'compressed' %>}
20
20
  end
21
+
22
+ desc "Tests all files on compressor exceptions COMPRESSOR= yui | uglifier"
23
+ task :test_compression => :environment do
24
+ compressor = (ENV['COMPRESSOR'] || Jsus::Middleware.settings[:compression]).to_sym
25
+ script = (ENV['SCRIPT'] || "#{LSD.detect_project_name}:*") + '.js'
26
+
27
+ puts
28
+ puts "Testing compression for #{script} with #{compressor}"
29
+ puts
30
+
31
+ m = Jsus::Middleware.new(nil)
32
+ files = m.send(:path_string_to_files, script)
33
+ paths = Jsus::Container.new(*files).required_files(Jsus::Middleware.settings[:includes_root])
34
+
35
+ paths = paths.last(1) if !!ENV['SINGLE_FILE']
36
+
37
+ paths.each do |file|
38
+ print file
39
+ source = File.open(File.join(Jsus::Middleware.settings[:includes_root], file), 'r:utf-8', &:read)
40
+ begin
41
+ Jsus::Util::Compressor.new(source, :method => compressor).result
42
+ rescue => e
43
+ puts " FALED"
44
+ raise e
45
+ end
46
+ puts " OK"
47
+ end
48
+ end
21
49
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: lsd_rails
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.2
5
+ version: 0.1.3
6
6
  platform: ruby
7
7
  authors:
8
8
  - Pavel Evstigneev
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-07-15 00:00:00 Z
13
+ date: 2011-08-16 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -101,10 +101,7 @@ files:
101
101
  - Packages/lsd/Source/ART/ART.Shape.Rectangle.js
102
102
  - Packages/lsd/Source/ART/ART.Shape.Star.js
103
103
  - Packages/lsd/Source/ART/ART.SVG.js
104
- - Packages/lsd/Source/Behavior.js
105
- - Packages/lsd/Source/Command.js
106
104
  - Packages/lsd/Source/Document.js
107
- - Packages/lsd/Source/Interpolation.js
108
105
  - Packages/lsd/Source/Layer/Color.js
109
106
  - Packages/lsd/Source/Layer/Offset.js
110
107
  - Packages/lsd/Source/Layer/Position.js
@@ -125,6 +122,8 @@ files:
125
122
  - Packages/lsd/Source/Mixin/Choice.js
126
123
  - Packages/lsd/Source/Mixin/Command.js
127
124
  - Packages/lsd/Source/Mixin/ContentEditable.js
125
+ - Packages/lsd/Source/Mixin/Date.js
126
+ - Packages/lsd/Source/Mixin/Details.js
128
127
  - Packages/lsd/Source/Mixin/Draggable.js
129
128
  - Packages/lsd/Source/Mixin/Fieldset.js
130
129
  - Packages/lsd/Source/Mixin/Focusable.js
@@ -136,6 +135,7 @@ files:
136
135
  - Packages/lsd/Source/Mixin/Resource.js
137
136
  - Packages/lsd/Source/Mixin/Root.js
138
137
  - Packages/lsd/Source/Mixin/Scrollable.js
138
+ - Packages/lsd/Source/Mixin/Slider.js
139
139
  - Packages/lsd/Source/Mixin/Sortable.js
140
140
  - Packages/lsd/Source/Mixin/Submittable.js
141
141
  - Packages/lsd/Source/Mixin/Target.js
@@ -157,9 +157,9 @@ files:
157
157
  - Packages/lsd/Source/Module/Accessories/Tag.js
158
158
  - Packages/lsd/Source/Module/Accessories.js
159
159
  - Packages/lsd/Source/Module/Ambient/Allocations.js
160
- - Packages/lsd/Source/Module/Ambient/Container.js
161
160
  - Packages/lsd/Source/Module/Ambient/DOM.js
162
161
  - Packages/lsd/Source/Module/Ambient/Expectations.js
162
+ - Packages/lsd/Source/Module/Ambient/Interpolations.js
163
163
  - Packages/lsd/Source/Module/Ambient/Layout.js
164
164
  - Packages/lsd/Source/Module/Ambient/Mutations.js
165
165
  - Packages/lsd/Source/Module/Ambient/Proxies.js
@@ -172,10 +172,15 @@ files:
172
172
  - Packages/lsd/Source/Module/Graphics.js
173
173
  - Packages/lsd/Source/Relation.js
174
174
  - Packages/lsd/Source/Sheet.js
175
- - Packages/lsd/Source/Trait/Date.js
175
+ - Packages/lsd/Source/Tools/Behavior.js
176
+ - Packages/lsd/Source/Tools/Command.js
177
+ - Packages/lsd/Source/Tools/Helpers.js
178
+ - Packages/lsd/Source/Tools/Interpolation.js
179
+ - Packages/lsd/Source/Tools/Microdata.js
180
+ - Packages/lsd/Source/Tools/Object.js
181
+ - Packages/lsd/Source/Tools/Position.js
182
+ - Packages/lsd/Source/Tools/Require.js
176
183
  - Packages/lsd/Source/Trait/Input.js
177
- - Packages/lsd/Source/Trait/Menu.js
178
- - Packages/lsd/Source/Trait/Slider.js
179
184
  - Packages/lsd/Source/Type.js
180
185
  - Packages/lsd/Source/Widget.js
181
186
  - Packages/lsd/UNLICENSE
@@ -344,7 +349,6 @@ files:
344
349
  - Packages/mootools-ext/Source/Drag/Sortables.Delegation.js
345
350
  - Packages/mootools-ext/Source/Element/Element.from.js
346
351
  - Packages/mootools-ext/Source/Element/Element.js
347
- - Packages/mootools-ext/Source/Element/Element.onDispose.js
348
352
  - Packages/mootools-ext/Source/Element/Element.Selection.js
349
353
  - Packages/mootools-ext/Source/Element/Events/Input.js
350
354
  - Packages/mootools-ext/Source/Element/Events/Keypress.js
@@ -359,7 +363,7 @@ files:
359
363
  - Packages/mootools-ext/Source/Request/Request.Headers.js
360
364
  - Packages/mootools-ext/Source/Request/Request.Statuses.js
361
365
  - Packages/mootools-ext/Source/Types/Event.js
362
- - Packages/mootools-ext/Source/Types/FastArray.js
366
+ - Packages/mootools-ext/Source/Types/Object.Array.js
363
367
  - Packages/mootools-ext/Source/Types/Object.js
364
368
  - Packages/mootools-ext/Source/Types/String.js
365
369
  - Packages/mootools-history/Demos/demo.css