Commit 1920ad7b authored by Dave Lane's avatar Dave Lane
Browse files

removed unnecessary debugging and tweaked messaging in admin js

parent efdee867
......@@ -155,7 +155,7 @@ class BFFForm extends BFFCourse {
}
}
if (count($found)) {
$this->log('BFF-equipped sites: '.print_r($found, true));
//$this->log('BFF-equipped sites: '.print_r($found, true));
foreach($found as $sid) {
if ($sid != 1) {
// we have to make sure we're in the right site context!
......@@ -176,9 +176,9 @@ class BFFForm extends BFFCourse {
$msg = sprintf(__(' Deleted unnecessary BFF pages with the following ids: $s', 'oeru-bff'), $list);
}
}
if (count($not_found)) {
/*if (count($not_found)) {
$this->log('Sites without a BFF page: '.print_r($not_found, true));
}
}*/
}
......@@ -387,14 +387,14 @@ class BFFForm extends BFFCourse {
// get thet settings for a specific blog, defaulting to the main/default one, of '1'
protected function get_settings($sid = 1) {
$this->log('default settings: '. print_r($this->default_settings, true));
//$this->log('default settings: '. print_r($this->default_settings, true));
$settings = array();
$default_settings = array();
if ($sid == 1) {
$this->log('sid = 1, so using default_settings.');
//$this->log('sid = 1, so using default_settings.');
$default_settings = $this->default_settings;
} else {
$this->log('site != 1, so using multisite settings as default_settings');
//$this->log('site != 1, so using multisite settings as default_settings');
$default_settings = $this->get_settings();
}
foreach ($default_settings as $setting => $default) {
......
......@@ -118,16 +118,14 @@ jQuery(document).ready(function() {
LOG('Success: data: ', data);
if (data.hasOwnProperty('success')) {
// strip links out
msg = data.message.replace(/<a[^>]*>[^<]*<\/a>/g, '');
console.log('Success msg', msg);
$('#bff-status').html(msg);
LOG('Success msg', msg);
// disable the form until further changes are made
$('#bff-submit').attr('disabled', true);
} else if (data.hasOwnProperty('error')) {
msg = data.message;
LOG('message:', msg);
$('#bff-status').html(msg);
}
msg = data.message.replace(/<a[^>]*>[^<]*<\/a>/g, '');
$('#bff-status').html(msg);
return true;
},
failure: function() {
......@@ -138,10 +136,10 @@ jQuery(document).ready(function() {
// if nothing else returns this first, there was a problem...
return false;
});
$('#bff-cleanup').on('click', function() {
LOG('in cleanup function');
checked = false;
$('#bff-status').html('Processing...');
$('#bff-status').html('Cleaning up...');
$.ajax({
type: 'POST',
dataType: 'json',
......@@ -154,17 +152,13 @@ jQuery(document).ready(function() {
var msg = '';
LOG('Success: data: ', data);
if (data.hasOwnProperty('success')) {
// strip links out
msg = data.message.replace(/<a[^>]*>[^<]*<\/a>/g, '');
console.log('Success msg', msg);
$('#bff-status').html(msg);
// disable the form until further changes are made
$('#bff-submit').attr('disabled', true);
LOG('Success msg', msg);
} else if (data.hasOwnProperty('error')) {
msg = data.message;
LOG('message:', msg);
$('#bff-status').html(msg);
}
// strip links out
msg = data.message.replace(/<a[^>]*>[^<]*<\/a>/g, '');
$('#bff-status').html(msg);
return true;
},
failure: function() {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment