Skip to content

Commit

Permalink
Merge pull request #63 from danshearmur/javascript-changes
Browse files Browse the repository at this point in the history
Javascript changes
  • Loading branch information
antirez committed Oct 24, 2011
2 parents 79a9f4b + 5a4126a commit 294263a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
30 changes: 15 additions & 15 deletions app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
'}
Expand All @@ -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);
});
'}
Expand Down Expand Up @@ -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);
});
'}
Expand All @@ -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);
});
'}
Expand Down Expand Up @@ -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);
});
'}
Expand Down Expand Up @@ -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);
});
'}
Expand Down Expand Up @@ -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);
});
'}
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions page.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion public/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 294263a

Please sign in to comment.