rsence-pre 3.0.0.9 → 3.0.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/client/ext/Rakefile +18 -0
  4. data/client/js/controls/button/themes/default/button.html +1 -1
  5. data/client/js/controls/checkbox/checkbox.js +9 -4
  6. data/client/js/controls/checkbox/themes/default/checkbox.css +19 -29
  7. data/client/js/controls/checkbox/themes/default/checkbox.html +8 -6
  8. data/client/js/controls/dialogs/sheet/themes/default/sheet.css +25 -30
  9. data/client/js/controls/dialogs/sheet/themes/default/sheet.html +10 -10
  10. data/client/js/controls/numerictextcontrol/numerictextcontrol.coffee +7 -14
  11. data/client/js/controls/passwordcontrol/passwordcontrol.js +1 -5
  12. data/client/js/controls/radiobutton/themes/default/radiobutton.css +21 -31
  13. data/client/js/controls/radiobutton/themes/default/radiobutton.html +8 -6
  14. data/client/js/controls/searchfield/themes/default/searchfield.css +1 -1
  15. data/client/js/controls/sliders/slider/themes/default/slider.css +3 -3
  16. data/client/js/controls/sliders/vslider/themes/default/vslider.css +3 -3
  17. data/client/js/controls/stepper/themes/default/stepper.css +1 -1
  18. data/client/js/controls/stringview/stringview.js +9 -16
  19. data/client/js/controls/stringview/themes/default/stringview.css +10 -2
  20. data/client/js/controls/tab/themes/default/tab.css +3 -3
  21. data/client/js/controls/textarea/textarea.js +1 -3
  22. data/client/js/controls/textcontrol/textcontrol.coffee +173 -36
  23. data/client/js/controls/textcontrol/themes/default/textcontrol.css +64 -100
  24. data/client/js/controls/textcontrol/themes/default/textcontrol.html +14 -19
  25. data/client/js/controls/uploader/themes/default/uploader.css +1 -1
  26. data/client/js/controls/window/themes/default/window.css +8 -8
  27. data/client/js/core/elem/elem.coffee +6 -4
  28. data/client/js/core/event/event.js +6 -0
  29. data/client/js/datetime/datepicker/datepicker.coffee +7 -3
  30. data/client/js/foundation/eventmanager/eventmanager.coffee +9 -4
  31. data/client/js/foundation/thememanager/thememanager.coffee +8 -1
  32. data/client/js/foundation/view/view.js +19 -4
  33. data/client/js/menus/combobox/combobox.coffee +2 -2
  34. data/client/js/menus/menuitem/themes/default/menuitem.css +15 -27
  35. data/client/js/menus/menuitem/themes/default/menuitem.html +2 -4
  36. data/client/js/menus/minimenu/minimenu.js +11 -3
  37. data/client/js/menus/minimenu/themes/default/minimenu.css +23 -18
  38. data/client/js/menus/minimenu/themes/default/minimenu.html +6 -8
  39. data/client/js/menus/minimenuitem/minimenuitem.js +1 -1
  40. data/client/js/menus/minimenuitem/themes/default/minimenuitem.css +15 -27
  41. data/client/js/menus/minimenuitem/themes/default/minimenuitem.html +2 -4
  42. data/client/js/menus/popupmenu/themes/default/popupmenu.css +27 -19
  43. data/client/js/menus/popupmenu/themes/default/popupmenu.html +6 -8
  44. data/plugins/client_pkg/lib/client_pkg_build.rb +33 -4
  45. metadata +3 -7
  46. data/client/js/controls/passwordcontrol/themes/default/passwordcontrol.css +0 -0
  47. data/client/js/controls/passwordcontrol/themes/default/passwordcontrol.html +0 -18
  48. data/client/js/controls/stringview/themes/default/stringview.html +0 -1
  49. data/client/js/controls/textarea/themes/default/textarea.css +0 -36
  50. data/client/js/controls/textarea/themes/default/textarea.html +0 -20
@@ -89,6 +89,9 @@ Event = {
89
89
  **/
90
90
  observe: function(_elem, _name, _function, _useCapture) {
91
91
  _useCapture = _useCapture || false;
92
+ if( typeof _elem === 'number' ){
93
+ _elem = ELEM.get(_elem);
94
+ }
92
95
  Event._observeAndCache(_elem, _name, _function, _useCapture);
93
96
  return _function;
94
97
  },
@@ -97,6 +100,9 @@ Event = {
97
100
  * removes the callback function.
98
101
  **/
99
102
  stopObserving: function(_elem, _name, _function, _useCapture) {
103
+ if( typeof _elem === 'number' ){
104
+ _elem = ELEM.get(_elem);
105
+ }
100
106
  if (_elem === undefined) {
101
107
  console.log('Warning Event.stopObserving of event name: "' + _name + '" called with an undefined elem!');
102
108
  return;
@@ -50,15 +50,19 @@ HDatePicker = HTextControl.extend
50
50
  _date.seconds( _seconds )
51
51
  fieldToValue: (_value)->
52
52
  _date = @moment(_value,@options.fieldFormat)
53
- return @value unless _date.isValid()
53
+ if _date.isValid()
54
+ @setValid(true)
55
+ else
56
+ @setValid(false)
57
+ return @value
54
58
  @_dateRestore(_date)
55
59
  _date.unix()
56
60
  refreshValue: ->
57
61
  @base()
58
62
  @calendar.setValue(@value) if @calendar?
59
- @setStyleOfPart('value','textAlign','right')
60
63
  drawSubviews: ->
61
- @base()
64
+ @setStyleOfPart('value','textAlign','right')
65
+ # @base()
62
66
  if @options.calendarPicker
63
67
  @setStyleOfPart('label','right','26px')
64
68
  @calendar = HCalendarPulldown.extend(
@@ -775,6 +775,7 @@ EventManagerApp = HApplication.extend
775
775
  #
776
776
  # Sets the active control
777
777
  changeActiveControl: (_ctrl)->
778
+ return if _ctrl != null and @_views[@_listeners.active[0]] == _ctrl
778
779
  _prevActive = @delActiveControl(_ctrl)
779
780
  @addActiveControl(_ctrl, _prevActive) if _ctrl != null
780
781
  #
@@ -1123,13 +1124,17 @@ EventManagerApp = HApplication.extend
1123
1124
  # that responds true to _methodName. If _ctrl is undefined, use
1124
1125
  # a special default rule of auto-selecting the active control and
1125
1126
  # checking all of its siblings before traversing.
1126
- defaultKey: (_methodName,_ctrl)->
1127
+ defaultKey: (_methodName,_ctrl,_testedIds)->
1127
1128
  return true if _ctrl? and _ctrl[_methodName]? and _ctrl[_methodName]() == true
1128
1129
  return null unless @_listeners.active
1129
- _ctrl = @_views[@_listeners.active[0]]
1130
+ _ctrl = @_views[@_listeners.active[0]] unless _ctrl?
1131
+ _ctrlId = _ctrl.viewId
1132
+ return null if ~_testedIds.indexOf(_ctrlId)
1130
1133
  return true if _ctrl[_methodName]? and _ctrl[_methodName]() == true
1131
1134
  _stop = null
1135
+ _testedIds.push(_ctrlId)
1132
1136
  for _viewId in _ctrl.parent.views
1137
+ continue if ~_testedIds.indexOf(_viewId)
1133
1138
  continue if _ctrl.viewId == _viewId
1134
1139
  _ctrl = @_views[_viewId]
1135
1140
  if _ctrl[_methodName]?
@@ -1137,7 +1142,7 @@ EventManagerApp = HApplication.extend
1137
1142
  if _stopStatus == false or _stopStatus == true
1138
1143
  _stop = _stopStatus unless _stop
1139
1144
  return _stop if _stop != null
1140
- return true if _ctrl.parent? and @defaultKey(_methodName,_ctrl.parent) == true
1145
+ return true if _ctrl.parent? and @defaultKey(_methodName,_ctrl.parent,_testedIds) == true
1141
1146
  null
1142
1147
  #
1143
1148
  # Handles the keyDown event
@@ -1168,7 +1173,7 @@ EventManagerApp = HApplication.extend
1168
1173
  # to instances of HControl, but any parent object will work.
1169
1174
  if not _repeating and @_defaultKeyActions[_keyCode.toString()]
1170
1175
  _defaultKeyMethod = @_defaultKeyActions[_keyCode.toString()]
1171
- _stop = true if @defaultKey(_defaultKeyMethod)
1176
+ _stop = true if @defaultKey(_defaultKeyMethod,null,[])
1172
1177
  @_lastKeyDown = _keyCode
1173
1178
  Event.stop(e) if _stop
1174
1179
  keyUp: (e)->
@@ -141,11 +141,18 @@ HThemeManager = HClass.extend
141
141
  return ''
142
142
  return '' unless @themeCSSTemplates[_themeName][_componentName]?
143
143
  [_tmplJS, _tmplCSS] = @themeCSSTemplates[_themeName][_componentName]
144
- return _tmplCSS if _tmplJS.length == 0
145
144
  [_variableMatch, _assignmentMatch] = [@_variableMatch, @_assignmentMatch]
146
145
  @getThemeGfxFile = (_fileName)-> @_buildThemePath(_fileName,_themeName)
147
146
  @getCssFilePath = (_fileName)->
148
147
  "url(#{@_buildThemePath(_fileName,_themeName)})"
148
+ _cssThemeUrlMatch = /#url\((.+?)\)/gm
149
+ # while _cssThemeUrlMatch.test(_tmplCSS)
150
+ if _cssThemeUrlMatch.test(_tmplCSS)
151
+ _tmplCSS = _tmplCSS.replace(
152
+ _cssThemeUrlMatch, (_match,_fileName)=>
153
+ "url(#{@_buildThemePath(_fileName,_themeName)})"
154
+ )
155
+ return _tmplCSS if _tmplJS.length == 0
149
156
  _callValue = (_id,_isAssign)->
150
157
  _oid = _id
151
158
  _id = parseInt(_id,36)-10
@@ -601,16 +601,23 @@ HView = UtilMethods.extend({
601
601
  if(this.isAbsolute){ ELEM.setStyle(this.elemId,'position','absolute'); }
602
602
  else { ELEM.setStyle(this.elemId,'position','relative'); }
603
603
 
604
- // Theme name == CSS class name
604
+ // Theme name => CSS class name
605
605
  if(this.preserveTheme){
606
606
  ELEM.addClassName( this.elemId, this.theme );
607
607
  }
608
608
  else {
609
609
  ELEM.addClassName( this.elemId, HThemeManager.currentTheme );
610
610
  }
611
+ // componentName => CSS class name
611
612
  if( this.componentName !== undefined ){
612
613
  ELEM.addClassName( this.elemId, this.componentName );
613
614
  }
615
+ // BROWSER_TYPE.* = true => CSS class names
616
+ for( var _browserName in BROWSER_TYPE ){
617
+ if( BROWSER_TYPE[_browserName] === true ){
618
+ ELEM.addClassName( this.elemId, _browserName );
619
+ }
620
+ }
614
621
  if( this.options.textSelectable !== undefined ){
615
622
  this.textSelectable = this.options.textSelectable;
616
623
  }
@@ -674,10 +681,10 @@ HView = UtilMethods.extend({
674
681
  _this._updateZIndex();
675
682
  }
676
683
 
677
- _this.drawn = true;
678
684
  if( _this.themeStyle !== undefined ){
679
685
  _this.themeStyle.call(_this);
680
686
  }
687
+ _this.drawn = true;
681
688
  }
682
689
  return this;
683
690
  },
@@ -1964,22 +1971,30 @@ HView = UtilMethods.extend({
1964
1971
  * The width in pixels required to draw a string in the font.
1965
1972
  *
1966
1973
  **/
1974
+ _stringSizeImportantAttrs: ['fontSize','fontWeight','fontFamily','lineHeight'],
1967
1975
  stringSize: function(_string, _length, _elemId, _wrap, _customStyle) {
1968
1976
  if(!_customStyle){_customStyle = {};}
1969
1977
  if(this.typeChr(_customStyle) === 's'){
1970
- console.warn("#stringSize: use styles instead of css text!");
1978
+ console.warn("#stringSize: use style objects instead of css text!");
1971
1979
  _customStyle = {};
1972
1980
  }
1973
1981
  if (_length || _length === 0) {
1974
1982
  _string = _string.substring(0, _length);
1975
1983
  }
1976
1984
  if (!_elemId && _elemId !== 0) {
1977
- _elemId = 0;
1985
+ _elemId = this.elemId || 0;
1978
1986
  }
1979
1987
  _customStyle.visibility = 'hidden';
1980
1988
  if (!_wrap){
1981
1989
  _customStyle.whiteSpace = 'nowrap';
1982
1990
  }
1991
+ var i=0,_attr;
1992
+ for(;i<this._stringSizeImportantAttrs.length;i++){
1993
+ _attr = this._stringSizeImportantAttrs[i];
1994
+ if (!_customStyle[_attr]){
1995
+ _customStyle[_attr] = ELEM.getStyle(_elemId,_attr);
1996
+ }
1997
+ }
1983
1998
  var
1984
1999
  _stringParent = ELEM.make(_elemId,'div'),
1985
2000
  _stringElem = ELEM.make(_stringParent,'span');
@@ -51,5 +51,5 @@ HComboBoxInterface =
51
51
  @unitSuffix.drawRect()
52
52
  @setStyleOfPart('label','right',this._extraLabelRight+'px')
53
53
  @menu.bringToFront()
54
- HComboBox = HTextControl.extend(HComboBoxInterface)
55
- HNumericComboBox = HNumericTextControl.extend(HComboBoxInterface)
54
+ HComboBox = HTextControl.extend(HComboBoxInterface).extend({_comboNumber:false})
55
+ HNumericComboBox = HNumericTextControl.extend(HComboBoxInterface).extend({_comboNumber:true})
@@ -1,31 +1,24 @@
1
+ .default.menuitem { cursor: pointer; }
1
2
 
2
- .menuitem_control,
3
- .menuitem_label,
4
- .menuitem_state {
5
- position: absolute;
6
- top: 0px; height: 24px;
7
- }
3
+ .default.menuitem:hover { background-color: #fff; }
8
4
 
9
- .menuitem_control {
10
- left: 0px; right: 0px;
11
- cursor: pointer;
12
- }
13
- .menuitem_control:hover {
14
- background-color: #fff;
15
- }
5
+ .default.menuitem.disabled { cursor: default; opacity: 0.8; }
16
6
 
17
- .menuitem_state {
18
- left: 4px; top: 7px; height: 12px; width: 12px;
19
- background-image: #{this.getCssFilePath('minimenuitem_checkmark.png')};
7
+ .default.menuitem > .label,
8
+ .default.menuitem.state {
9
+ position: absolute; height: 24px;
20
10
  }
21
- .checked .menuitem_state {
22
- visibility: inherit;
11
+ .default.menuitem.state {
12
+ left: 4px; top: 7px; height: 12px; width: 12px;
13
+ background-image: #url(menuitem_checkmark.png);
23
14
  }
24
- .unchecked .menuitem_state {
15
+ .default.menuitem.state {
25
16
  visibility: hidden;
26
17
  }
27
-
28
- .menuitem_label {
18
+ .default.menuitem.state.checked {
19
+ visibility: inherit;
20
+ }
21
+ .default.menuitem > .label {
29
22
  left: 20px; right: 11px; top: 0px;
30
23
  height: 24px; line-height: 24px;
31
24
  text-align: left;
@@ -37,9 +30,4 @@
37
30
  font-size: 12px;
38
31
  color: #333;
39
32
  }
40
- .menuitem_label:hover {
41
- color: #000;
42
- }
43
- .disabled .menuitem_control {
44
- opacity: 0.8;
45
- }
33
+ .default.menuitem:hover > .label { color: #000; }
@@ -1,4 +1,2 @@
1
- <div class="menuitem_control#{this.value?' checked':' unchecked'}" id="control]I[">
2
- <div class="menuitem_state" id="state]I["></div>
3
- <div class="menuitem_label" id="label]I[">#{this.label}</div>
4
- </div>
1
+ <div class="state" id="state]I["></div>
2
+ <div class="label" id="label]I[">#{this.label}</div>
@@ -81,9 +81,17 @@ HMiniMenu = HRadioButtonList.extend({
81
81
  this.base();
82
82
  if(this.listItems && this.listItems.length !== 0 && this.valueMatrix !== undefined ) {
83
83
  for(var i=0;i<this.listItems.length;i++){
84
- if(this.listItems[i][0]===this.value){
85
- this.setLabel( this.listItems[i][1] );
86
- return;
84
+ if(this.typeChr(this.listItems[i]) === 'a'){
85
+ if(this.listItems[i][0]===this.value){
86
+ this.setLabel( this.listItems[i][1] );
87
+ return;
88
+ }
89
+ }
90
+ else {
91
+ if(this.listItems[i].value===this.value){
92
+ this.setLabel( this.listItems[i].value );
93
+ return;
94
+ }
87
95
  }
88
96
  }
89
97
  }
@@ -1,44 +1,49 @@
1
-
2
- .minimenu_control,
3
- .minimenu_edge_left,
4
- .minimenu_center,
5
- .minimenu_edge_right,
6
- .minimenu_label {
1
+ .default.minimenu {
2
+ cursor: pointer;
3
+ }
4
+ .default.minimenu.disabled {
5
+ cursor: default;
6
+ }
7
+ .default.minimenu > .bg,
8
+ .default.minimenu > .bg > .w,
9
+ .default.minimenu > .bg > .c,
10
+ .default.minimenu > .bg > .e,
11
+ .default.minimenu > .label {
7
12
  position: absolute;
8
13
  top: 0px; height: 15px;
9
14
  }
10
15
 
11
- .minimenu_control {
16
+ .default.minimenu > .bg {
12
17
  left: 0px; right: 0px;
13
18
  cursor: pointer;
14
19
  }
15
- .disabled .minimenu_control {
20
+ .disabled .default.minimenu > .bg {
16
21
  cursor: default;
17
22
  }
18
23
 
19
- .minimenu_edge_left,
20
- .minimenu_center,
21
- .minimenu_edge_right {
22
- background-image: #{this.getCssFilePath('minimenu.png')};
24
+ .default.minimenu > .bg > .w,
25
+ .default.minimenu > .bg > .c,
26
+ .default.minimenu > .bg > .e {
27
+ background-image: #url(minimenu.png);
23
28
  }
24
29
 
25
- .minimenu_edge_left {
30
+ .default.minimenu > .bg > .w {
26
31
  left: 0px; width: 7px;
27
32
  background-position: 0px 0px;
28
33
  }
29
34
 
30
- .minimenu_edge_right {
35
+ .default.minimenu > .bg > .e {
31
36
  right: 0px; width: 13px;
32
37
  background-position: -7px 0px;
33
38
  }
34
39
 
35
- .minimenu_center {
40
+ .default.minimenu > .bg > .c {
36
41
  left: 7px; right: 13px;
37
42
  background-position: 0px -15px;
38
43
  background-repeat: repeat-x;
39
44
  }
40
45
 
41
- .minimenu_label {
46
+ .default.minimenu > .label {
42
47
  left: 6px; right: 11px; top: 0px;
43
48
  height: 15px; line-height: 15px;
44
49
  text-align: left;
@@ -50,9 +55,9 @@
50
55
  font-size: 11px;
51
56
  color: #333;
52
57
  }
53
- .minimenu_control:hover > .minimenu_label {
58
+ .default.minimenu > .bg:hover > .default.minimenu > .label {
54
59
  color: #000;
55
60
  }
56
- .disabled .minimenu_control {
61
+ .disabled .default.minimenu > .bg {
57
62
  opacity: 0.8;
58
63
  }
@@ -1,8 +1,6 @@
1
- <div class="minimenu_control" id="control]I[">
2
- <span id="bg]I[">
3
- <div class="minimenu_edge_left"></div>
4
- <div class="minimenu_center"></div>
5
- <div class="minimenu_edge_right"></div>
6
- </span>
7
- <div class="minimenu_label" id="label]I[">#{this.label}</div>
8
- </div>
1
+ <span class="bg" id="bg]I[">
2
+ <div class="w"></div>
3
+ <div class="c"></div>
4
+ <div class="e"></div>
5
+ </span>
6
+ <div class="label" id="label]I[">#{this.label}</div>
@@ -26,8 +26,8 @@ HMiniMenuItem = HRadioButton.extend({
26
26
  click: function(){
27
27
  var _now = this.msNow();
28
28
  if( _now - this._parentLastActivation > 200 ){
29
- this.base();
30
29
  this._parentLastActivation = _now;
30
+ this.base();
31
31
  EVENT.changeActiveControl(null);
32
32
  }
33
33
  return true;
@@ -1,31 +1,24 @@
1
+ .default.minimenuitem { cursor: pointer; }
1
2
 
2
- .minimenuitem_control,
3
- .minimenuitem_label,
4
- .minimenuitem_state {
5
- position: absolute;
6
- top: 0px; height: 16px;
7
- }
3
+ .default.minimenuitem:hover { background-color: #fff; }
8
4
 
9
- .minimenuitem_control {
10
- left: 0px; right: 0px;
11
- cursor: pointer;
12
- }
13
- .minimenuitem_control:hover {
14
- background-color: #fff;
15
- }
5
+ .default.minimenuitem.disabled { cursor: default; opacity: 0.8; }
16
6
 
17
- .minimenuitem_state {
18
- left: 0px; top: 1px; height: 12px; width: 12px;
19
- background-image: #{this.getCssFilePath('minimenuitem_checkmark.png')};
7
+ .default.minimenuitem > .label,
8
+ .default.minimenuitem.state {
9
+ position: absolute; height: 16px;
20
10
  }
21
- .checked .minimenuitem_state {
22
- visibility: inherit;
11
+ .default.minimenuitem.state {
12
+ left: 0px; top: 1px; height: 12px; width: 12px;
13
+ background-image: #url(minimenuitemitem_checkmark.png);
23
14
  }
24
- .unchecked .minimenuitem_state {
15
+ .default.minimenuitem.state {
25
16
  visibility: hidden;
26
17
  }
27
-
28
- .minimenuitem_label {
18
+ .default.minimenuitem.state.checked {
19
+ visibility: inherit;
20
+ }
21
+ .default.minimenuitem > .label {
29
22
  left: 14px; right: 11px; top: 0px;
30
23
  height: 15px; line-height: 14px;
31
24
  text-align: left;
@@ -37,9 +30,4 @@
37
30
  font-size: 11px;
38
31
  color: #333;
39
32
  }
40
- .minimenuitem_label:hover {
41
- color: #000;
42
- }
43
- .disabled .minimenuitem_control {
44
- opacity: 0.8;
45
- }
33
+ .default.minimenuitem:hover > .label { color: #000; }
@@ -1,4 +1,2 @@
1
- <div class="minimenuitem_control#{this.value?' checked':' unchecked'}" id="control]I[">
2
- <div class="minimenuitem_state" id="state]I["></div>
3
- <div class="minimenuitem_label" id="label]I[">#{this.label}</div>
4
- </div>
1
+ <div class="state" id="state]I["></div>
2
+ <div class="label" id="label]I[">#{this.label}</div>
@@ -1,46 +1,51 @@
1
-
2
- .popupmenu_control,
3
- .popupmenu_edge_left,
4
- .popupmenu_center,
5
- .popupmenu_edge_right,
6
- .popupmenu_label {
1
+ .default.popupmenu {
2
+ cursor: pointer;
3
+ }
4
+ .default.popupmenu.disabled {
5
+ cursor: default;
6
+ }
7
+ .default.popupmenu > .bg,
8
+ .default.popupmenu > .bg > .w,
9
+ .default.popupmenu > .bg > .c,
10
+ .default.popupmenu > .bg > .e,
11
+ .default.popupmenu > .label {
7
12
  position: absolute;
8
13
  top: 0px; height: 23px;
9
14
  }
10
15
 
11
- .popupmenu_control {
16
+ .default.popupmenu > .bg {
12
17
  left: 0px; right: 0px;
13
18
  cursor: pointer;
14
19
  }
15
- .disabled .popupmenu_control {
20
+ .default.popupmenu > .disabled .bg {
16
21
  cursor: default;
17
22
  }
18
23
 
19
- .popupmenu_edge_left,
20
- .popupmenu_center,
21
- .popupmenu_edge_right {
22
- background-image: #{this.getCssFilePath('popupmenu.png')};
24
+ .default.popupmenu > .bg > .w,
25
+ .default.popupmenu > .bg > .c,
26
+ .default.popupmenu > .bg > .e {
27
+ background-image: #url(popupmenu.png);
23
28
  }
24
29
 
25
- .popupmenu_edge_left {
30
+ .default.popupmenu > .bg > .w {
26
31
  left: 0px; width: 9px;
27
32
  background-position: 0px 0px;
28
33
  background-repeat: no-repeat;
29
34
  }
30
35
 
31
- .popupmenu_edge_right {
36
+ .default.popupmenu > .bg > .e {
32
37
  right: 0px; width: 17px;
33
38
  background-position: -9px 0px;
34
39
  background-repeat: no-repeat;
35
40
  }
36
41
 
37
- .popupmenu_center {
42
+ .default.popupmenu > .bg > .c {
38
43
  left: 9px; right: 17px;
39
44
  background-position: 0px -23px;
40
45
  background-repeat: repeat-x;
41
46
  }
42
47
 
43
- .popupmenu_label {
48
+ .default.popupmenu > .label {
44
49
  left: 13px; right: 11px; top: 0px;
45
50
  height: 22px;
46
51
  text-align: left;
@@ -51,11 +56,14 @@
51
56
  font-family: Helvetica, Arial, sans-serif;
52
57
  font-size: 12px;
53
58
  color: #333;
54
- line-height: #{BROWSER_TYPE.ie7?'20':'22'}px;
59
+ line-height: 22px;
60
+ }
61
+ .default.popupmenu.ie7 > .label{
62
+ line-height: 20px;
55
63
  }
56
- .popupmenu_control:hover > .popupmenu_label {
64
+ .default.popupmenu > .bg:hover > .label {
57
65
  color: #000;
58
66
  }
59
- .disabled .popupmenu_control {
67
+ .default.popupmenu.disabled > .bg {
60
68
  opacity: 0.6;
61
69
  }
@@ -1,8 +1,6 @@
1
- <div class="popupmenu_control" id="control]I[">
2
- <span id="bg]I[">
3
- <div class="popupmenu_edge_left"></div>
4
- <div class="popupmenu_center"></div>
5
- <div class="popupmenu_edge_right"></div>
6
- </span>
7
- <div class="popupmenu_label" id="label]I[">#{this.label}</div>
8
- </div>
1
+ <span class="bg" id="bg]I[">
2
+ <div class="w"></div>
3
+ <div class="c"></div>
4
+ <div class="e"></div>
5
+ </span>
6
+ <div class="label" id="label]I[">#{this.label}</div>
@@ -51,6 +51,7 @@ class ClientPkgBuild
51
51
  def read_file( path )
52
52
  filehandle = open( path, 'rb' )
53
53
  filedata = filehandle.read
54
+ filedata.force_encoding( 'UTF-8' ) if filedata.encoding != 'UTF-8'
54
55
  filehandle.close
55
56
  return filedata
56
57
  end
@@ -108,9 +109,13 @@ class ClientPkgBuild
108
109
  tmpl.gsub!( TMPL_RE ) do
109
110
  ( js_type, js_code ) = [ $1, $2 ]
110
111
  begin
111
- js_code = CoffeeScript.compile( js_code, :bare => true ) if js_code.start_with?('#!coffee')
112
+ if js_code.start_with?('#!coffee')
113
+ js_code = CoffeeScript.compile( js_code, :bare => true )
114
+ end
112
115
  rescue ExecJS::RuntimeError
113
- js_code = "console.log('Invalid coffee in template #{theme_name}/#{component_name}:',#{js_code.to_json})"
116
+ js_code = "console.log('Invalid CoffeeScript in template #{theme_name}/#{component_name}:',#{js_code.to_json});"
117
+ rescue Encoding::CompatibilityError
118
+ js_code = "console.log('Invalid charset in CoffeeScript template #{theme_name}/#{component_name}:',#{js_code.to_json});"
114
119
  end
115
120
  if cached_idx.has_key?( js_code )
116
121
  seq_id = cached_idx[ js_code ]
@@ -127,6 +132,7 @@ class ClientPkgBuild
127
132
  else
128
133
  fn_args = ''
129
134
  end
135
+ js_code.force_encoding 'UTF-8' if js_code.encoding != 'UTF-8'
130
136
  if js_type == '$'
131
137
  js_cmds << "function(#{fn_args}){#{js_code};}"
132
138
  else
@@ -135,6 +141,7 @@ class ClientPkgBuild
135
141
  end
136
142
  "#{js_type}{#{seq_id}}"
137
143
  end
144
+ tmpl.force_encoding 'UTF-8' if tmpl.encoding != 'UTF-8'
138
145
  %{[[#{js_cmds.join(',')}],#{tmpl.to_json}]}
139
146
  end
140
147
 
@@ -290,13 +297,18 @@ class ClientPkgBuild
290
297
  begin
291
298
  coffee_src = read_file( src_path )
292
299
  js_data = CoffeeScript.compile( coffee_src, :bare => true )
293
- rescue CoffeeScript::CompilationError, ExecJS::RuntimeError
300
+ rescue CoffeeScript::CompilationError, ExecJS::RuntimeError => e
294
301
  if has_js
302
+ warn "CoffeeScript Compilation failure #1: #{e.inspect}"
295
303
  js_data = %{console.log( 'WARNING: CoffeeScript complilation failed for source file #{src_path.to_json}, using the js variant instead.' );}
296
304
  js_data += read_file( File.join( bundle_path, bundle_name+'.js' ) )
297
305
  else
306
+ warn "CoffeeScript Compilation failure #2: #{e.inspect}"
298
307
  js_data = %{console.log( 'WARNING: CoffeeScript complilation failed for source file #{src_path.to_json}' );}
299
308
  end
309
+ rescue => e
310
+ warn "CoffeeScript Compilation failure #3: #{e.inspect}"
311
+ js_data = %{console.log( 'WARNING CoffeeScript complilation failed for source file #{src_path.to_json}' );}
300
312
  end
301
313
  else
302
314
  js_data = read_file( src_path )
@@ -565,6 +577,19 @@ class ClientPkgBuild
565
577
  end
566
578
  end
567
579
 
580
+ def package_array_cleanup_encodings( package_array )
581
+ outp = ''
582
+ package_array.each do |item|
583
+ if item.encoding != 'UTF-8'
584
+ puts "item has invalid encoding(#{item.encoding.to_s}): #{item[0..70]}"
585
+ outp += item.force_encoding( 'UTF-8' )
586
+ else
587
+ outp += item
588
+ end
589
+ end
590
+ outp
591
+ end
592
+
568
593
  def compose_destinations
569
594
  @destination_files = {} # rename to package_products
570
595
  @destination_origsize = {}
@@ -580,7 +605,11 @@ class ClientPkgBuild
580
605
  end
581
606
  end
582
607
  @destination_files.each do | package_name, package_array |
583
- package_data = package_array.join("\n")
608
+ begin
609
+ package_data = package_array.join("\n")
610
+ rescue Encoding::CompatibilityError
611
+ package_data = package_array_cleanup_encodings( package_array )
612
+ end
584
613
  @destination_files[ package_name ] = package_data
585
614
  end
586
615
  end