i have a custom image for facebook, that when the user click, it will share something, however, developers.facebook provide element that will automatically generate share button with the below code
<div class="fb-share-button" data-href="https://developers.facebook.com/docs/plugins/" data-layout="button"></div>
I want to use my custom image to use the code generated to popup the share page, is there a way?
%a.link.facebook{href: "some_url_here"}
I already search the net, still I'm stuck,
Thanks for your help , im still a beginner, :)
Many suggestion are useful, thanks to all of them, but i find this method more simple, I want to share it to you guys.
Javascript (put it in header or footer)--
<script>
function fbShare(url, title, descr, image, winWidth, winHeight) {
var winTop = (screen.height / 2) - (winHeight / 2);
var winLeft = (screen.width / 2) - (winWidth / 2);
window.open('http://www.facebook.com/sharer.php?s=100&p[title]=' + title + '&p[summary]=' + descr + '&p[url]=' + url + '&p[images][0]=' + image, 'sharer', 'top=' + winTop + ',left=' + winLeft + ',toolbar=0,status=0,width=' + winWidth + ',height=' + winHeight);
}
</script>
to your link or image
Share
http://jsfiddle.net/stichoza/eyxtj/
Related
Dear Microsoft Clarity Team,
I hope this message finds you well. I have been testing the Clarity-Devtool and I noticed an issue while using it. When I move my pointer over an iframe image, the pointer gets stuck at the edge of the image and does not move inside the iframe.
I was wondering if there is a way to resolve this issue so that the pointer can move inside the iframe image as well. I understand that Clarity does not support viewing the content of the iframe, but I believe that moving the pointer over the iframe area should be allowed.
This would greatly enhance my experience with the Clarity-Devtool and provide me with more accurate insights into user behavior.
I also added it sandbox="allow-same-origin allow-scripts allow-pointer-lock" but it does not work also
enter image description here
function mouse(event: Event, root: Node, evt: MouseEvent): void {
let frame = iframe(root);
let d = frame ? frame.contentDocument.documentElement : document.documentElement;
let x = "pageX" in evt ? Math.round(evt.pageX) : ("clientX" in evt ? Math.round(evt["clientX"] + d.scrollLeft) : null);
let y = "pageY" in evt ? Math.round(evt.pageY) : ("clientY" in evt ? Math.round(evt["clientY"] + d.scrollTop) : null);
// In case of iframe, we adjust (x,y) to be relative to top parent's origin
if (frame) {
let distance = offset(frame);
x = x ? x + Math.round(distance.x) : x;
y = y ? y + Math.round(distance.y) : y;
}
console.log('pointer.ts Intersection x:' + x + ' y:' + y);
// Check for null values before processing this event
if (x !== null && y !== null) { handler({ time: time(), event, data: { target: target(evt), x, y } }); }
}
I added console.log('pointer.ts Intersection x:' + x + ' y:' + y); to the \src\interaction\pointer.ts
to track the pointer location
I see it in the console the coordinates but tbe pointer does not move into the frame image.
Here is the link to my test website https://thankful-pond-0d14a730f.2.azurestaticapps.net/
I'm using the Clarity Devtool Extension
It contains two iframes.
The Iframe on the top (green) has a source URL to a local file on the same domain src="/myLocalIframe.html, and it works as expected.
enter image description here
The one on bottom (red) has a source URL to a different website https://kind-moss-07698f50f.2.azurestaticapps.net/ , and it does not work
enter image description here
Here is the [Decoded Data (Page)]
enter link description here
Let me know if this help you debug it from your end.
I'm using Highcharts plugins "dragable points" and "export-csv".
I'm using these to place circles on a chart with a background drawing. This is so I can use these points to change colour as the data for that point updates.
My problem is I'm trying to export the "Name" of the point in the csv file and I'm only able to get the x and y values.
Data I'm loading in looks like this
{name: 'd1', color: '#FF0000', x: 10, y: 100},{name: 'd2', color: '#FF0000', x: 30, y: 100}
This places the points in a set location and then I'm using the dragable plugin to move the points to the new locations. Once there I would like the export-csv plugin to output the "name:" along with the "x: and y:" values.
Question:
Is there a way to set the export-csv plugin to include the name of the point?
Don't even bother with the plugin. You can code very simply in like 8 lines of JavaScript:
$('#getcsv').click(function () {
var csv = "Series;Name;X;Y\n";
$.each(Highcharts.charts[0].series, function(i,s){
$.each(s.points, function(j,p){
csv += s.name + ";" + p.name + ";" + p.x + ";" + p.y + "\n";
});
});
alert(csv);
});
Here's an example.
If you check out the docs and the source code for this plugin you can see that it is just explicitly getting the data as a two dimensional array of x and y points (date or category and the yValue). To get it to return the other items you would need to extend this plugin (or roll your own).
I'm trying to understand this code:
315 let existingIndex = this._editors.indexOf(editableNode.editor);
316 if (existingIndex == -1) {
317 let x = this._editors.length;
318 this._editors[x] = editableNode.editor;
319 this._stateListeners[x] = this._createStateListener();
320 this._editors[x].addEditActionListener(this);
321 this._editors[x].addDocumentStateListener(this._stateListeners[x]);
322 }
http://mxr.mozilla.org/mozilla-release/source/toolkit/modules/Finder.jsm#320
Especially addEditActionListener(this); what is this? MDN docs say it should be nsIEditActionListener but I can't find what this listener is comprised of MDN docs takes to broken page.
nsIEditor - MDN
this is the Finder object; it implements the nsIEditActionListener interface (http://mxr.mozilla.org/mozilla-release/source/toolkit/modules/Finder.jsm#395)
That interface is defined here: http://mxr.mozilla.org/mozilla-release/source/editor/idl/nsIEditActionListener.idl
So the code essentially attaches the Finder object to the editor, presumably so it can be notified of changes made in the editor at a later point.
how can I access to the next point of the series from the tooltip formatter.
Because I want to do a sum between both points.
Like this.y + next.y.
But I don't know how to have an access to the next point.
If someone have an answer. Thanks
This need to be done in a few steps:
get x-index according to x-value: var index = this.series.xData.indexOf(this.x);
now get y-value: var nextY = this.series.yData[index+1];
And all you need to do is to sum values, like this: var sum = this.y + nextY;.
I write too much of this code :
self.frame.origin.y + self.frame.size.height
Is there shortcut for this? Something like self.frame.y_plus_height?
If there is, I'm not sure if that good news or bad news for all the times I wrote the full sentence.
This should do the trick:
CGFloat res = CGRectGetMaxY(self.frame);
Documentation can be found here.
EDIT: according to explanation from rob mayoff (see comments) this is a little more expensive than simply summing origin.y + size.height in code.
There's a great category on UIView created by nfarina.
Check it out here.
Using this category, you can get the "max Y" or "bottom" of a view like this (where self is a view):
CGFloat maxY = self.$bottom;
This category is really awesome because it enables you set to frame properties easily, too. In example, to move the view over to the right 3 points, you can do this:
self.$x += 3.0f;
I realize this is asking for Objective-C, but for those using Swift and stumbling upon this question, you can just create a CGRect extension:
extension CGRect {
func maxYinParentFrame() -> CGFloat {
return self.origin.y + self.size.height
}
}
You can then use it anywhere.
let mySize = myView.frame.maxYinParentFrame()