Skip to content

Commit

Permalink
Bug #9, Fix CleanPrint image path, blank country-cell $row [LACE]
Browse files Browse the repository at this point in the history
* CleanPrint/ RTF customizations [iet:3377484]
* Blank country-cell Javascript - Geo report [iet:3371656]
* Plus, cross-browser `console.log()` JS calls
  • Loading branch information
nfreear committed May 20, 2015
1 parent 09c724e commit 9d883cb
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions js/lace-javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

jQuery(function ($) {

var $inject_cleanprint = $("body.search-results, body.single-hypothesis")
var C = window.console
, $inject_cleanprint = $("body.search-results, body.single-hypothesis")
, clearprint_post_re = /(search-results|postid-\d+)/
, cleanprint_exclude_sel = "#cookie-notice, .nav-menu, .assistive-text, .jxl-message, .oer-chart-loading, .leaflet-control-container, #X-secondary"
, cleanprint_include_sel = ".page-title, .entry-title, #X-primary"
Expand All @@ -19,7 +20,7 @@ jQuery(function ($) {
function () {
var $vis_table_row = $(vis_table_row_sel);

console.log("Vis table:", $vis_table_row);
C && console.log("Vis table:", $vis_table_row);

$vis_table_row.each(function () {

Expand All @@ -29,10 +30,10 @@ jQuery(function ($) {
if ("" === $cell_1.text()) {
$cell_1.html("<i>No location given</i>");

$row().addClass("no-location-row").attr("title", "No location given");
$row.addClass("no-location-row").attr("title", "No location given");
}

console.log("Row:", $row, $cell_1);
C && console.log("Row:", $row, $cell_1);
});

});
Expand All @@ -45,9 +46,9 @@ jQuery(function ($) {
post_id = post_id && post_id[1];

$(".page-header, .entry-header:first").first().after(
'<div style="text-align:right;"><a href="." onClick=\"WpCpCleanPrintPrintHtml(\'%s\');return false" title="Print page" class="cleanprint-exclude"><img src="http://lace/wp-content/plugins/cleanprint-lt/images/CleanPrintBtn_white.png" alt="Print page"/></a></div>'.replace("%s", post_id || 'custom'));
'<div style="text-align:right;"><a href="." onClick=\"WpCpCleanPrintPrintHtml(\'%s\');return false" title="Print page" class="cleanprint-exclude"><img src="/wp-content/plugins/cleanprint-lt/images/CleanPrintBtn_white.png" alt="Print page"/></a></div>'.replace("%s", post_id || 'custom'));

console.log("Inject CleanPrint:", $inject_cleanprint);
C && console.log("Inject CleanPrint:", $inject_cleanprint);
}

$(cleanprint_exclude_sel).addClass("cleanprint-exclude");
Expand All @@ -74,5 +75,5 @@ jQuery(function ($) {
}, interval || 200); // Milliseconds.
}

console.log('lace-javascript.js');
C && console.log('lace-javascript.js');
});

0 comments on commit 9d883cb

Please sign in to comment.