Does Pinterest button have a callback? - callback

I need to unlock content when someone shares the post with pinterest, and I can't find a callback function on pinterest button. Is there any way to do this?

You could wrap the pinterest link with a span and add a jQuery click event to the span to at least know that the pinit button was clicked. That's about the best you can do until they release a real callback so you can know that an item was actually pinned.
<span id="pin-container"><a data-pin-config="beside" href="http://pinterest.com/pin/create/button/?url=[your_url]&media=[your_image]&description=[your_desc]" data-pin-do="buttonPin" ><img src="//assets.pinterest.com/images/pidgets/pin_it_button.png" /></a></span>
$('#pin-container').click(function () {
alert('clicked pin button');
});

A workaround is posted here:
http://www.lunametrics.com/blog/2012/03/12/tracking-pinterest-event-tracking/
Until Pinterest opens up a public API and a non-iFrame tracking button, this is about as good as you'll get.

As said before, the API is not public yet. The best workaround (I just tested it, and it works in my scenario) that I've found so far is http://www.seomoves.org/blog/tools/tracking-pins-with-the-pinterest-button-2595/
That link only lets you determine if the Pin Button was clicked, not if they actually made the share. Hope that helps a little!

Related

Long press an element to show the black options bubble(copy,forward..) like wtsapp?

Can someone point me to the right direction of how to show options(copy, forward...) when I long press an element (a message in this case) like wtsapp/FB messenger?
I don't even know what keywords should I be searching...(tried modal, popover, action sheet)
Thanks.
Update:
I understand that I should use the on-hold gesture...I am specifically looking for the black option bubble to be shown. I don't know what it is called(not modal/pop up/ action sheet/popover/alert). Thanks.
you can use on-hold="myFunction()", check the link below
http://ionicframework.com/docs/api/directive/onHold/
and then use the $ionicActionSheet Service to do your logic, check the link below
http://ionicframework.com/docs/api/service/$ionicActionSheet/
on-hold event is your friend : http://ionicframework.com/docs/api/directive/onHold/
I think following Codepen example would help in accomplishing what you want to do:
Actionsheet : http://codepen.io/ionic/pen/jLylA
Also, have a look this thread on Ionic Forum before you start implementing, just to avoid any similar issue, plus, this thread got some CodePen examples, that your might find useful :
https://forum.ionicframework.com/t/displaying-actionsheet-on-a-long-press-aka-hold-event-problem/5663
You can implement long press with either on-hold and if you want to implement long press for buttons, try this directive from this link and a note on directive can be found here . You may need to use a custom action sheet ($ionicActionSheet) to implement the UIMenuController (iOS component) like feature.
.selectable{
-webkit-user-select: auto;
}
for selection and ion-content to overflow-scroll="true"

Images disappear when clicked on iPhone Safari

Ok, weird issue:
1) Go here on an iPhone (Safari browser): http://powellcreative.com/our-team/
2) Click any of the team images to get to the team member page
3) Click the back button on the browser
4) The image is disappeared on the Team page now
I know this question is kind of old, but I was looking for a solution to a similar problem and after searching, I found a solution. Hopefully this helps other people with the same problem. The problem is when you give iOS a javascript event like onmouseover or onmouseout it doesn't like it, mainly because when your finger is "mousing over" an element in iOS, you are actually clicking on it, so this is the solution I came up with that seems to reload images after hitting the back button in iOS.
Here it is:
Make sure all images are in their own separate div with a distinctive name.
Example:
<div name="div1"><img src="yourimage" onmouseover="javascript:this.src='yourimage2';" onmouseout="javascript:this.src='yourimage';"></div>
In the javascript head part of your page you want to insert this:
window.onpageshow =
function(event){
if (event.persisted){
//for every div and image you want changed back you can add a loop here to change all at once or just one div by name//
document.getElementById('div1').innerHTML = '<img src="yourimage" onmouseover="this.src="yourimage2";" onmouseout="this.src="yourimage";">';
}
}
This will check for page back since Mobile Safari uses bfcache and reload your image into the div. Hopefully this helps OP or someone else.

mimic pressing a button on a webpage in the backgroud, for triggering an action

Pretend you have a button on an iOS GUI. Pressing this button should now trigger a button on a webpage (which triggers an action). While doing this, the webpage should not be visible. How can I do that?
My guess is, that I read and parse the webpage, and if I've found the button action, I would trigger it somehow. Since I'm not a web programmer, I wonder how to proceed or read on for such a task.
I need this task, because there is no JSON or XML webservice on the page that would make life easier.
Many thanks for any input
Okay, let's say you've already loaded your webpage in an off-screen (or hidden) UIWebView, and the submit button on that webpage looked a bit like the following in code:
<form id="my_submit_button" etc... >
Just call the following:
NSString* javascript = #"document.forms['my_submit_button'].submit();";
[myUIWebView stringByEvaluatingJavaScriptFromString: javascript];
Hope this helps!

Clean AddThis / Facebook Like / Recommend Button without Social Text?

I've been desperately seeking a way to disable the facebook social text right next to the "Recommend" button. Is it possible, to simply render a "Recommend" button, without anything else (no counter, no text, JUST the button)?
The problem is, CSS wont be applied since all the elements are inside the iframe, so I cant just hide the element itself using CSS (which in this case would be a td).
Also, I cant just put everything in a div and give it overflow:hidden and a fix width, since the pop up which appears when actually clicking the "Recommend" Button would then not be fully visible.
My current implementation comes via AddThis:
<a class="addthis_button_facebook_like" fb:like:size="small" fb:like:layout="none" fb:like:action="recommend" fb:like:width="10"></a>
Any ideas?
Thanks
Alex
Facebook polcy IV 4 d:
You must not obscure or cover elements of our social plugins, such as the Like button or Like box plugin.
So if you can't do it by using their like button creation tool you shouldn't do it.
Using the Add This Facebook Like button you can avoid the count using this attribute
fb:like:layout="button"
So in your case you would have
<a class="addthis_button_facebook_like" fb:like:size="small" fb:like:layout="button" fb:like:action="recommend" ></a>
"Recommend" with a counter comes closest to your request. I too don't like the social text (e.g. "57 people like this. Be the first of your friends"), yet I do like the naked counter. The code that I use is:
<a class="addthis_button_facebook_like" fb:like:layout="button_count" fb:like:action="recommend" fb:like:width="135"></a>
See AddThis own documentation here.

JQGrid - Add buttons to a Form Edit dialog

I have been using JQGrid for about a year now and I love it. Just wondering if someone knows a way to add a button or two that will trigger my own code on a Form Edit page? Not on the grid itself - the edit dialog.
Would I just use the onInitializeForm event?
Thanks!
Jim
I used jQuery to do this. In my case I had a drop-down select item as a field on the edit for and I wanted to add a link next to it. I used the beforeShowForm event.
beforeShowForm: function(form) {
$("#MyDropDownList").after("<a href='#' id='link'>A Link To Something</a>");
},
Hope this helps, even though it's a few weeks late.