81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
|
# File 'lib/htmlgrid/dojotoolkit.rb', line 81
def (context)
= super
encoding = self.class::DOJO_ENCODING
encoding ||= Encoding.default_external
dojo_path = @lookandfeel.resource_global(:dojo_js)
dojo_path ||= '/resources/dojo/dojo/dojo.js'
args = { 'type' => 'text/javascript'}
packages = ""
unless(self.class::DOJO_PREFIX.empty?)
packages = self.class::DOJO_PREFIX.collect { |prefix, path|
"{ name: '#{prefix}', location: '#{path}' }"
}.join(",")
end
puts "dynamic_html_headers with pkgs: #{packages}"
config =config = [
"has: {
'dojo-debug-messages': true
}",
].join(',')
<< %(<script>
var dojoConfig = {
parseOnLoad: true,
isDebug: true,
async: true,
urchin: '',
};
</script>)
<< context.script(args)
{ 'text/css' => File.join(File.dirname(dojo_path), "/resources/dojo.css"),
'text/javascript' => dojo_path,
}.each do |type, path|
if (content = get_inline(path))
<< context.style(:type =>type) { content }
else
<< context.style(:type =>type, :src => path) { "@import \"#{path}\";" }
end
end
end
|