rsence-pre 3.0.0.7 → 3.0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/client/js/controls/button/button.coffee +7 -0
- data/client/js/controls/button/themes/default/button.css +38 -4
- data/client/js/controls/tab/themes/default/tab.css +0 -1
- data/client/js/controls/tab/themes/default/tab.html +8 -1
- data/client/js/foundation/thememanager/thememanager.coffee +7 -6
- data/plugins/client_pkg/client_pkg.rb +37 -26
- data/plugins/client_pkg/lib/client_pkg_build.rb +60 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e6dd280bbf9fe1c080d0eba1085327fc25663fe6
|
4
|
+
data.tar.gz: fd9c7ce53a81ecd4099461708f70ea6b256033f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f19eaa0dacb233b00ec7b3eef43c0ae976c74112878582ef4cbbfb76b92f9d54cd166058e97431df64cdaf86f121e875d3b250100398610cc055b998a03f8f6a
|
7
|
+
data.tar.gz: 7a0dbe67283aeddecf7c6173276735cf828a64465e7a53c5d9765c19967a4942346748f2204c385a41ad6c281be60f48d6ce68b7345d0f3f6b9cc29883ba739c
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.0.0.
|
1
|
+
3.0.0.8.pre
|
@@ -35,6 +35,13 @@ HButton = HControl.extend
|
|
35
35
|
click: ->
|
36
36
|
console.log('no click action defined in HButton') if !@isProduction
|
37
37
|
|
38
|
+
refresh: ->
|
39
|
+
@base()
|
40
|
+
if @options.defaultKeyClick
|
41
|
+
@toggleCSSClass(@elemId,'action',true)
|
42
|
+
else
|
43
|
+
@toggleCSSClass(@elemId,'action',false)
|
44
|
+
|
38
45
|
labelPadding: 0
|
39
46
|
optimizeWidth: ->
|
40
47
|
_labelWidth = @stringWidth(@label,null,@markupElemIds.label)
|
@@ -15,12 +15,12 @@
|
|
15
15
|
top: 2px; left: 2px; right: 2px; bottom: 3px;
|
16
16
|
border: 1px solid #e0e0e0;
|
17
17
|
border-top: 0; border-left: 0;
|
18
|
-
box-shadow:
|
18
|
+
box-shadow: 0 0 3px #333;
|
19
19
|
#{this.gradientCSS('#fcfcfc',[45,'#ffffff'],[55,'#fdfdfd'],[75,'#f3f3f3'],'#f0f0f0')}
|
20
20
|
}
|
21
21
|
.default.disabled > .button_control > .button_bg {
|
22
22
|
border-color: #ddd;
|
23
|
-
box-shadow:
|
23
|
+
box-shadow: 0 0 3px #666;
|
24
24
|
opacity: 0.75;
|
25
25
|
#{this.gradientCSS('#d6d6d6',[66,'#d0d0d0'],[71,'#d3d3d3'],'#cccccc')}
|
26
26
|
}
|
@@ -38,19 +38,53 @@
|
|
38
38
|
.default.disabled > .button_control > .button_label {
|
39
39
|
color: #999;
|
40
40
|
}
|
41
|
+
|
42
|
+
.default.enabled.action > .button_control > .button_bg {
|
43
|
+
border-color: #000;
|
44
|
+
box-shadow: 0 0 3px #000;
|
45
|
+
#{this.gradientCSS('#333',[45,'#555'],[55,'#444'],[75,'#222'],'#111')}
|
46
|
+
}
|
47
|
+
.default.enabled.action > .button_control > .button_label {
|
48
|
+
color: #fdfdfd;
|
49
|
+
text-shadow: 0 0 2px #000;
|
50
|
+
}
|
51
|
+
|
41
52
|
.default.enabled > .button_control:hover > .button_bg {
|
42
|
-
box-shadow:
|
53
|
+
box-shadow: 0 0 3px #000;
|
43
54
|
#{this.gradientCSS('#f6f6f6',[66,'#ffffff'],[71,'#fcfcfc'],'#f0f0f0')}
|
44
55
|
}
|
45
56
|
.default.enabled > .button_control:hover > .button_label {
|
46
57
|
color: #000;
|
47
58
|
}
|
59
|
+
|
60
|
+
.default.enabled.action > .button_control:hover > .button_bg {
|
61
|
+
border-color: #000;
|
62
|
+
box-shadow: 0 0 3px #000;
|
63
|
+
#{this.gradientCSS('#111',[66,'#333'],[71,'#333'],'#000')}
|
64
|
+
}
|
65
|
+
.default.enabled.action > .button_control:hover > .button_label {
|
66
|
+
color: #fff;
|
67
|
+
text-shadow: 0 0 2px #000;
|
68
|
+
}
|
69
|
+
|
48
70
|
.default.enabled > .button_control:active > .button_bg {
|
49
71
|
border: 1px solid #fff;
|
50
72
|
border-bottom: 0; border-right: 0;
|
51
|
-
box-shadow:
|
73
|
+
box-shadow: 0 0 3px #000;
|
52
74
|
#{this.gradientCSS('#e6e6e6',[29,'#f0f0f0'],[33,'#f6f6f6'],'#ffffff')}
|
53
75
|
}
|
54
76
|
.default.enabled > .button_control:active > .button_label {
|
55
77
|
color: #000;
|
56
78
|
}
|
79
|
+
|
80
|
+
.default.enabled.action > .button_control:active > .button_bg {
|
81
|
+
border: 1px solid #fff;
|
82
|
+
margin: -1px;
|
83
|
+
box-shadow: 0 0 3px #fff;
|
84
|
+
#{this.gradientCSS('#111',[29,'#333'],[33,'#333'],'#000')}
|
85
|
+
}
|
86
|
+
.default.enabled.action > .button_control:active > .button_label {
|
87
|
+
color: #fff;
|
88
|
+
text-shadow: 0 0 2px #000;
|
89
|
+
}
|
90
|
+
|
@@ -3,4 +3,11 @@
|
|
3
3
|
</div>
|
4
4
|
<div class="tab_label" id="label]I["></div>
|
5
5
|
<div class="tab_label_fill_bg" id="state]I["></div>
|
6
|
-
${
|
6
|
+
${#!coffee
|
7
|
+
@themeStyle = ->
|
8
|
+
@tabLabelLeftEdge = ( @options.tabLabelLeftEdge or 12 )
|
9
|
+
@tabLabelRightEdge = ( @options.tabLabelRightEdge or 9 )
|
10
|
+
@tabLabelHeight = ( @options.tabLabelHeight or 24 )
|
11
|
+
@fontStyle = 'font-family:Helvetica,Arial,sans-serif;font-size:12px;font-weight:bold;'
|
12
|
+
@tabLabelFillBg = true
|
13
|
+
}
|
@@ -22,8 +22,9 @@ HThemeManager = HClass.extend
|
|
22
22
|
for _componentName of @themeCSSTemplates[_themeName]
|
23
23
|
_cssText += @buildCSSTemplate(@, _themeName, _componentName)
|
24
24
|
_style = @useCSS( _cssText )
|
25
|
-
|
26
|
-
|
25
|
+
# Causes issues in Firefox:
|
26
|
+
# _cssTitle = 'rsence/'+_themeName
|
27
|
+
# _style.title = _cssTitle
|
27
28
|
|
28
29
|
setupThemePath: (_themeName)->
|
29
30
|
return unless @currentThemePath?
|
@@ -48,7 +49,7 @@ HThemeManager = HClass.extend
|
|
48
49
|
|
49
50
|
# Set the theme data, this is called by the serverside client_pkg suite
|
50
51
|
installThemeData: (_themeName, _themeCSS, _themeHTML)->
|
51
|
-
@themes
|
52
|
+
@themes.push(_themeName) unless ~@themes.indexOf(_themeName)
|
52
53
|
@setThemeCSSTemplates(_themeName, _themeCSS)
|
53
54
|
@setThemeHTMLTemplates(_themeName, _themeHTML)
|
54
55
|
@setupThemePath(_themeName)
|
@@ -204,13 +205,13 @@ HThemeManager = HClass.extend
|
|
204
205
|
_style.media = 'all'
|
205
206
|
|
206
207
|
_head = document.getElementsByTagName('head')[0]
|
208
|
+
_head.appendChild(_style)
|
207
209
|
|
208
|
-
if BROWSER_TYPE.safari
|
210
|
+
if BROWSER_TYPE.safari or BROWSER_TYPE.firefox or BROWSER_TYPE.opera
|
209
211
|
# This is how to do it in KHTML browsers
|
210
212
|
_style.appendChild( document.createTextNode(_cssText) )
|
211
213
|
else
|
212
|
-
# This works for others (add more checks, if problems with new browsers)
|
214
|
+
# This works for many others (add more checks, if problems with new browsers)
|
213
215
|
_style.textContent = _cssText
|
214
|
-
_head.appendChild(_style)
|
215
216
|
|
216
217
|
_style
|
@@ -3,20 +3,31 @@
|
|
3
3
|
lib_path = File.expand_path( 'lib', bundle_path )
|
4
4
|
|
5
5
|
# The ClientPkgCache class:
|
6
|
-
|
6
|
+
if RSence.args[:debug]
|
7
|
+
load File.expand_path( 'client_pkg_cache.rb', lib_path )
|
8
|
+
else
|
9
|
+
require File.expand_path( 'client_pkg_cache', lib_path )
|
10
|
+
end
|
7
11
|
|
8
12
|
# The ClientPkgServe module:
|
9
|
-
|
13
|
+
if RSence.args[:debug]
|
14
|
+
load File.expand_path( 'client_pkg_serve.rb', lib_path )
|
15
|
+
else
|
16
|
+
require File.expand_path( 'client_pkg_serve', lib_path )
|
17
|
+
end
|
10
18
|
|
11
19
|
# The ClientPkgBuild class:
|
12
|
-
|
13
|
-
|
20
|
+
if RSence.args[:debug]
|
21
|
+
load File.expand_path( 'client_pkg_build.rb', lib_path )
|
22
|
+
else
|
23
|
+
require File.expand_path( 'client_pkg_build', lib_path )
|
24
|
+
end
|
14
25
|
|
15
26
|
# @private The ClientPkgPlugin builds and serves the client packages. It's not intended to be a part of the public API at this time.
|
16
27
|
class ClientPkgPlugin < Servlet
|
17
|
-
|
28
|
+
|
18
29
|
include ClientPkgServe
|
19
|
-
|
30
|
+
|
20
31
|
class BuildLogger
|
21
32
|
def initialize( log_path )
|
22
33
|
@last_time = Time.now
|
@@ -45,7 +56,7 @@ class ClientPkgPlugin < Servlet
|
|
45
56
|
@log_file = nil
|
46
57
|
end
|
47
58
|
end
|
48
|
-
|
59
|
+
|
49
60
|
def rebuild_client
|
50
61
|
@build_busy = true
|
51
62
|
next_change=Time.now.to_f
|
@@ -58,7 +69,7 @@ class ClientPkgPlugin < Servlet
|
|
58
69
|
@last_change = next_change
|
59
70
|
@build_busy = false
|
60
71
|
end
|
61
|
-
|
72
|
+
|
62
73
|
def ready?
|
63
74
|
return (not @build_busy)
|
64
75
|
end
|
@@ -86,43 +97,43 @@ class ClientPkgPlugin < Servlet
|
|
86
97
|
end
|
87
98
|
end
|
88
99
|
end
|
89
|
-
|
100
|
+
|
90
101
|
end
|
91
|
-
|
102
|
+
|
92
103
|
def add_src_dir( src_dir ); @client_build.add_src_dir( src_dir ); end
|
93
104
|
def add_src_dirs( src_dirs ); @client_build.add_src_dirs( src_dirs ); end
|
94
105
|
def del_src_dir( src_dir ); @client_build.del_src_dir( src_dir ); end
|
95
106
|
def del_src_dirs( src_dirs ); @client_build.del_src_dirs( src_dirs ); end
|
96
|
-
|
107
|
+
|
97
108
|
def add_theme( theme_name ); @client_build.add_theme( theme_name ); end
|
98
109
|
def add_themes( theme_names ); @client_build.add_themes( theme_names ); end
|
99
110
|
def del_theme( theme_name ); @client_build.del_theme( theme_name ); end
|
100
111
|
def del_themes( theme_names ); @client_build.del_themes( theme_names ); end
|
101
|
-
|
112
|
+
|
102
113
|
def add_package( pkg_name, pkg_items ); @client_build.add_package( pkg_name, pkg_items ); end
|
103
114
|
def add_packages( packages ); @client_build.add_packages( packages ); end
|
104
115
|
def del_package( pkg_name ); @client_build.del_package( pkg_name ); end
|
105
116
|
def del_packages( packages ); @client_build.del_packages( packages ); end
|
106
|
-
|
117
|
+
|
107
118
|
def add_compound( compound_name, pkg_names ); @client_build.add_compound( compound_name, pkg_names ); end
|
108
119
|
def add_compounds( compounds ); @client_build.add_compounds( compounds ); end
|
109
120
|
def del_compound( compound_name ); @client_build.del_compound( compound_name ); end
|
110
121
|
def del_compounds( compounds ); @client_build.del_compounds( compounds ); end
|
111
|
-
|
122
|
+
|
112
123
|
def add_reserved_name( reserved_name ); @client_build.add_reserved_name( reserved_name ); end
|
113
124
|
def add_reserved_names( reserved_names ); @client_build.add_reserved_names( reserved_names ); end
|
114
125
|
def del_reserved_name( reserved_name ); @client_build.del_reserved_name( reserved_name ); end
|
115
126
|
def del_reserved_names( reserved_names ); @client_build.del_reserved_names( reserved_names ); end
|
116
|
-
|
127
|
+
|
117
128
|
def add_gfx_format( gfx_format_name ); @client_build.add_gfx_format( gfx_format_name ); end
|
118
129
|
def add_gfx_formats( gfx_format_names ); @client_build.add_gfx_formats( gfx_format_names ); end
|
119
130
|
def del_gfx_format( gfx_format_name ); @client_build.del_gfx_format( gfx_format_name ); end
|
120
131
|
def del_gfx_formats( gfx_format_names ); @client_build.del_gfx_formats( gfx_format_names ); end
|
121
|
-
|
132
|
+
|
122
133
|
def client_build; @client_build; end
|
123
|
-
|
134
|
+
|
124
135
|
def client_cache; @client_cache; end
|
125
|
-
|
136
|
+
|
126
137
|
def close
|
127
138
|
if @thr
|
128
139
|
@thr.kill
|
@@ -133,7 +144,7 @@ class ClientPkgPlugin < Servlet
|
|
133
144
|
@client_cache = nil
|
134
145
|
@build_logger.close
|
135
146
|
end
|
136
|
-
|
147
|
+
|
137
148
|
def squeeze( js )
|
138
149
|
return @client_build.squeeze( js )
|
139
150
|
end
|
@@ -141,22 +152,22 @@ class ClientPkgPlugin < Servlet
|
|
141
152
|
def coffee( src )
|
142
153
|
return @client_build.coffee( src )
|
143
154
|
end
|
144
|
-
|
155
|
+
|
145
156
|
def init
|
146
|
-
|
157
|
+
|
147
158
|
@thr = false
|
148
|
-
|
159
|
+
|
149
160
|
@build_logger = BuildLogger.new( File.join(RSence.args[:env_path],'log','build_log') )
|
150
161
|
@build_logger.open
|
151
|
-
|
162
|
+
|
152
163
|
@client_build = ClientPkgBuild.new( RSence.config[:client_pkg], @build_logger )
|
153
164
|
@client_cache = ClientPkgCache.new
|
154
|
-
|
165
|
+
|
155
166
|
@build_busy = false
|
156
167
|
rebuild_client
|
157
|
-
|
168
|
+
|
158
169
|
end
|
159
|
-
|
170
|
+
|
160
171
|
end
|
161
172
|
|
162
173
|
|
@@ -2,9 +2,44 @@
|
|
2
2
|
require 'jsmin_c'
|
3
3
|
require 'jscompress'
|
4
4
|
require 'html_min'
|
5
|
+
begin
|
6
|
+
require 'sass'
|
7
|
+
RSence.config[:client_pkg][:sass_supported] = true
|
8
|
+
module Sass::Script::Functions
|
9
|
+
def js_call(string)
|
10
|
+
tmpl_js = '${'+string.value+'}'
|
11
|
+
Sass::Script::String.new(tmpl_js)
|
12
|
+
end
|
13
|
+
def js_tmpl(string)
|
14
|
+
# assert_type string, :String
|
15
|
+
tmpl_js = '#{'+string.value+'}'
|
16
|
+
# puts "js_tmpl(#{string.inspect}) -> #{tmpl_js.inspect}"
|
17
|
+
Sass::Script::String.new(tmpl_js)
|
18
|
+
end
|
19
|
+
declare :js_call, :args => [:string]
|
20
|
+
declare :js_tmpl, :args => [:string]
|
21
|
+
end
|
22
|
+
rescue LoadError
|
23
|
+
warn "SASS not installed. Install the 'sass' gem to enable."
|
24
|
+
RSence.config[:client_pkg][:sass_supported] = false
|
25
|
+
end
|
5
26
|
begin
|
6
27
|
require 'coffee-script'
|
7
28
|
RSence.config[:client_pkg][:coffee_supported] = true
|
29
|
+
module Sass::Script::Functions
|
30
|
+
def coffee_call(string)
|
31
|
+
js_src = CoffeeScript.compile( string.value, :bare => true )
|
32
|
+
tmpl_js = '${'+js_src+'}'
|
33
|
+
Sass::Script::String.new(tmpl_js)
|
34
|
+
end
|
35
|
+
def coffee_tmpl(string)
|
36
|
+
js_src = CoffeeScript.compile( string.value, :bare => true )
|
37
|
+
tmpl_js = '#{'+js_src+'}'
|
38
|
+
Sass::Script::String.new(tmpl_js)
|
39
|
+
end
|
40
|
+
declare :coffee_call, :args => [:string]
|
41
|
+
declare :coffee_tmpl, :args => [:string]
|
42
|
+
end
|
8
43
|
rescue LoadError
|
9
44
|
warn "CoffeeScript not installed. Install the 'coffee-script' gem to enable."
|
10
45
|
RSence.config[:client_pkg][:coffee_supported] = false
|
@@ -30,6 +65,24 @@ class ClientPkgBuild
|
|
30
65
|
|
31
66
|
def read_css( src_path, theme_name, component_name )
|
32
67
|
css_data = read_file( src_path )
|
68
|
+
if @sass_supported
|
69
|
+
begin
|
70
|
+
if src_path.end_with?('.sass')
|
71
|
+
css_data = Sass::Engine.new(css_data,:syntax => :sass, :style => :compressed).render
|
72
|
+
elsif src_path.end_with?('.scss')
|
73
|
+
css_data = Sass::Engine.new(css_data,:syntax => :scss).render #, :style => :compressed).render
|
74
|
+
# puts css_data
|
75
|
+
end
|
76
|
+
rescue => e
|
77
|
+
RSence.plugin_manager.plugin_error(
|
78
|
+
e,
|
79
|
+
'SASS Error',
|
80
|
+
"An error occurred while parsing the SASS file: #{src_path}.",
|
81
|
+
src_path
|
82
|
+
)
|
83
|
+
return ''
|
84
|
+
end
|
85
|
+
end
|
33
86
|
unless @debug
|
34
87
|
unless @no_whitespace_removal
|
35
88
|
css_data = @html_min.minimize( css_data )
|
@@ -71,9 +124,9 @@ class ClientPkgBuild
|
|
71
124
|
fn_args = ''
|
72
125
|
end
|
73
126
|
if js_type == '$'
|
74
|
-
js_cmds << "function(#{fn_args}){#{js_code}}"
|
127
|
+
js_cmds << "function(#{fn_args}){#{js_code};}"
|
75
128
|
else
|
76
|
-
js_cmds << "function(#{fn_args}){return #{js_code}}"
|
129
|
+
js_cmds << "function(#{fn_args}){return #{js_code};}"
|
77
130
|
end
|
78
131
|
end
|
79
132
|
"#{js_type}{#{seq_id}}"
|
@@ -128,7 +181,9 @@ class ClientPkgBuild
|
|
128
181
|
:gfx => 0
|
129
182
|
}
|
130
183
|
theme_css = ''
|
131
|
-
[ File.join( src_path_theme, bundle_name+'.
|
184
|
+
[ File.join( src_path_theme, bundle_name+'.sass' ),
|
185
|
+
File.join( src_path_theme, bundle_name+'.scss' ),
|
186
|
+
File.join( src_path_theme, bundle_name+'.css' ),
|
132
187
|
File.join( src_path_theme, 'css', bundle_name+'.css' )
|
133
188
|
].each do |src_file_css|
|
134
189
|
if File.exist?( src_file_css )
|
@@ -416,7 +471,7 @@ class ClientPkgBuild
|
|
416
471
|
html_template += "#{bundle_name.to_json}:#{theme_data}," unless theme_data.empty?
|
417
472
|
end
|
418
473
|
html_template.chop! if html_template.end_with?(',')
|
419
|
-
theme_html_js = "(function(){HThemeManager.installThemeData(#{theme_name.to_json},{#{css_template}},{#{html_template}})})();"
|
474
|
+
theme_html_js = "(function(){HThemeManager.installThemeData(#{theme_name.to_json},{#{css_template}},{#{html_template}});})();"
|
420
475
|
pkg_name = theme_name+'_theme'
|
421
476
|
orig_size = theme_html_js.bytesize
|
422
477
|
theme_html_js = @jsmin.minimize( theme_html_js ) unless @no_whitespace_removal
|
@@ -694,6 +749,7 @@ class ClientPkgBuild
|
|
694
749
|
def initialize( config, logger )
|
695
750
|
|
696
751
|
@coffee_supported = config[:coffee_supported]
|
752
|
+
@sass_supported = config[:sass_supported]
|
697
753
|
@src_cache = {
|
698
754
|
:path_timestamp => {},
|
699
755
|
:path_compiled => {},
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rsence-pre
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.0.
|
4
|
+
version: 3.0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Riassence Inc.
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-05-
|
12
|
+
date: 2013-05-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rsence-deps
|