• R/O
  • SSH
  • HTTPS

tenarai: 提交


Commit MetaInfo

修訂125 (tree)
時間2008-10-28 21:35:02
作者junkikuchi

Log Message

updated.

Change Summary

差異

--- trunk/webapp/Widget/YUI.rb (revision 124)
+++ trunk/webapp/Widget/YUI.rb (revision 125)
@@ -12,13 +12,37 @@
1212
1313 property :src, YUI_BASE_DIR + '/yuiloader/yuiloader-min.js'
1414
15+ attr_reader :modules
16+
17+ def initialize(table, row={})
18+ super
19+ @modules = []
20+ end
21+
1522 def render_html(head, body)
23+ modules = @modules.map do |val|
24+ "'#{val}'"
25+ end.join(', ')
26+
1627 head.tag(
1728 'script',
1829 'type' => 'text/javascript',
1930 'src' => property[:src]
2031 ).text('')
21- super
32+
33+ script = head.tag('script', 'type' => 'text/javascript')
34+ script.code <<-END
35+new YAHOO.util.YUILoader({
36+ require: [#{modules}],
37+ onSuccess: function() {
38+ END
39+
40+ super(head, script)
41+
42+ script.code <<-END
43+ }
44+}).insert();
45+ END
2246 end
2347 end
2448 end
Show on old repository browser