aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/generators/rails
diff options
context:
space:
mode:
authorMikel Lindsaar <raasdnil@gmail.com>2010-03-03 13:39:36 +1100
committerJeremy Kemper <jeremy@bitsweat.net>2010-03-02 18:46:14 -0800
commit6193be26ce49bc24d67eb97f2f5f49c86f9f6bb7 (patch)
tree5c10c2d7555a2c4f979a07c3423bdd23607b39d0 /railties/lib/generators/rails
parentd78e3fe73fccb90ddb25dc04f9643b83cae2b9e3 (diff)
downloadrails-6193be26ce49bc24d67eb97f2f5f49c86f9f6bb7.tar.gz
rails-6193be26ce49bc24d67eb97f2f5f49c86f9f6bb7.tar.bz2
rails-6193be26ce49bc24d67eb97f2f5f49c86f9f6bb7.zip
Removing prototype and just using vanilla js
Diffstat (limited to 'railties/lib/generators/rails')
-rw-r--r--railties/lib/generators/rails/app/templates/public/index.html34
1 files changed, 17 insertions, 17 deletions
diff --git a/railties/lib/generators/rails/app/templates/public/index.html b/railties/lib/generators/rails/app/templates/public/index.html
index ef916f9c5a..836da1b689 100644
--- a/railties/lib/generators/rails/app/templates/public/index.html
+++ b/railties/lib/generators/rails/app/templates/public/index.html
@@ -181,27 +181,27 @@
}
</style>
- <script type="text/javascript" src="javascripts/prototype.js"></script>
- <script type="text/javascript" src="javascripts/effects.js"></script>
<script type="text/javascript">
function about() {
- if (Element.empty('about-content')) {
- new Ajax.Updater('about-content', 'rails/info/properties', {
- method: 'get',
- onFailure: function() {Element.classNames('about-content').add('failure')},
- onComplete: function() {new Effect.BlindDown('about-content', {duration: 0.25})}
- });
- } else {
- new Effect[Element.visible('about-content') ?
- 'BlindUp' : 'BlindDown']('about-content', {duration: 0.25});
- }
+ info = document.getElementById('about-content');
+ if (window.XMLHttpRequest)
+ { xhr = new XMLHttpRequest(); }
+ else
+ { xhr = new ActiveXObject("Microsoft.XMLHTTP"); }
+ xhr.open("GET","rails/info/properties",false);
+ xhr.send("");
+ info.innerHTML = xhr.responseText;
+ info.style.display = 'block'
+ }
+
+ function prepend() {
+ search = document.getElementById('search-text');
+ text = search.value;
+ search.value = 'site:rubyonrails.org ' + text;
}
window.onload = function() {
- $('search-text').value = '';
- $('search').onsubmit = function() {
- $('search-text').value = 'site:rubyonrails.org ' + $F('search-text');
- }
+ document.getElementById('search-text').value = '';
}
</script>
</head>
@@ -210,7 +210,7 @@
<div id="sidebar">
<ul id="sidebar-items">
<li>
- <form id="search" action="http://www.google.com/search" method="get">
+ <form id="search" action="http://www.google.com/search" method="get" onSubmit="prepend();">
<input type="hidden" name="hl" value="en" />
<input type="text" id="search-text" name="q" value="site:rubyonrails.org " />
<input type="submit" value="Search" /> the Rails site