Greasy Fork is available in English.

Discussions » Development

How to get current object or id of content we click on keypress

§
Posted: 23 April 2015

How to get current object or id of content we click on keypress

How to get current object or id of content we click on keypress

§
Posted: 23 April 2015

Can anyone tell how to get this?

woxxomMod
§
Posted: 23 April 2015

event.target usually.

§
Posted: 23 April 2015

sorry i am not getting current id when i click that

§
Posted: 23 April 2015

this is place it trigger when ever i click any content
c.prototype.getSelectedRanges = function () {
var b, c, d, g, h, i, j, k, l;

j = f.getGlobal().getSelection(), h = [], i = [], j.isCollapsed || (h = function () {
var a, f, h;
h = [];
for (c = a = 0, f = j.rangeCount; 0 <= f ? a < f : a > f; c = 0 <= f ? ++a : --a)
g = j.getRangeAt(c), b = new e.BrowserRange(g), d = b.normalize().limit(this.wrapper[0]), d === null && i.push(g), h.push(d);

return h
}.call(this), j.removeAllRanges());

console.log("2 "+this.wrapper[0]);
for (k = 0, l = i.length; k < l; k++)

g = i[k], j.addRange(g);
console.log(this.target);

return a.grep(h, function (a) {

console.log(this.element);
return a && j.addRange(a.toRange()), a
})
}


i want to get clicked object id here.


Can any one tell how to get that?

woxxomMod
§
Posted: 23 April 2015
Edited: 23 April 2015

Well, this is a minified/obfuscated version of the script. Find the original coffeescript code and it'll be easier to understand what's happening.

Post reply

Sign in to post a reply.