Skip to content

Commit

Permalink
[CHEF-1956] Upgrade jQuery from 1.3.2 to 1.5.1. Replace livequery plu…
Browse files Browse the repository at this point in the history
…gin with delegate.
  • Loading branch information
akzhan authored and btm committed Jul 19, 2011
1 parent 08df3e5 commit 2b9b1a7
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 450 deletions.
2 changes: 1 addition & 1 deletion chef-server-webui/app/views/layout/application.html.haml
Expand Up @@ -4,7 +4,7 @@
%meta{ "http-equiv" => "content-type", :content => "text/html; charset=utf-8" }
%title Chef Server
= css_include_tag "base", "themes/djime-cerulean/style", "chef", "/facebox/facebox.css", "jquery-ui-1.7.1.custom", "jquery.treeTable", "jsonedit_main.css", "jquery.suggest.css"
= js_include_tag "jquery-1.4.4.min", "jquery.jeditable.mini", "jquery.livequery", "jquery.localscroll", "jquery.scrollTo", "jquery.tools.min"
= js_include_tag "jquery-1.5.1.min", "jquery.jeditable.mini", "jquery.localscroll", "jquery.scrollTo", "jquery.tools.min"
= js_include_tag "/facebox/facebox.js"
= js_include_tag "jquery-ui-1.7.1.custom.min"
= js_include_tag "jquery.treeTable.min"
Expand Down
2 changes: 1 addition & 1 deletion chef-server-webui/app/views/layout/login.html.haml
Expand Up @@ -5,7 +5,7 @@
%meta{ "http-equiv" => "content-type", :content => "text/html; charset=utf-8" }
%title Chef Server
= css_include_tag "base", "themes/djime-cerulean/style", "chef", "/facebox/facebox.css", "jquery-ui-1.7.1.custom", "jquery.treeTable"
= js_include_tag "jquery-1.3.2.min", "jquery.jeditable.mini", "jquery.livequery", "jquery.localscroll", "jquery.scrollTo", "jquery.tools.min"
= js_include_tag "jquery-1.5.1.min", "jquery.jeditable.mini", "jquery.localscroll", "jquery.scrollTo", "jquery.tools.min"
= js_include_tag "/facebox/facebox.js"
= js_include_tag "jquery-ui-1.7.1.custom.min"
= js_include_tag "jquery.treeTable.min"
Expand Down
23 changes: 11 additions & 12 deletions chef-server-webui/public/javascripts/chef.js
Expand Up @@ -116,22 +116,21 @@ $(document).ready(function(){
});

// livequery hidden form for link_to ajax magic
$('a[method]').livequery(function(){
var message = $(this).attr('confirm');
var method = $(this).attr('method');
$(document.body).delegate('a[method]', 'click', function(e){
var $this = $(this);
var message = $this.attr('confirm'), method = $this.attr('method');

if (!method && !message) return;

$(this).click(function(event){
if (message && !confirm(message)) {
event.preventDefault();
return;
}
if (message && !confirm(message)) {
event.preventDefault();
return;
}

if (method === 'post' || method === 'put' || method === 'delete') {
event.preventDefault();
var form = $("<form/>").attr('method', 'post').attr('action', this.href).attr('style', 'display: none');
if (method !== "post") {
if (method === 'post' || method === 'put' || method === 'delete') {
event.preventDefault();
var form = $("<form/>").attr('method', 'post').attr('action', this.href).attr('style', 'display: none');
if (method !== "post") {
form.append($('<input type="hidden" name="_method"/>').attr('value', method));
}
form.insertAfter(this).submit();
Expand Down
19 changes: 0 additions & 19 deletions chef-server-webui/public/javascripts/jquery-1.3.2.min.js

This file was deleted.

167 changes: 0 additions & 167 deletions chef-server-webui/public/javascripts/jquery-1.4.4.min.js

This file was deleted.

16 changes: 16 additions & 0 deletions chef-server-webui/public/javascripts/jquery-1.5.1.min.js

Large diffs are not rendered by default.

250 changes: 0 additions & 250 deletions chef-server-webui/public/javascripts/jquery.livequery.js

This file was deleted.

0 comments on commit 2b9b1a7

Please sign in to comment.