put dymanic loading related kernel code and query kernel code into public/static

put dymanic loading related kernel code and query kernel code into
public/static.
everything in JS need be loaded at frontend from ruling com should be
placed here.
This commit is contained in:
Matthew Kaito Juyuan Fu 2011-10-21 14:11:41 +08:00
parent a0f1220b63
commit 0a6efeb0a2
4 changed files with 17 additions and 11 deletions

View File

@ -33,17 +33,6 @@
<div id="footer" class="footer"> <div id="footer" class="footer">
This is the footer This is the footer
</div> </div>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script>
$.each($(".dymanic_load"),function(){
$(this).load($(this).attr("path"),
function(respText,textSta,XML){
if(textSta == 'error')
{$(this).html("Loading Failed");}
});
}
);
</script>
<!-- END example --> <!-- END example -->
</body> </body>

View File

@ -76,6 +76,8 @@ module Parser
page.design.javascripts.each do |js| page.design.javascripts.each do |js|
res << "<script type='text/javascript' src='#{js.file.url}'></script>" res << "<script type='text/javascript' src='#{js.file.url}'></script>"
end end
res << "<script type='text/javascript' src='/static/jquery.js'></script>"
res << "<script type='text/javascript' src='/static/kernel.js'></script>"
res res
end end
c.define_tag 'image' do |tag| c.define_tag 'image' do |tag|
@ -188,6 +190,7 @@ module Parser
page.design.javascripts.each do |js| page.design.javascripts.each do |js|
res << "<script type='text/javascript' src='#{js.file.url}'></script>" res << "<script type='text/javascript' src='#{js.file.url}'></script>"
end end
res res
end end
c.define_tag 'layout_part' do |tag| c.define_tag 'layout_part' do |tag|

4
public/static/jquery.js vendored Normal file

File diff suppressed because one or more lines are too long

10
public/static/kernel.js Normal file
View File

@ -0,0 +1,10 @@
$(document).ready(function() {
$.each($(".dymanic_load"),function(){
$(this).load($(this).attr("path"),
function(respText,textSta,XML){
if(textSta == 'error')
{$(this).html("Loading Failed");}
});
}
);
});