Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(function(){
- var form = $('#hosts'),
- topCheckbox = $('#topcheckbox', form),
- otherCheckboxes = $("input[name^='hosts']", form);
- topCheckbox.click(function(){
- otherCheckboxes.prop('checked', this.checked);
- });
- });
- $(function(){
- $('form').submit(function(){
- return false;
- });
- $('.button_clicked').click(function(){
- if(this.value == 'processes'){
- var div = $('<div>');
- function getProcesses(){
- $.post(WEBROOT + 'app.php/Job/processes', $(this).parents('form').serialize(), function(data){
- div.html(data).dialog({
- title: 'Process List',
- modal: true,
- width: 900,
- height: 325
- });
- var div_form = $('form', div).submit(function(){
- return false;
- })
- $('#buttons input:not(:checkbox)', div).click(function(){
- var formPost = div_form.serialize();
- if(formPost.length){
- $.post(WEBROOT + 'app.php/Job/killProcesses', formPost, function(data){
- if(data.success){
- getProcesses();
- }
- });
- }
- else {
- alert('nothing to post');
- }
- })
- });
- }
- getProcesses();
- }
- else {
- alert('insert into db');
- }
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement