[jQuery] Re: How to change contextmenu-plugin to trigger on left-click

2008-03-27 Thread Francesco Vivoli


Hi Dan

I'm about to use your plugin in a RIA and I'd need to change the binding.
In order to avoid to duplicate stuff, I wonder if you've come to a
configurable
property.

Otherwise I'll see if I've the time to contribute something.
cheers
Frrancesco


Dan G. Switzer, II wrote:
> 
> 
>>I've tried to solve this myself, and seeked help on the IRC-channel,
>>but the "problem" seems to be hard to overcome. I've implementet the
>>contextmenu-plugin (
>>http://www.trendskitchens.co.nz/jquery/contextmenu/jquery.contextmenu.r2.js
>>) on a site, and the client has fallen in love with it and how it
>>works - but they want to have it trigger on left-click instead of
>>right.
>>
>>The problem is that i can't figure out -where- the rightclick is
>>caught, so that i can change it to left-click. Can anyone think of a
>>way to solve that?
>>
>>I'm at a loss here :p
> 
> Look for the line starting with:
> 
> $(this).bind('contextmenu',
> 
> The "contextmenu" is what is binding this to the right-click. Change
> "contextmenu" to "click" and it should work with a left click.
> 
> -Dan
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/How-to-change-contextmenu-plugin-to-trigger-on-left-click-tp14688817s27240p16323992.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Simple RSS reader plugin

2008-02-08 Thread Francesco Vivoli


Hi all

I've just wrote about a simple wrap-up plugin of the idea given in 
http://www.nabble.com/RSS-Feed-Reader-to4997503s27240.html this post .

it basically fills a news box with the contents of an rss feed.
In case someone is interested you can 
http://blogs.atalayasec.org/dev/2008/02/jquery-rss-feed-reader-plugin/ find
it here .

Cheers
Francesco



-- 
View this message in context: 
http://www.nabble.com/Simple-RSS-reader-plugin-tp15351730s27240p15351730.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: Weird exception when extending Array

2007-12-18 Thread Francesco Vivoli


Thanks Ariel

ok, two things:
-Is there a JQuery way of achieving the same of that prototype function?
-in fact I don't have any $().removeClass in my code: this call is buried
within 
some initialization code, might be from idTabs.

If it was a call I'd wrote I'd have tried to rewrite it, the problem is that
normally
it doesn't happen without that prototype function(setting up a breakpoint
with firebug 
shows that the execution paths are different).

Btw: I've changed it to array_contains(array,value) and everything works
fine...


cheers
Francesco


Flesler-2 wrote:
> 
> 
> Extending primitive types' prototypes is always dangerous. Still I
> don't think that's the problem here. You seem to be calling $
> ().removeClass on the document, that might not be possible. Can you
> try using $('html').removeClass instead ?
> 
> Ariel Flesler
> 
> On Dec 16, 11:54 am, Francesco Vivoli <[EMAIL PROTECTED]> wrote:
>> Hi all
>>
>> I've a strange issue that bugs me...
>> Everything works fine in a page we've got, but when I add this simple
>> function
>> to one of our js files
>>
>> Array.prototype.contains = function (value){
>> var i;
>> for (i=0; i < this.length; i++) {
>> if (this[i] === value) {
>> return true;
>> }
>> }
>> return false;
>>
>> }
>>
>> and reload the page I get this exception:
>>
>> elem.className has no
>> propertieshttp://localhost:8080/atalaya-web/js/jquery-1.2.1.js
>> Line 617
>>
>> This is because this function
>> remove: function( elem, c ){
>> elem.className = c != undefined ?
>> jQuery.grep( elem.className.split(/\s+/), function(cur){
>> return !jQuery.className.has( c, cur );
>>
>> }).join(" ") : "";
>> }
>>
>> is invoked with a window.document object, that has no class associated.
>> Thus
>> elem.className fails
>>
>> It's really weird, because without the above prototype function
>> everything
>> works fine...
>> For the moment I've just rewritten it like array_contains(array,value)
>> and
>> issue solved, but I'd like
>> to know what's causing this.
>>
>> Does anybody have a clue?
>> thanks a lot, cheers
>> Francesco
>>
>> --
>> View this message in
>> context:http://www.nabble.com/Weird-exception-when-extending-Array-tp14362261...
>> Sent from the jQuery General Discussion mailing list archive at
>> Nabble.com.
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Weird-exception-when-extending-Array-tp14362261s27240p14384530.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Weird exception when extending Array

2007-12-16 Thread Francesco Vivoli


Hi all

I've a strange issue that bugs me...
Everything works fine in a page we've got, but when I add this simple
function
to one of our js files

Array.prototype.contains = function (value){
var i;
for (i=0; i < this.length; i++) {
if (this[i] === value) {
return true;
}
}
return false;
}

and reload the page I get this exception:

elem.className has no properties
http://localhost:8080/atalaya-web/js/jquery-1.2.1.js
Line 617


This is because this function
remove: function( elem, c ){
elem.className = c != undefined ?
jQuery.grep( elem.className.split(/\s+/), function(cur){
return !jQuery.className.has( c, cur );
}).join(" ") : "";
}

is invoked with a window.document object, that has no class associated. Thus
elem.className fails

It's really weird, because without the above prototype function everything
works fine...
For the moment I've just rewritten it like array_contains(array,value) and
issue solved, but I'd like
to know what's causing this.

Does anybody have a clue?
thanks a lot, cheers
Francesco

-- 
View this message in context: 
http://www.nabble.com/Weird-exception-when-extending-Array-tp14362261s27240p14362261.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Exception with tablesorter+pager when table is empty

2007-12-10 Thread Francesco Vivoli


Hi all

at jquery.tablesorter.pager.js:149 I have this line

$(this).trigger("appendCache");


which causes this to be executed (jquery.tablesorter.js:243)

var c = cache,
r = c.row,
n= c.normalized,
totalRows = n.length,
checkCell = (n[0].length-1),
tableBody = $(table.tBodies[0]),
rows = [];


if the table is empty this will give me a 

n[0] has no properties
checkCell = (n[0].length-1), 

since c is empty...I think some check is missing here.

Anyone is having this?
Cheers
Francesco


-- 
View this message in context: 
http://www.nabble.com/Exception-with-tablesorter%2Bpager-when-table-is-empty-tp14254080s27240p14254080.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: Again on tablesorter and row hovering

2007-11-23 Thread Francesco Vivoli


Thanks a lot, this works like a charm:)

Nevertheless I still need to make the hover css !important in
order to have it visible.


cheers
Francesco

-- 
View this message in context: 
http://www.nabble.com/Again-on-tablesorter-and-row-hovering-tf4852402s27240.html#a13908178
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Again on tablesorter and row hovering

2007-11-22 Thread Francesco Vivoli


Hi all

I've changed a table to use tablesorter (+ its pager) instead of server side
sorting+paging, so far so good.
The last bit that is missing to make it fully functional is the classic
"hovering highlights" effect.
I've been reading here and there and I've found no precooked solution, nor I
have been able to produce one...

Basically I've been trying to assign an hover() event to the TDs of my table
body, using something like this:



$.tablesorter.addWidget({
id: "hover",
format: function(table) {

$("tbody tr", table).each(function() {
$(this).hover(
function () {
var $rows = $(this).children();
$rows.each(function(){
$(this).addClass("hover");
})
},
function () {
var $rows = $(this).children();
$rows.each(function(){
$(this).removeClass("hover"); 
})
}
);
})
}
});



Now, the event works ok, and the TD is added with the "hover" class.
But the CSS class that prevails is the tablesorter one:

table.tablesorter tbody tr.odd td {
background-color:#F0F0F6;
}


How do I get rid of this precedence problem?
Do I have to test manually if the td I'm processing is of "odd" class, and
in that case remove it?
Beside this, I'm not sure if this solution starts to be heavyweighted,
considering that I have 
tables of 5000 or so rows...

Does anyone of you any suggestion? Am I missing something obvious?

Many thanks, especially for the whole lot of good work you do out there!
Francesco


-- 
View this message in context: 
http://www.nabble.com/Again-on-tablesorter-and-row-hovering-tf4852402s27240.html#a13884512
Sent from the jQuery General Discussion mailing list archive at Nabble.com.