Plugin Author
Baden
(@baden03)
Hmmm… Not exactly sure what you are referring to… can you share a link that might help us understand your request?
Thread Starter
keanw
(@keanw)
Thanks for the quick response and sorry for not being more clear…
Jetpack (via ShareDaddy) allows you to add a “print” button. This just links to http://my-example-site.com/my-example-page.html#print (which I understand is the standard printing capability in the browser).
Rather than having a separate POM icon, I’d rather either have Jetpack (or the standard print command in the browser) call through to POM, or otherwise find a away to integrate POM into the sharing actions.
My WP site isn’t yet live, but here’s an image showing the current state of the buttons I have:
http://through-the-interface.typepad.com/pom.png
Thanks again,
Kean
Thread Starter
keanw
(@keanw)
OK, I think I’ve found a way around this using JS:
$(document).ready(function() {
$('.sd-content .share-print > a').removeAttr("href");
$('.sd-content .share-print').click( function() {
$('.printomatic, .printomatictext').click();
});
});
Kean
Thread Starter
keanw
(@keanw)
Oops – that added the content twice. This is better:
$(document).ready(function() {
var elem = $('.sd-content .share-print > a');
elem.removeAttr("href");
elem.click( function() {
$('.printomatic, .printomatictext').click();
});
});
Plugin Author
Baden
(@baden03)
ok, I think I see what you mean now. I would pimp that code with a bit more WordPress friendly jQuery jedi foo:
jQuery(document).ready(function() {
//trigger on shardaddy print
jQuery(document).on('click', '.sd-content .share-print > a', function(event) {
//is a print-o-matic element present?
if(jQuery('.printomatic').length){
//prevent that tired ol' sharedady print action
event.preventDefault();
//click that sweet print-o-matic action
jQuery('.printomatic').click();
}
});
});