htmlgrid 1.0.0

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 (83) hide show
  1. data/History.txt +6 -0
  2. data/LICENCE.txt +515 -0
  3. data/Manifest.txt +82 -0
  4. data/README.txt +30 -0
  5. data/Rakefile +28 -0
  6. data/ext/htmlgrid/MANIFEST +3 -0
  7. data/ext/htmlgrid/Makefile +150 -0
  8. data/ext/htmlgrid/extconf.rb +33 -0
  9. data/ext/htmlgrid/grid.c +881 -0
  10. data/ext/htmlgrid/grid.o +0 -0
  11. data/ext/htmlgrid/htmlgrid.c +30 -0
  12. data/ext/htmlgrid/htmlgrid.o +0 -0
  13. data/ext/htmlgrid/htmlgrid.so +0 -0
  14. data/ext/htmlgrid/include/grid.h +79 -0
  15. data/ext/htmlgrid/include/htmlgrid.h +33 -0
  16. data/install.rb +1098 -0
  17. data/lib/htmlgrid/booleanvalue.rb +41 -0
  18. data/lib/htmlgrid/button.rb +36 -0
  19. data/lib/htmlgrid/centeredcomposite.rb +47 -0
  20. data/lib/htmlgrid/component.rb +232 -0
  21. data/lib/htmlgrid/composite.rb +350 -0
  22. data/lib/htmlgrid/datevalue.rb +39 -0
  23. data/lib/htmlgrid/div.rb +37 -0
  24. data/lib/htmlgrid/divcomposite.rb +52 -0
  25. data/lib/htmlgrid/divform.rb +35 -0
  26. data/lib/htmlgrid/divlist.rb +26 -0
  27. data/lib/htmlgrid/divtemplate.rb +12 -0
  28. data/lib/htmlgrid/dojotoolkit.rb +173 -0
  29. data/lib/htmlgrid/errormessage.rb +70 -0
  30. data/lib/htmlgrid/form.rb +93 -0
  31. data/lib/htmlgrid/formlist.rb +42 -0
  32. data/lib/htmlgrid/grid.rb +286 -0
  33. data/lib/htmlgrid/image.rb +43 -0
  34. data/lib/htmlgrid/infomessage.rb +41 -0
  35. data/lib/htmlgrid/input.rb +59 -0
  36. data/lib/htmlgrid/inputcheckbox.rb +41 -0
  37. data/lib/htmlgrid/inputcurrency.rb +36 -0
  38. data/lib/htmlgrid/inputdate.rb +38 -0
  39. data/lib/htmlgrid/inputfile.rb +40 -0
  40. data/lib/htmlgrid/inputradio.rb +37 -0
  41. data/lib/htmlgrid/inputtext.rb +37 -0
  42. data/lib/htmlgrid/javascript.rb +22 -0
  43. data/lib/htmlgrid/label.rb +90 -0
  44. data/lib/htmlgrid/labeltext.rb +35 -0
  45. data/lib/htmlgrid/link.rb +54 -0
  46. data/lib/htmlgrid/list.rb +170 -0
  47. data/lib/htmlgrid/namedcomponent.rb +52 -0
  48. data/lib/htmlgrid/pass.rb +38 -0
  49. data/lib/htmlgrid/passthru.rb +44 -0
  50. data/lib/htmlgrid/popuplink.rb +66 -0
  51. data/lib/htmlgrid/reset.rb +36 -0
  52. data/lib/htmlgrid/richtext.rb +26 -0
  53. data/lib/htmlgrid/select.rb +53 -0
  54. data/lib/htmlgrid/span.rb +37 -0
  55. data/lib/htmlgrid/spancomposite.rb +45 -0
  56. data/lib/htmlgrid/spanlist.rb +15 -0
  57. data/lib/htmlgrid/staticinput.rb +40 -0
  58. data/lib/htmlgrid/submit.rb +36 -0
  59. data/lib/htmlgrid/template.rb +130 -0
  60. data/lib/htmlgrid/text.rb +36 -0
  61. data/lib/htmlgrid/textarea.rb +49 -0
  62. data/lib/htmlgrid/ulcomposite.rb +49 -0
  63. data/lib/htmlgrid/ullist.rb +15 -0
  64. data/lib/htmlgrid/urllink.rb +65 -0
  65. data/lib/htmlgrid/value.rb +36 -0
  66. data/test/rebuild.rb +39 -0
  67. data/test/stub/cgi.rb +44 -0
  68. data/test/suite.rb +32 -0
  69. data/test/test_component.rb +138 -0
  70. data/test/test_composite.rb +201 -0
  71. data/test/test_datevalue.rb +60 -0
  72. data/test/test_form.rb +123 -0
  73. data/test/test_formlist.rb +111 -0
  74. data/test/test_grid.rb +395 -0
  75. data/test/test_input.rb +70 -0
  76. data/test/test_label.rb +116 -0
  77. data/test/test_list.rb +146 -0
  78. data/test/test_select.rb +78 -0
  79. data/test/test_template.rb +97 -0
  80. data/test/test_text.rb +63 -0
  81. data/usage-en.txt +112 -0
  82. data/widget/Tooltip.js +85 -0
  83. metadata +180 -0
data/test/test_list.rb ADDED
@@ -0,0 +1,146 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # HtmlGrid -- HyperTextMarkupLanguage Framework
4
+ # Copyright (C) 2003 ywesee - intellectual capital connected
5
+ # Andreas Schrafl, Benjamin Fay, Hannes Wyss, Markus Huggler
6
+ #
7
+ # This library is free software; you can redistribute it and/or
8
+ # modify it under the terms of the GNU Lesser General Public
9
+ # License as published by the Free Software Foundation; either
10
+ # version 2.1 of the License, or (at your option) any later version.
11
+ #
12
+ # This library is distributed in the hope that it will be useful,
13
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
+ # Lesser General Public License for more details.
16
+ #
17
+ # You should have received a copy of the GNU Lesser General Public
18
+ # License along with this library; if not, write to the Free Software
19
+ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20
+ #
21
+ # ywesee - intellectual capital connected, Winterthurerstrasse 52, CH-8006 Zuerich, Switzerland
22
+ # htmlgrid@ywesee.com, www.ywesee.com/htmlgrid
23
+ #
24
+ # TestList -- htmlgrid -- 03.03.2003 -- hwyss@ywesee.com
25
+
26
+ $: << File.dirname(__FILE__)
27
+ $: << File.expand_path("../lib", File.dirname(__FILE__))
28
+
29
+ require 'test/unit'
30
+ require 'htmlgrid/list'
31
+ require 'stub/cgi'
32
+
33
+ module HtmlGrid
34
+ class Grid
35
+ class Row
36
+ class Field
37
+ attr_reader :attributes
38
+ end
39
+ end
40
+ end
41
+ class List < Composite
42
+ attr_reader :grid
43
+ public :lookandfeel_key
44
+ end
45
+ end
46
+ class StubListViewColumnNames < HtmlGrid::List
47
+ LOOKANDFEEL_MAP = {
48
+ :raffi => :waltert,
49
+ :andy => :schrafl,
50
+ }
51
+ COMPONENTS = {}
52
+ end
53
+ class StubList < HtmlGrid::List
54
+ attr_reader :model
55
+ COMPONENTS = {
56
+ [0,0] => :jaguar,
57
+ [1,0] => :panther,
58
+ }
59
+ CSS_MAP = {
60
+ [0,0] => 'flecken',
61
+ [1,0] => 'schwarz',
62
+ }
63
+ SORT_HEADER = false
64
+ SORT_DEFAULT = :foo
65
+ end
66
+ class StubListLookandfeel
67
+ def lookup(key)
68
+ key
69
+ end
70
+ def attributes(key)
71
+ {}
72
+ end
73
+ end
74
+ class StubListSession
75
+ attr_accessor :event
76
+ def lookandfeel
77
+ StubListLookandfeel.new
78
+ end
79
+ end
80
+ class StubListModel
81
+ attr_reader :foo
82
+ def initialize(foo)
83
+ @foo = foo
84
+ end
85
+ def jaguar
86
+ 'Jaguar'
87
+ end
88
+ def panther
89
+ 'Panther'
90
+ end
91
+ end
92
+
93
+ class TestList < Test::Unit::TestCase
94
+ def setup
95
+ model = [
96
+ StubListModel.new(3),
97
+ StubListModel.new(2),
98
+ StubListModel.new(4),
99
+ StubListModel.new(1),
100
+ ]
101
+ @list = StubList.new(model, StubListSession.new)
102
+ end
103
+ def test_compose
104
+ @list.compose
105
+ assert_equal(5, @list.grid.height)
106
+ assert_equal(2, @list.grid.width)
107
+ end
108
+ def test_default_sort
109
+ foos = @list.model.collect { |item| item.foo }
110
+ expected = [ 1,2,3,4 ]
111
+ assert_equal(expected, foos)
112
+ end
113
+ def test_header
114
+ expected = '<TABLE cellspacing="0"><TR><TH title="th_jaguar_title">th_jaguar</TH><TH title="th_panther_title">th_panther</TH>'
115
+ assert_equal(0, @list.to_html(CGI.new).index(expected))
116
+ end
117
+ def test_lookandfeel_key
118
+ list = StubListViewColumnNames.new([], StubListSession.new)
119
+ assert_equal(:waltert, list.lookandfeel_key(:raffi))
120
+ assert_equal(:hannes, list.lookandfeel_key(:hannes))
121
+ end
122
+ def test_nil_robust
123
+ assert_nothing_raised {
124
+ StubList.new(nil, StubListSession.new)
125
+ }
126
+ end
127
+ def test_suffix
128
+ @list.compose
129
+ expected = {
130
+ [0,1] => "flecken",
131
+ [1,1] => "schwarz",
132
+ [0,2] => "flecken-bg",
133
+ [1,2] => "schwarz-bg",
134
+ [0,3] => "flecken",
135
+ [1,3] => "schwarz",
136
+ [0,4] => "flecken-bg",
137
+ [1,4] => "schwarz-bg",
138
+ }
139
+ expected.each { |key, value|
140
+ assert_equal(value, @list.grid.field_attribute("class", *key))
141
+ }
142
+ end
143
+ def test_title
144
+ assert_equal('th_jaguar_title', @list.grid.field_attribute('title', 0, 0))
145
+ end
146
+ end
@@ -0,0 +1,78 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # HtmlGrid -- HyperTextMarkupLanguage Framework
4
+ # Copyright (C) 2003 ywesee - intellectual capital connected
5
+ # Andreas Schrafl, Benjamin Fay, Hannes Wyss, Markus Huggler
6
+ #
7
+ # This library is free software; you can redistribute it and/or
8
+ # modify it under the terms of the GNU Lesser General Public
9
+ # License as published by the Free Software Foundation; either
10
+ # version 2.1 of the License, or (at your option) any later version.
11
+ #
12
+ # This library is distributed in the hope that it will be useful,
13
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
+ # Lesser General Public License for more details.
16
+ #
17
+ # You should have received a copy of the GNU Lesser General Public
18
+ # License along with this library; if not, write to the Free Software
19
+ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20
+ #
21
+ # ywesee - intellectual capital connected, Winterthurerstrasse 52, CH-8006 Zuerich, Switzerland
22
+ # htmlgrid@ywesee.com, www.ywesee.com/htmlgrid
23
+ #
24
+ # TestSelect -- htmlgrid -- 10.03.2003 -- hwyss@ywesee.com
25
+
26
+ $: << File.expand_path("../lib", File.dirname(__FILE__))
27
+
28
+ require 'test/unit'
29
+ require 'htmlgrid/select'
30
+ require 'stub/cgi'
31
+
32
+ class StubSelectLookandfeel
33
+ def attributes(key)
34
+ {}
35
+ end
36
+ def lookup(key)
37
+ {
38
+ 'foofoo' => 'Foo Nr. 1',
39
+ 'foobar' => 'Foo Nr. 2',
40
+ 'barfoo' => 'Bar Nr. 1',
41
+ 'barbar' => 'Bar Nr. 2',
42
+ 'foovals' => 'FooLabel',
43
+ }.fetch(key)
44
+ end
45
+ end
46
+ class StubSelectSession
47
+ def valid_values(key)
48
+ [ 'foofoo', 'foobar', 'barfoo', 'barbar' ]
49
+ end
50
+ def lookandfeel
51
+ StubSelectLookandfeel.new
52
+ end
53
+ end
54
+ class StubSelectData
55
+ def foovals
56
+ 'foobar'
57
+ end
58
+ end
59
+
60
+ class TestSelect < Test::Unit::TestCase
61
+ def setup
62
+ @component = HtmlGrid::Select.new(:foovals, StubSelectData.new,
63
+ StubSelectSession.new)
64
+ end
65
+ def test_to_html
66
+ expected = []
67
+ expected << '<SELECT name="foovals">'
68
+ expected << '<OPTION value="foofoo">Foo Nr. 1</OPTION>'
69
+ expected << '<OPTION selected value="foobar">Foo Nr. 2</OPTION>'
70
+ expected << '<OPTION value="barfoo">Bar Nr. 1</OPTION>'
71
+ expected << '<OPTION value="barbar">Bar Nr. 2</OPTION>'
72
+ expected << '</SELECT>'
73
+ result = @component.to_html(CGI.new).to_s
74
+ expected.each { |line|
75
+ assert(result.index(line), "Missing line:\n#{line}\nin:\n#{result}")
76
+ }
77
+ end
78
+ end
@@ -0,0 +1,97 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # HtmlGrid -- HyperTextMarkupLanguage Framework
4
+ # Copyright (C) 2003 ywesee - intellectual capital connected
5
+ # Andreas Schrafl, Benjamin Fay, Hannes Wyss, Markus Huggler
6
+ #
7
+ # This library is free software; you can redistribute it and/or
8
+ # modify it under the terms of the GNU Lesser General Public
9
+ # License as published by the Free Software Foundation; either
10
+ # version 2.1 of the License, or (at your option) any later version.
11
+ #
12
+ # This library is distributed in the hope that it will be useful,
13
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
+ # Lesser General Public License for more details.
16
+ #
17
+ # You should have received a copy of the GNU Lesser General Public
18
+ # License along with this library; if not, write to the Free Software
19
+ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20
+ #
21
+ # ywesee - intellectual capital connected, Winterthurerstrasse 52, CH-8006 Zuerich, Switzerland
22
+ # htmlgrid@ywesee.com, downloads.ywesee.com/ruby/htmlgrid
23
+ #
24
+ # TestTemplate -- htmlgrid -- 19.11.2002 -- hwyss@ywesee.com
25
+
26
+ $: << File.expand_path("../lib", File.dirname(__FILE__))
27
+ $: << File.dirname(__FILE__)
28
+
29
+ require 'test/unit'
30
+ require 'stub/cgi'
31
+ require 'sbsm/lookandfeel'
32
+ require 'htmlgrid/template'
33
+
34
+ class StubTemplateSession
35
+ def flavor
36
+ "gcc"
37
+ end
38
+ def language
39
+ "de"
40
+ end
41
+ def http_protocol
42
+ 'http'
43
+ end
44
+ def server_name
45
+ "testserver.com"
46
+ end
47
+ alias :default_language :language
48
+ end
49
+ class StubTemplateLookandfeel < SBSM::Lookandfeel
50
+ RESOURCES = {
51
+ :css => "test.css"
52
+ }
53
+ DICTIONARIES = {
54
+ "de" => {
55
+ :html_title => "Test",
56
+ }
57
+ }
58
+ def lookandfeel
59
+ self
60
+ end
61
+ end
62
+ class Template < HtmlGrid::Template
63
+ META_TAGS = [
64
+ {
65
+ "http-equiv" => "robots",
66
+ "content" => "follow, index",
67
+ },
68
+ ]
69
+ COMPONENTS = {
70
+ [0,0] => :foo,
71
+ }
72
+ LEGACY_INTERFACE = false
73
+ def foo(model)
74
+ 'foo'
75
+ end
76
+ end
77
+
78
+ class TestTemplate < Test::Unit::TestCase
79
+ def setup
80
+ lookandfeel = StubTemplateLookandfeel.new(StubTemplateSession.new)
81
+ @template = Template.new(nil, lookandfeel, nil)
82
+ end
83
+ def test_to_html
84
+ result = ""
85
+ assert_nothing_raised {
86
+ result << @template.to_html(CGI.new)
87
+ }
88
+ expected = [
89
+ '<TITLE>Test</TITLE>',
90
+ '<LINK href="http://testserver.com/resources/gcc/test.css" rel="stylesheet" type="text/css">',
91
+ '<META content="follow, index" http-equiv="robots">',
92
+ ]
93
+ expected.each { |line|
94
+ assert(result.index(line), "Missing: #{line}")
95
+ }
96
+ end
97
+ end
data/test/test_text.rb ADDED
@@ -0,0 +1,63 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # HtmlGrid -- HyperTextMarkupLanguage Framework
4
+ # Copyright (C) 2003 ywesee - intellectual capital connected
5
+ # Andreas Schrafl, Benjamin Fay, Hannes Wyss, Markus Huggler
6
+ #
7
+ # This library is free software; you can redistribute it and/or
8
+ # modify it under the terms of the GNU Lesser General Public
9
+ # License as published by the Free Software Foundation; either
10
+ # version 2.1 of the License, or (at your option) any later version.
11
+ #
12
+ # This library is distributed in the hope that it will be useful,
13
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
+ # Lesser General Public License for more details.
16
+ #
17
+ # You should have received a copy of the GNU Lesser General Public
18
+ # License along with this library; if not, write to the Free Software
19
+ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20
+ #
21
+ # ywesee - intellectual capital connected, Winterthurerstrasse 52, CH-8006 Zuerich, Switzerland
22
+ # htmlgrid@ywesee.com, www.ywesee.com/htmlgrid
23
+ #
24
+ # TextText -- htmlgrid -- 20.11.2002 -- hwyss@ywesee.com
25
+
26
+ $: << File.expand_path("../lib", File.dirname(__FILE__))
27
+
28
+ require 'test/unit'
29
+ require 'htmlgrid/text'
30
+
31
+ class StubTextLookandfeel
32
+ def lookup(key)
33
+ {
34
+ :foo => "Foo Text!",
35
+ :navigation_divider => "&nbsp;|&nbsp;",
36
+ }[key]
37
+ end
38
+ def attributes(key)
39
+ {"foo" => "bar"} if key==:foo
40
+ end
41
+ def lookandfeel
42
+ self
43
+ end
44
+ end
45
+
46
+ class TestText < Test::Unit::TestCase
47
+ def setup
48
+ @view = HtmlGrid::Text.new(:foo, nil, StubTextLookandfeel.new)
49
+ end
50
+ def test_respond_to_attributes
51
+ assert_respond_to(@view, :attributes)
52
+ end
53
+ def test_to_html
54
+ assert_equal("Foo Text!", @view.to_html(nil))
55
+ end
56
+ def test_init
57
+ expected = {
58
+ "foo" => "bar",
59
+ "name" => "foo",
60
+ }
61
+ assert_equal(expected, @view.attributes)
62
+ end
63
+ end
data/usage-en.txt ADDED
@@ -0,0 +1,112 @@
1
+ Installing Programs with install.rb / setup.rb
2
+ ==============================================
3
+
4
+ Overview
5
+ --------
6
+
7
+ Type these lines on command line:
8
+ ("#" line may require root privilege)
9
+
10
+ $ ruby install.rb config
11
+ $ ruby install.rb setup
12
+ # ruby install.rb install
13
+
14
+
15
+ There's no difference in a usage between install.rb
16
+ and setup.rb.
17
+
18
+ $ ruby setup.rb config
19
+ $ ruby setup.rb setup
20
+ # ruby setup.rb install
21
+
22
+
23
+ Details
24
+ -------
25
+
26
+ Usage of install.rb/setup.rb is:
27
+
28
+ ruby install.rb <global options>
29
+ ruby install.rb [<global options>] <task> [<task options>]
30
+
31
+
32
+ -q,--quiet
33
+ suppress message outputs
34
+ --verbose
35
+ output messages verbosely (default)
36
+ -h,--help
37
+ prints help and quit
38
+ -v,--version
39
+ prints version and quit
40
+ --copyright
41
+ prints copyright and quit
42
+
43
+ These are acceptable tasks:
44
+ config
45
+ saves configurations
46
+ show
47
+ prints current configurations
48
+ setup
49
+ compiles extentions
50
+ install
51
+ installs files
52
+ clean
53
+ cleans created files
54
+
55
+ Task Options for Config
56
+ -----------------------
57
+
58
+ --prefix=PATH
59
+ a prefix of the installing directory path
60
+ --std-ruby=PATH
61
+ the directory for standard ruby libraries
62
+ --site-ruby-common=PATH
63
+ the directory for version-independent non-standard
64
+ ruby libraries
65
+ --site-ruby=PATH
66
+ the directory for non-standard ruby libraries
67
+ --bin-dir=PATH
68
+ the directory for commands
69
+ --rb-dir=PATH
70
+ the directory for ruby scripts
71
+ --so-dir=PATH
72
+ the directory for ruby extentions
73
+ --data-dir=PATH
74
+ the directory for shared data
75
+ --ruby-path=PATH
76
+ path to set to #! line
77
+ --ruby-prog=PATH
78
+ the ruby program using for installation
79
+ --make-prog=NAME
80
+ the make program to compile ruby extentions
81
+ --without-ext
82
+ forces to install.rb never to compile/install
83
+ ruby extentions.
84
+ --rbconfig=PATH
85
+ your rbconfig.rb to load
86
+
87
+ You can view default values of these options by typing
88
+
89
+ $ ruby install.rb --help
90
+
91
+
92
+ In addition, setup.rb accepts these options:
93
+ --with=NAME,NAME,NAME...
94
+ package names which you want to install
95
+ --without=NAME,NAME,NAME...
96
+ package names which you do not want to install
97
+
98
+ [NOTE] You can pass options for extconf.rb like this:
99
+
100
+ ruby install.rb config -- --with-tklib=/usr/lib/libtk-ja.so.8.0
101
+
102
+
103
+ Task Options for Install
104
+ ------------------------
105
+
106
+ --no-harm
107
+ prints what to do and done nothing really.
108
+ --prefix=PATH
109
+ a prefix of the installing directory path.
110
+ This option may help binary package maintainers.
111
+ A default value is an empty string.
112
+
data/widget/Tooltip.js ADDED
@@ -0,0 +1,85 @@
1
+ dojo.provide("ywesee.widget.Tooltip");
2
+
3
+ dojo.require("dijit.Tooltip");
4
+ dojo.require("dijit.layout.ContentPane");
5
+
6
+ dojo.declare(
7
+ "ywesee.widget.Tooltip",
8
+ [dijit.Tooltip],
9
+ {
10
+ href: null,
11
+ contentPane: null,
12
+ _contentNode: null,
13
+ _hoverContent: false,
14
+ _handle1: null,
15
+ _handle2: null,
16
+ _handle3: null,
17
+ _handle4: null,
18
+ _hideTimer: null,
19
+
20
+ open: function(){
21
+ //if(this.isShowingNow) { return; }
22
+
23
+ if(!dijit._masterTT){
24
+ dijit._masterTT=new dijit._MasterTooltip();
25
+ }
26
+
27
+ this._contentNode = dijit._masterTT.domNode;
28
+ if(this.href && (!this.contentPane)) {
29
+ this.domNode = document.createElement("div");
30
+ this.contentPane = new dijit.layout.ContentPane({href:this.href}, this.domNode);
31
+ this.connect(this.contentPane, 'onLoad', 'onLoad');
32
+ this.contentPane.startup();
33
+ }
34
+ this._handle1 = dojo.connect(this._contentNode, 'onmouseover', this, 'onHoverContent');
35
+ this._handle2 = dojo.connect(this._contentNode, 'onhover', this, 'onHoverContent');
36
+ this._handle3 = dojo.connect(this._contentNode, 'onmouseout', this, 'onUnHoverContent');
37
+ this._handle4 = dojo.connect(this._contentNode, 'onunhover', this, 'onUnHoverContent');
38
+ this.inherited("open", arguments);
39
+ },
40
+
41
+ close: function(){
42
+ dojo.disconnect(this._handle1);
43
+ dojo.disconnect(this._handle2);
44
+ dojo.disconnect(this._handle3);
45
+ dojo.disconnect(this._handle4);
46
+ this.inherited("close", arguments);
47
+ },
48
+
49
+ onLoad: function(){
50
+ //if(this.isShowingNow){
51
+ this.close();
52
+ this.open();
53
+ //}
54
+ },
55
+
56
+ onHoverContent: function(/*Event*/ e){
57
+ this._hoverContent = true;
58
+ },
59
+
60
+ onUnHoverContent: function(/*Event*/ e){
61
+ if(dojo.isDescendant(e.relatedTarget, this._contentNode)){
62
+ // false event; just moved from target to target child; ignore.
63
+ return;
64
+ }
65
+ this._hoverContent = false;
66
+ this._onUnHover(e);
67
+ },
68
+
69
+ _onUnHover: function(/*Event*/ e){
70
+ if(this._hoverContent) { return; }
71
+ this._hideTimer = setTimeout(dojo.hitch(this, "_deferredOnUnHover", arguments), 100);
72
+ },
73
+
74
+ _deferredOnUnHover: function(/*Event*/ e){
75
+ if(this._hoverContent) { return; }
76
+
77
+ if(this._showTimer){
78
+ clearTimeout(this._showTimer);
79
+ delete this._showTimer;
80
+ }else{
81
+ this.close();
82
+ }
83
+ }
84
+ }
85
+ );