Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #63 from danshearmur/javascript-changes

Javascript changes
  • Loading branch information...
commit 294263ae5fb50d84d4f05606b677345e62a3b83a 2 parents 79a9f4b + 5a4126a
@antirez antirez authored
Showing with 18 additions and 18 deletions.
  1. +15 −15 app.rb
  2. +2 −2 page.rb
  3. +1 −1  public/js/app.js
View
30 app.rb
@@ -86,8 +86,8 @@
}
}+
H.div(:id => "errormsg"){}+
- H.script(:type=>"text/javascript") {'
- $(document).ready(function() {
+ H.script() {'
+ $(function() {
$("input[name=do_login]").click(login);
});
'}
@@ -114,8 +114,8 @@
}
}+
H.div(:id => "errormsg"){}+
- H.script(:type=>"text/javascript") {'
- $(document).ready(function() {
+ H.script() {'
+ $(function() {
$("input[name=do_submit]").click(submit);
});
'}
@@ -161,8 +161,8 @@
H.br
end +
render_comments_for_news(news["id"])+
- H.script(:type=>"text/javascript") {'
- $(document).ready(function() {
+ H.script() {'
+ $(function() {
$("input[name=post_comment]").click(post_comment);
});
'}
@@ -189,8 +189,8 @@
H.textarea(:name => "comment", :cols => 60, :rows => 10) {}+H.br+
H.button(:name => "post_comment", :value => "Reply")
}+H.div(:id => "errormsg"){}+
- H.script(:type=>"text/javascript") {'
- $(document).ready(function() {
+ H.script() {'
+ $(function() {
$("input[name=post_comment]").click(post_comment);
});
'}
@@ -223,8 +223,8 @@
H.note {
"Note: to remove the comment remove all the text and press Edit."
}+
- H.script(:type=>"text/javascript") {'
- $(document).ready(function() {
+ H.script() {'
+ $(function() {
$("input[name=post_comment]").click(post_comment);
});
'}
@@ -267,8 +267,8 @@
H.note {
"Note: to remove the news set an empty title."
}+
- H.script(:type=>"text/javascript") {'
- $(document).ready(function() {
+ H.script() {'
+ $(function() {
$("input[name=edit_news]").click(submit);
});
'}
@@ -317,8 +317,8 @@
H.button(:name => "update_profile", :value => "Update profile")
}+
H.div(:id => "errormsg"){}+
- H.script(:type=>"text/javascript") {'
- $(document).ready(function() {
+ H.script() {'
+ $(function() {
$("input[name=update_profile]").click(update_profile);
});
'}
@@ -549,7 +549,7 @@ def application_header
def application_footer
if $user
- apisecret = H.script("type" => "text/javascript") {
+ apisecret = H.script() {
"var apisecret = '#{$user['apisecret']}';";
}
else
View
4 page.rb
@@ -30,7 +30,7 @@
class HTMLGen
@@newlinetags = %w{html body div br ul hr title link head filedset label legend option table li select td tr meta}
@@metatags = {
- "js" => {"tag"=>"script","type"=>"text/javascript"},
+ "js" => {"tag"=>"script"},
"inputtext" => {"tag"=>"input","type"=>"text"},
"inputpass" => {"tag"=>"input","type"=>"password"},
"inputfile" => {"tag"=>"input","type"=>"file"},
@@ -131,7 +131,7 @@ def page()
:type => "text/css")+
self.link(:href => "/images/favicon.png", :rel => "shortcut icon")+
self.script(:src =>
- "http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"){}+
+ "//ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"){}+
self.script(:src => "/js/app.js"){}
}+
self.body {
View
2  public/js/app.js
@@ -102,7 +102,7 @@ function post_comment() {
}
// Install the onclick event in all news arrows the user did not voted already.
-$(document).ready(function() {
+$(function() {
$('news').each(function(i,news) {
var news_id = news.id;
var up_class = news.children[0].getAttribute("class");
Please sign in to comment.
Something went wrong with that request. Please try again.