Skip to content

Commit

Permalink
Merge branch 'CHEF-1956-btm'
Browse files Browse the repository at this point in the history
  • Loading branch information
btm committed Jul 19, 2011
2 parents 08df3e5 + 4121cca commit fa47e8e
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 458 deletions.
2 changes: 1 addition & 1 deletion chef-server-webui/app/views/layout/application.html.haml
Original file line number Diff line number Diff line change
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.2.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
Original file line number Diff line number Diff line change
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.2.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
40 changes: 20 additions & 20 deletions chef-server-webui/public/javascripts/chef.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ $(document).ready(function(){
$('form#edit_node, form#create_node').submit(function(event) {
var form = $(this);
var to_node = $('ul#for_node').sortable('toArray');
if (form.attr('id') == 'edit_node') {
if (form.attr('id') === 'edit_node') {
form.append('<input type="hidden" name="_method" value="put">');
}
form.append($('input#node_name')).css('display', 'none');
Expand All @@ -72,7 +72,7 @@ $(document).ready(function(){

$('form#edit_databag_item, form#create_databag_item').submit(function(event) {
var form = $(this);
if (form.attr('id') == 'edit_databag_item') {
if (form.attr('id') === 'edit_databag_item') {
form.append('<input type="hidden" name="_method" value="put">');
}
form.append('<input type="hidden" id="json_data" name="json_data"/>');
Expand All @@ -81,15 +81,15 @@ $(document).ready(function(){

$('form#edit_databag, form#create_databag').submit(function(event) {
var form = $(this);
if (form.attr('id') == 'edit_databag') {
if (form.attr('id') === 'edit_databag') {
form.append('<input type="hidden" name="_method" value="put">');
}
form.append($('input#databag_name')).css('display', 'none');
});

$('form#edit_client, form#create_client').submit(function(event) {
var form = $(this);
if (form.attr('id') == 'edit_client') {
if (form.attr('id') === 'edit_client') {
form.append('<input type="hidden" name="_method" value="put">');
}
form.append($('input#client_name')).css('display', 'none');
Expand All @@ -102,41 +102,41 @@ $(document).ready(function(){

$('form#edit_user, form#login').submit(function(event) {
var form = $(this);
if (form.attr('id') == 'edit_user') {
if (form.attr('id') === 'edit_user') {
form.append('<input type="hidden" name="_method" value="put">');
form.append($('input#user_new_password')).css('display', 'none');
form.append($('input#user_admin')).css('display', 'none');
form.append($('input#user_confirm_new_password')).css('display', 'none');
form.append($('input#openid')).css('display', 'none');
}
if (form.attr('id') == 'login') {
if (form.attr('id') === 'login') {
form.append($('input#user_name')).css('display', 'none');
form.append($('input#password')).css('display', 'none');
}
});

// 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;
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();
}
});
});

// accordion for the cookbooks show view
Expand Down
19 changes: 0 additions & 19 deletions chef-server-webui/public/javascripts/jquery-1.3.2.min.js

This file was deleted.

Loading

0 comments on commit fa47e8e

Please sign in to comment.