rsence-pre 3.0.0.5 → 3.0.0.6
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.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/client/conf/client_pkg.yaml +8 -8
- data/client/js/chat/speech_bubble/themes/default/speech_bubble.css +3 -3
- data/client/js/controls/button/button.coffee +45 -0
- data/client/js/controls/button/themes/default/button.css +39 -72
- data/client/js/controls/button/themes/default/button.html +14 -4
- data/client/js/controls/checkbox/checkbox.js +9 -8
- data/client/js/controls/checkbox/themes/default/checkbox.css +1 -1
- data/client/js/controls/checkbox/themes/default/checkbox.html +1 -0
- data/client/js/controls/clickbutton/clickbutton.coffee +44 -0
- data/client/js/controls/onoffbutton/themes/default/onoffbutton.css +20 -19
- data/client/js/controls/onoffbutton/themes/default/onoffbutton.html +1 -4
- data/client/js/controls/radiobutton/themes/default/radiobutton.css +1 -1
- data/client/js/controls/radiobutton/themes/default/radiobutton.html +1 -0
- data/client/js/controls/searchfield/searchfield.coffee +1 -1
- data/client/js/controls/searchfield/themes/default/searchfield.css +1 -1
- data/client/js/controls/stringview/themes/default/stringview.css +1 -1
- data/client/js/controls/tab/tab.js +17 -17
- data/client/js/controls/tab/themes/default/tab.css +16 -16
- data/client/js/controls/tab/themes/default/tab.html +1 -1
- data/client/js/controls/textarea/textarea.js +1 -1
- data/client/js/controls/textarea/themes/default/textarea.css +1 -1
- data/client/js/controls/textcontrol/themes/default/textcontrol.css +1 -2
- data/client/js/controls/uploader/themes/default/uploader.css +10 -62
- data/client/js/controls/uploader/themes/default/uploader.html +31 -25
- data/client/js/controls/uploader/uploader.coffee +10 -7
- data/client/js/controls/window/themes/default/window.css +2 -4
- data/client/js/core/elem/elem.coffee +4 -4
- data/client/js/core/event/event.js +11 -11
- data/client/js/datetime/calendar/themes/default/calendar.css +3 -3
- data/client/js/foundation/eventmanager/eventmanager.coffee +44 -1
- data/client/js/foundation/thememanager/thememanager.coffee +30 -17
- data/client/js/foundation/view/view.js +194 -192
- data/client/js/menus/menuitem/themes/default/menuitem.css +1 -1
- data/client/js/menus/minimenu/themes/default/minimenu.css +1 -1
- data/client/js/menus/minimenuitem/themes/default/minimenuitem.css +1 -1
- data/client/js/menus/popupmenu/themes/default/popupmenu.css +1 -1
- data/plugins/client_pkg/lib/client_pkg_build.rb +54 -53
- data/plugins/main/tmpl/index.html +1 -1
- metadata +4 -5
- data/client/js/controls/button/button.js +0 -78
- data/client/js/controls/button/themes/default/button_parts1.png +0 -0
- data/client/js/foundation/view/markupview/markupview.js +0 -95
@@ -12,14 +12,14 @@ end
|
|
12
12
|
|
13
13
|
|
14
14
|
class ClientPkgBuild
|
15
|
-
|
15
|
+
|
16
16
|
def read_file( path )
|
17
17
|
filehandle = open( path, 'rb' )
|
18
18
|
filedata = filehandle.read
|
19
19
|
filehandle.close
|
20
20
|
return filedata
|
21
21
|
end
|
22
|
-
|
22
|
+
|
23
23
|
def gzip_string( string )
|
24
24
|
gz_string = GZString.new('')
|
25
25
|
gz_writer = Zlib::GzipWriter.new( gz_string, @gz_strategy )
|
@@ -27,7 +27,7 @@ class ClientPkgBuild
|
|
27
27
|
gz_writer.close
|
28
28
|
return gz_string
|
29
29
|
end
|
30
|
-
|
30
|
+
|
31
31
|
def read_css( src_path, theme_name, component_name )
|
32
32
|
css_data = read_file( src_path )
|
33
33
|
unless @debug
|
@@ -40,7 +40,7 @@ class ClientPkgBuild
|
|
40
40
|
end
|
41
41
|
tmpl_to_js( css_data, theme_name, component_name )
|
42
42
|
end
|
43
|
-
|
43
|
+
|
44
44
|
ID_RE = /(#\{_ID\})/
|
45
45
|
WIDTH_RE = /(#\{_WIDTH\})/
|
46
46
|
HEIGHT_RE = /(#\{_HEIGHT\})/
|
@@ -54,6 +54,7 @@ class ClientPkgBuild
|
|
54
54
|
tmpl.gsub!( HEIGHT_RE, ']H[')
|
55
55
|
tmpl.gsub!( TMPL_RE ) do
|
56
56
|
( js_type, js_code ) = [ $1, $2 ]
|
57
|
+
js_code = CoffeeScript.compile( js_code, :bare => true ) if js_code.start_with?('#!coffee')
|
57
58
|
if cached_idx.has_key?( js_code )
|
58
59
|
seq_id = cached_idx[ js_code ]
|
59
60
|
else
|
@@ -89,7 +90,7 @@ class ClientPkgBuild
|
|
89
90
|
end
|
90
91
|
tmpl_to_js( html_data, theme_name, component_name )
|
91
92
|
end
|
92
|
-
|
93
|
+
|
93
94
|
def read_gfx( src_path_theme, theme_newest )
|
94
95
|
gfx_size = 0
|
95
96
|
gfx_data = {}
|
@@ -109,7 +110,7 @@ class ClientPkgBuild
|
|
109
110
|
end
|
110
111
|
return [ gfx_size, gfx_data, theme_newest ]
|
111
112
|
end
|
112
|
-
|
113
|
+
|
113
114
|
# processes theme-related files
|
114
115
|
def read_theme( bundle_dir, bundle_name )
|
115
116
|
time_start = Time.now.to_f
|
@@ -191,7 +192,7 @@ class ClientPkgBuild
|
|
191
192
|
end
|
192
193
|
@theme_time += (Time.now.to_f - time_start)
|
193
194
|
end
|
194
|
-
|
195
|
+
|
195
196
|
def add_bundle( bundle_name, bundle_path, entries, has_js=false, has_coffee=false )
|
196
197
|
has_themes = entries.include?( 'themes' ) and File.directory?( File.join( bundle_path, 'themes' ) )
|
197
198
|
if @bundles_found.has_key?( bundle_name )
|
@@ -271,12 +272,12 @@ class ClientPkgBuild
|
|
271
272
|
:has_themes => has_themes,
|
272
273
|
:src_timestamp => src_timestamp
|
273
274
|
}
|
274
|
-
|
275
|
+
|
275
276
|
read_theme( bundle_path, bundle_name ) if has_themes
|
276
277
|
|
277
278
|
return true
|
278
279
|
end
|
279
|
-
|
280
|
+
|
280
281
|
def find_bundles( src_dir )
|
281
282
|
# makes sure the src_dir exists and is a directory
|
282
283
|
if File.exist?( src_dir ) and File.directory?( src_dir )
|
@@ -302,7 +303,7 @@ class ClientPkgBuild
|
|
302
303
|
end
|
303
304
|
end
|
304
305
|
end
|
305
|
-
|
306
|
+
|
306
307
|
def build_indexes
|
307
308
|
indexes = []
|
308
309
|
@destination_files.each_key do | package_name |
|
@@ -310,11 +311,11 @@ class ClientPkgBuild
|
|
310
311
|
end
|
311
312
|
@jscompress.build_indexes( indexes.join("\n") ) unless @no_obfuscation
|
312
313
|
end
|
313
|
-
|
314
|
+
|
314
315
|
def pre_convert(jsc_data)
|
315
316
|
return @jscompress.compress( jsc_data )
|
316
317
|
end
|
317
|
-
|
318
|
+
|
318
319
|
def minimize_data
|
319
320
|
unless @quiet
|
320
321
|
@logger.log( '' )
|
@@ -344,7 +345,7 @@ class ClientPkgBuild
|
|
344
345
|
end
|
345
346
|
end
|
346
347
|
end
|
347
|
-
|
348
|
+
|
348
349
|
def squeeze( js, is_coffee=false )
|
349
350
|
unless @no_whitespace_removal
|
350
351
|
begin
|
@@ -392,7 +393,7 @@ class ClientPkgBuild
|
|
392
393
|
return src_out
|
393
394
|
end
|
394
395
|
end
|
395
|
-
|
396
|
+
|
396
397
|
def build_themes
|
397
398
|
time_start = Time.now.to_f
|
398
399
|
unless @quiet
|
@@ -439,7 +440,7 @@ class ClientPkgBuild
|
|
439
440
|
end
|
440
441
|
@theme_time += (Time.now.to_f - time_start)
|
441
442
|
end
|
442
|
-
|
443
|
+
|
443
444
|
def build_compound_packages
|
444
445
|
time_start = Time.now.to_f
|
445
446
|
unless @quiet
|
@@ -534,7 +535,7 @@ class ClientPkgBuild
|
|
534
535
|
@last_change = last_change
|
535
536
|
|
536
537
|
reset_structures
|
537
|
-
|
538
|
+
|
538
539
|
traverse_bundles
|
539
540
|
|
540
541
|
compose_destinations
|
@@ -545,23 +546,23 @@ class ClientPkgBuild
|
|
545
546
|
minimize_data
|
546
547
|
|
547
548
|
build_compound_packages
|
548
|
-
|
549
|
+
|
549
550
|
ms_taken = ((Time.now.to_f*10000)-time_start).round/10.0
|
550
551
|
js_taken = (@js_time*10000).round/10.0
|
551
552
|
coffee_taken = (@coffee_time*10000).round/10.0
|
552
553
|
themes_taken = (@theme_time*10000).round/10.0
|
553
554
|
other_taken = ((ms_taken - coffee_taken - js_taken - themes_taken)*10).round/10.0
|
554
555
|
@logger.log( "\nTime taken:\n js: #{js_taken}ms\n coffee: #{coffee_taken}ms\n themes: #{themes_taken}ms\n other: #{other_taken}ms\n total: #{ms_taken}ms\n\n" )
|
555
|
-
|
556
|
+
|
556
557
|
end
|
557
|
-
|
558
|
+
|
558
559
|
def setup_dirs
|
559
560
|
# make sure the src_dirs contain only absolute paths.
|
560
561
|
# if not, use current working dir as a logical prefix
|
561
562
|
@src_dirs.map! do |src_dir|
|
562
563
|
File.expand_path( src_dir )
|
563
564
|
end
|
564
|
-
|
565
|
+
|
565
566
|
@src_dirs.each do |src_dir|
|
566
567
|
# exit with error if the src dir does not exist
|
567
568
|
unless File.exist?( src_dir )
|
@@ -569,14 +570,14 @@ class ClientPkgBuild
|
|
569
570
|
@logger.log( "abort." )
|
570
571
|
return false
|
571
572
|
end
|
572
|
-
|
573
|
+
|
573
574
|
end
|
574
|
-
|
575
|
+
|
575
576
|
@package_names.each do |package_name|
|
576
577
|
@js[package_name] = ''
|
577
578
|
@gz[package_name] = ''
|
578
579
|
end
|
579
|
-
|
580
|
+
|
580
581
|
# ensures the destination directories of various theme parts exist
|
581
582
|
@theme_names.each do |theme_name|
|
582
583
|
@themes[theme_name] = {
|
@@ -585,11 +586,11 @@ class ClientPkgBuild
|
|
585
586
|
:gfx => {}
|
586
587
|
}
|
587
588
|
end
|
588
|
-
|
589
|
+
|
589
590
|
return true
|
590
|
-
|
591
|
+
|
591
592
|
end
|
592
|
-
|
593
|
+
|
593
594
|
def add_src_dir( src_dir )
|
594
595
|
@src_dirs.push( src_dir ) unless @src_dirs.include? src_dir
|
595
596
|
end
|
@@ -602,7 +603,7 @@ class ClientPkgBuild
|
|
602
603
|
def del_src_dirs( src_dirs )
|
603
604
|
src_dirs.each { |src_dir| del_src_dir( src_dir ) }
|
604
605
|
end
|
605
|
-
|
606
|
+
|
606
607
|
def add_theme( theme_name )
|
607
608
|
@theme_names.push( theme_name ) unless @theme_names.include? theme_name
|
608
609
|
end
|
@@ -615,7 +616,7 @@ class ClientPkgBuild
|
|
615
616
|
def del_themes( theme_names )
|
616
617
|
theme_names.each { |theme_name| del_theme( theme_name ) }
|
617
618
|
end
|
618
|
-
|
619
|
+
|
619
620
|
def add_package( pkg_name, pkg_items )
|
620
621
|
if @packages.has_key?( pkg_name )
|
621
622
|
warn "Package #{pkg_name} already exists, ignoring."
|
@@ -638,7 +639,7 @@ class ClientPkgBuild
|
|
638
639
|
def del_packages( packages )
|
639
640
|
packages.each { |pkg_name| del_package( pkg_name ) }
|
640
641
|
end
|
641
|
-
|
642
|
+
|
642
643
|
def add_compound( compound_name, pkg_names )
|
643
644
|
if @compounds.has_key?( compound_name )
|
644
645
|
warn "Compound #{compound_name} already exists, ignoring."
|
@@ -672,7 +673,7 @@ class ClientPkgBuild
|
|
672
673
|
def del_reserved_names( reserved_names )
|
673
674
|
reserved_names.each { |n| del_reserved_name( n ) }
|
674
675
|
end
|
675
|
-
|
676
|
+
|
676
677
|
def add_gfx_format( gfx_format )
|
677
678
|
@gfx_formats.push( gfx_format ) unless @gfx_formats.include? gfx_format
|
678
679
|
end
|
@@ -685,13 +686,13 @@ class ClientPkgBuild
|
|
685
686
|
def del_gfx_formats( gfx_formats )
|
686
687
|
gfx_formats.each { |gfx_format| del_gfx_format( gfx_format ) }
|
687
688
|
end
|
688
|
-
|
689
|
-
#delete: @js_dst_dir, @themes_dst_dir,
|
690
|
-
|
689
|
+
|
690
|
+
#delete: @js_dst_dir, @themes_dst_dir,
|
691
|
+
|
691
692
|
attr_reader :js, :gz, :themes, :jsmin, :jscompress
|
692
|
-
|
693
|
+
|
693
694
|
def initialize( config, logger )
|
694
|
-
|
695
|
+
|
695
696
|
@coffee_supported = config[:coffee_supported]
|
696
697
|
@src_cache = {
|
697
698
|
:path_timestamp => {},
|
@@ -702,41 +703,41 @@ class ClientPkgBuild
|
|
702
703
|
}
|
703
704
|
|
704
705
|
@logger = logger
|
705
|
-
|
706
|
+
|
706
707
|
# src_dirs is supposed to be an array of js source directories
|
707
708
|
@src_dirs = config[:src_dirs]
|
708
|
-
|
709
|
+
|
709
710
|
@js = {}
|
710
711
|
@gz = {}
|
711
712
|
@themes = {}
|
712
|
-
|
713
|
+
|
713
714
|
# theme_names is supposed to be an array of theme names to include in the build
|
714
715
|
@theme_names = config[:theme_names]
|
715
|
-
|
716
|
+
|
716
717
|
# pkg_info is supposed to be a hash of js package name definitions by pkg_name
|
717
718
|
@packages = config[:packages]
|
718
|
-
|
719
|
+
|
719
720
|
# packages is supposed to be a list of js package name definitions to include
|
720
721
|
@package_names = @packages.keys
|
721
|
-
|
722
|
+
|
722
723
|
# reserved_names is supposed to be a list of reserved words (words that shouldn't be compressed)
|
723
724
|
@reserved_names = config[:reserved_names]
|
724
|
-
|
725
|
-
# JSCompress compresses js by "obfuscating"
|
725
|
+
|
726
|
+
# JSCompress compresses js by "obfuscating"
|
726
727
|
# all variables beginning with an underscore "_",
|
727
728
|
# eg. "_this" -> "_0", except
|
728
729
|
# those specified in the @reserved_names array
|
729
730
|
@jscompress = JSCompress.new( config[:reserved_names] )
|
730
|
-
|
731
|
+
|
731
732
|
# HTMLMin compresses css and html by removing whitespace
|
732
733
|
@html_min = HTMLMin.new
|
733
|
-
|
734
|
+
|
734
735
|
# JSMin removes js white-space (makes the source shorter)
|
735
736
|
@jsmin = JSMin.new
|
736
|
-
|
737
|
+
|
737
738
|
# makes sure the specified dirs are ok
|
738
739
|
return if not setup_dirs
|
739
|
-
|
740
|
+
|
740
741
|
begin
|
741
742
|
require 'rubygems'
|
742
743
|
require 'cssmin'
|
@@ -745,10 +746,10 @@ class ClientPkgBuild
|
|
745
746
|
warn "cssmin not installed. install cssmin (gem install cssmin) to improve the css minifiying."
|
746
747
|
@css_min = false
|
747
748
|
end
|
748
|
-
|
749
|
+
|
749
750
|
# contains a list of theme gfx extensions allowed
|
750
751
|
@gfx_formats = config[:gfx_formats]
|
751
|
-
|
752
|
+
|
752
753
|
# compression strategy ( fastest vs smallest )
|
753
754
|
@gz_strategy = config[:gz_strategy]
|
754
755
|
@no_gzip = config[:no_gzip]
|
@@ -758,7 +759,7 @@ class ClientPkgBuild
|
|
758
759
|
@quiet = (not RSence.args[:verbose] and RSence.args[:suppress_build_messages])
|
759
760
|
@compounds = config[:compound_packages]
|
760
761
|
end
|
761
|
-
|
762
|
+
|
762
763
|
def find_newer( src_dir, newer_than, quiet=false )
|
763
764
|
if File.exist?( src_dir ) and File.directory?( src_dir )
|
764
765
|
Dir.entries( src_dir ).each do | dir_entry |
|
@@ -776,7 +777,7 @@ class ClientPkgBuild
|
|
776
777
|
end
|
777
778
|
return false
|
778
779
|
end
|
779
|
-
|
780
|
+
|
780
781
|
def bundle_changes( newer_than )
|
781
782
|
@bundles_found.each do | bundle_name, bundle_info |
|
782
783
|
bundle_path = bundle_info[:path]
|
@@ -785,7 +786,7 @@ class ClientPkgBuild
|
|
785
786
|
end
|
786
787
|
return false
|
787
788
|
end
|
788
|
-
|
789
|
+
|
789
790
|
def print_stat( package_name, dst_size, jsc_size, gz_size )
|
790
791
|
# percent = 'n/a'
|
791
792
|
if dst_size > 0
|
@@ -805,7 +806,7 @@ class ClientPkgBuild
|
|
805
806
|
end
|
806
807
|
@logger.log( "#{package_name.ljust(30).gsub(' ','.')}: #{dst_size.to_s.rjust(9)} | #{jsc_size.to_s.rjust(6)} #{percent1.rjust(4)} | #{gz_size.to_s.rjust(6)} #{percent2.rjust(4)}" )
|
807
808
|
end
|
808
|
-
|
809
|
+
|
809
810
|
def flush
|
810
811
|
@jscompress.free_indexes
|
811
812
|
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
<html><head>
|
3
3
|
<!-- This page is served to you by RSence - http://rsence.org/ -->
|
4
4
|
<title>__DEFAULT_TITLE__</title>
|
5
|
-
<style type="text/css">body{margin:0;padding:0;background-color:#ddd;font-family:Arial,sans-serif;}</style>
|
5
|
+
<style type="text/css">body{margin:0;padding:0;background-color:#ddd;font-family: Helvetica, Arial, sans-serif;}</style>
|
6
6
|
__SCRIPT_DEPS__
|
7
7
|
<script>function RSenceInit(){RSence.serverConf('__CLIENT_BASE__','__CLIENT_HELLO__');}</script></head>
|
8
8
|
<body id="body"><noscript>__NOSCRIPT__</noscript>__BODY__</body></html>
|
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.6
|
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-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rsence-deps
|
@@ -135,14 +135,14 @@ files:
|
|
135
135
|
- client/js/comm/transporter/transporter.js
|
136
136
|
- client/js/comm/urlresponder/urlresponder.js
|
137
137
|
- client/js/comm/values/values.js
|
138
|
-
- client/js/controls/button/button.
|
138
|
+
- client/js/controls/button/button.coffee
|
139
139
|
- client/js/controls/button/themes/default/button.css
|
140
140
|
- client/js/controls/button/themes/default/button.html
|
141
|
-
- client/js/controls/button/themes/default/button_parts1.png
|
142
141
|
- client/js/controls/checkbox/checkbox.js
|
143
142
|
- client/js/controls/checkbox/themes/default/checkbox.css
|
144
143
|
- client/js/controls/checkbox/themes/default/checkbox.html
|
145
144
|
- client/js/controls/checkbox/themes/default/checkbox_parts1.png
|
145
|
+
- client/js/controls/clickbutton/clickbutton.coffee
|
146
146
|
- client/js/controls/dialogs/alert_sheet/alert_sheet.js
|
147
147
|
- client/js/controls/dialogs/confirm_sheet/confirm_sheet.js
|
148
148
|
- client/js/controls/dialogs/sheet/sheet.js
|
@@ -270,7 +270,6 @@ files:
|
|
270
270
|
- client/js/foundation/system/system.js
|
271
271
|
- client/js/foundation/thememanager/thememanager.coffee
|
272
272
|
- client/js/foundation/value/value.js
|
273
|
-
- client/js/foundation/view/markupview/markupview.js
|
274
273
|
- client/js/foundation/view/morphanimation/morphanimation.js
|
275
274
|
- client/js/foundation/view/view.js
|
276
275
|
- client/js/foundation/view/viewdefaults/viewdefaults.js
|
@@ -1,78 +0,0 @@
|
|
1
|
-
|
2
|
-
/*** = Description
|
3
|
-
** Simple button component, designed to be extended for any
|
4
|
-
** actual functionality above regular HControl.
|
5
|
-
** It's limited to 24px height by the default theme, because
|
6
|
-
** it's much simpler to render that way.
|
7
|
-
***/
|
8
|
-
var//RSence.Controls
|
9
|
-
HButton = HControl.extend({
|
10
|
-
|
11
|
-
componentName: 'button',
|
12
|
-
|
13
|
-
/** = Description
|
14
|
-
* setStyle function for button.
|
15
|
-
*
|
16
|
-
**/
|
17
|
-
setStyle: function(_name, _value){
|
18
|
-
ELEM.setStyle(this.markupElemIds.label,_name,_value);
|
19
|
-
return this;
|
20
|
-
}
|
21
|
-
|
22
|
-
});
|
23
|
-
|
24
|
-
|
25
|
-
/*** = Description
|
26
|
-
** Simple HButton extension, operates on its value so it's useful
|
27
|
-
** for sending button clicks to the server and the like.
|
28
|
-
** For the value responder, reset the value to 0 when read to make
|
29
|
-
** the button clickable again.
|
30
|
-
**
|
31
|
-
** = Value states
|
32
|
-
** +0+:: Enabled, clickable
|
33
|
-
** +1+:: Disabled, clicked
|
34
|
-
** +Other+:: Disabled, not clickable, not clicked
|
35
|
-
***/
|
36
|
-
var//RSence.Controls
|
37
|
-
HClickButton = HButton.extend({
|
38
|
-
|
39
|
-
defaultEvents: {
|
40
|
-
click: true
|
41
|
-
},
|
42
|
-
|
43
|
-
controlDefaults: HControlDefaults.extend({
|
44
|
-
clickOnValue: 1,
|
45
|
-
clickOffValue: 0
|
46
|
-
}),
|
47
|
-
|
48
|
-
/** = Description
|
49
|
-
* Sets the button enabled if this.value is 0.
|
50
|
-
*
|
51
|
-
**/
|
52
|
-
refreshValue: function(){
|
53
|
-
if( this.options.inverseValue ){
|
54
|
-
this.setEnabled( this.value === this.options.clickOnValue );
|
55
|
-
}
|
56
|
-
else {
|
57
|
-
this.setEnabled( this.value === this.options.clickOffValue );
|
58
|
-
}
|
59
|
-
},
|
60
|
-
/** = Description
|
61
|
-
* Click method, sets the value to disabled if the button is enabled.
|
62
|
-
*
|
63
|
-
**/
|
64
|
-
click: function(){
|
65
|
-
if(this.enabled){
|
66
|
-
if( this.options.inverseValue ){
|
67
|
-
this.setValue( this.options.clickOffValue );
|
68
|
-
}
|
69
|
-
else {
|
70
|
-
this.setValue( this.options.clickOnValue );
|
71
|
-
}
|
72
|
-
}
|
73
|
-
}
|
74
|
-
|
75
|
-
});
|
76
|
-
|
77
|
-
var//RSence.Controls
|
78
|
-
HClickValueButton = HClickButton;
|
Binary file
|
@@ -1,95 +0,0 @@
|
|
1
|
-
|
2
|
-
/*** = Description
|
3
|
-
** Serves as a mixin class for classes that need to draw markup but don't
|
4
|
-
** inherit from the HView.
|
5
|
-
**
|
6
|
-
** = Instance variables
|
7
|
-
** +markup+:: The markup from the component's HTML template.
|
8
|
-
***/
|
9
|
-
var//RSence.Foundation
|
10
|
-
HMarkupView = HClass.extend({
|
11
|
-
|
12
|
-
/** = Description
|
13
|
-
* Evaluates the pieces of code defined in the markup template marked with
|
14
|
-
* syntax #{}.
|
15
|
-
* Can't use } characters in the code though.
|
16
|
-
* --
|
17
|
-
* This might need another look...
|
18
|
-
* ++
|
19
|
-
* Places the resulting markup in the instance variable.
|
20
|
-
*
|
21
|
-
**/
|
22
|
-
// bindMarkupVariables: function() {
|
23
|
-
// var
|
24
|
-
// _this = this,
|
25
|
-
// _ID = _this.elemId.toString(),
|
26
|
-
// _rect = _this.rect,
|
27
|
-
// _WIDTH = _rect.width,
|
28
|
-
// _HEIGHT = _rect.height,
|
29
|
-
// _markup = _this.markup,
|
30
|
-
// _fns = _this.markupFns,
|
31
|
-
// _callValue = function(_id,_isAssign){
|
32
|
-
// console.log('callValue',_id);
|
33
|
-
// var _preId = _id;
|
34
|
-
// _id = parseInt(_id,36)-10;
|
35
|
-
// console.log('id:',_id,'->',_preId);
|
36
|
-
// try{
|
37
|
-
// var
|
38
|
-
// _out = _fns[_id].call(_this);
|
39
|
-
// if(_isAssign){
|
40
|
-
// return '';
|
41
|
-
// }
|
42
|
-
// else {
|
43
|
-
// return _out;
|
44
|
-
// }
|
45
|
-
// }
|
46
|
-
// catch(e){
|
47
|
-
// console.log('Markup Error: ',e);
|
48
|
-
// return '';
|
49
|
-
// }
|
50
|
-
// };
|
51
|
-
|
52
|
-
// while ( HMarkupView._assignment_match.test(_markup) ) {
|
53
|
-
// _markup = _markup.replace( HMarkupView._assignment_match, _callValue(RegExp.$1, false) );
|
54
|
-
// }
|
55
|
-
// while ( HMarkupView._variable_match.test(_markup) ) {
|
56
|
-
// _markup = _markup.replace( HMarkupView._variable_match, _callValue(RegExp.$1) );
|
57
|
-
// }
|
58
|
-
|
59
|
-
// this.markup = _markup;
|
60
|
-
|
61
|
-
// return this;
|
62
|
-
// },
|
63
|
-
|
64
|
-
/** = Description
|
65
|
-
* Sets or unsets the _cssClass into a DOM element that goes by the ID
|
66
|
-
* _elementId.
|
67
|
-
*
|
68
|
-
* = Parameters
|
69
|
-
* +_elementId+:: ID of the DOM element, or the element itself, to be
|
70
|
-
* modified.
|
71
|
-
* +_cssClass+:: Name of the CSS class to be added or removed.
|
72
|
-
* +_setOn+:: Boolean value that tells should the CSS class be added or
|
73
|
-
* removed.
|
74
|
-
*
|
75
|
-
* = Returns
|
76
|
-
* +self+
|
77
|
-
*
|
78
|
-
**/
|
79
|
-
toggleCSSClass: function(_elementId, _cssClass, _setOn) {
|
80
|
-
if(_elementId) {
|
81
|
-
if (_setOn) {
|
82
|
-
ELEM.addClassName(_elementId, _cssClass);
|
83
|
-
}
|
84
|
-
else {
|
85
|
-
ELEM.delClassName(_elementId, _cssClass);
|
86
|
-
}
|
87
|
-
}
|
88
|
-
return this;
|
89
|
-
}
|
90
|
-
|
91
|
-
// },{
|
92
|
-
// _variable_match: new RegExp(/#\{([^\}]*)\}/),
|
93
|
-
// _assignment_match: new RegExp(/\$\{([^\}]*)\}/)
|
94
|
-
});
|
95
|
-
|