[jQuery] [validate] how to test text against a bad word list?
hi, i'm using the excellent validate-plugin and it works like a charm. now i want to test the text in a textarea against a list of bad words. how must be the syntax of the custom validation rule? i'm very bad in regex … thanks in advance, tobaco
[jQuery] Re: [validate] how to test text against a bad word list?
uh, that was fast! thx, i will give it a try. aehm, is it possible to put the bad word in an array and test this. On 22 Sep., 13:31, Jörn Zaefferer [EMAIL PROTECTED] wrote: return !/bad|word|must|not|match/.test(value); Jörn On Mon, Sep 22, 2008 at 1:25 PM, tobaco [EMAIL PROTECTED] wrote: hi, i'm using the excellent validate-plugin and it works like a charm. now i want to test the text in a textarea against a list of bad words. how must be the syntax of the custom validation rule? i'm very bad in regex … thanks in advance, tobaco
[jQuery] Re: [validate] how to test text against a bad word list?
hm, i tried it this way, var badwordlist = new Array(Nice Site, Good Work, xxx, url=http, drugs, aciphex, nude); jQuery.validator.addMethod(badWord, function(value) { return new RegExp('!/' + badwordlist.join('|') + '/').test(value); }, Verdacht auf Spam-Versuch. Bitte passen Sie Ihren Kommentar an.); but now it works in the opposite way. the textarea is now only valid, if i enter one of the bad words … this return !/nice site|good work|xxx|aciphex|url=http|nude/.test(value); works fine. On 22 Sep., 14:32, Jörn Zaefferer [EMAIL PROTECTED] wrote: Sure. You can create a regexes on the fly with new RegExp(bla) and use that instead of the inline regex /bla|blu/. Jörn On Mon, Sep 22, 2008 at 1:37 PM, tobaco [EMAIL PROTECTED] wrote: uh, that was fast! thx, i will give it a try. aehm, is it possible to put the bad word in an array and test this. On 22 Sep., 13:31, Jörn Zaefferer [EMAIL PROTECTED] wrote: return !/bad|word|must|not|match/.test(value); Jörn On Mon, Sep 22, 2008 at 1:25 PM, tobaco [EMAIL PROTECTED] wrote: hi, i'm using the excellent validate-plugin and it works like a charm. now i want to test the text in a textarea against a list of bad words. how must be the syntax of the custom validation rule? i'm very bad in regex … thanks in advance, tobaco
[jQuery] Re: [validate] how to test text against a bad word list?
doh! (http://www.fortunecity.com/lavendar/poitier/135/doh.wav) (hätte ich auch selber drauf kommen können …) thanks! works great! On 22 Sep., 16:03, Jörn Zaefferer [EMAIL PROTECTED] wrote: Try this: return !new RegExp(badwordlist.join('|')).test(value); Jörn On Mon, Sep 22, 2008 at 3:50 PM, tobaco [EMAIL PROTECTED] wrote: hm, i tried it this way, var badwordlist = new Array(Nice Site, Good Work, xxx, url=http, drugs, aciphex, nude); jQuery.validator.addMethod(badWord, function(value) { return new RegExp('!/' + badwordlist.join('|') + '/').test(value); }, Verdacht auf Spam-Versuch. Bitte passen Sie Ihren Kommentar an.); but now it works in the opposite way. the textarea is now only valid, if i enter one of the bad words … this return !/nice site|good work|xxx|aciphex|url=http|nude/.test(value); works fine. On 22 Sep., 14:32, Jörn Zaefferer [EMAIL PROTECTED] wrote: Sure. You can create a regexes on the fly with new RegExp(bla) and use that instead of the inline regex /bla|blu/. Jörn On Mon, Sep 22, 2008 at 1:37 PM, tobaco [EMAIL PROTECTED] wrote: uh, that was fast! thx, i will give it a try. aehm, is it possible to put the bad word in an array and test this. On 22 Sep., 13:31, Jörn Zaefferer [EMAIL PROTECTED] wrote: return !/bad|word|must|not|match/.test(value); Jörn On Mon, Sep 22, 2008 at 1:25 PM, tobaco [EMAIL PROTECTED] wrote: hi, i'm using the excellent validate-plugin and it works like a charm. now i want to test the text in a textarea against a list of bad words. how must be the syntax of the custom validation rule? i'm very bad in regex … thanks in advance, tobaco
[jQuery] Re: Toggle Only the dd below the dt on click
try it this way: script type=text/javascript $(function(){ $('[EMAIL PROTECTED]http://;]').attr('target', '_blank'); $('[EMAIL PROTECTED]https://;]').attr('target', '_blank'); $(.stripes dd).hide(); $(.stripes dt).click(function(){$ (this).nextAll(dd).toggle(slow); }); }); /script On 19 Sep., 05:24, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: This is probably a noob question but... I have a bunch of definition lists on a page with the same class so that I can stripe every other dd in the list. What I want to do is hide the dd elements and when I click on the dt toggle the dd elements to visible. I want this to happen only on the dd elements in the same definition list as the title I am clicking, not all the dd elements on the entire page. What is happening now is that all of the dd in all of my definition lists are being toggled when I click on any of the dt elements on the page. I am sure this is a simple solution, but I can't seem to wrap my head around it. The code is below. script type=text/javascript $(function(){ $('[EMAIL PROTECTED]http://;]').attr('target', '_blank'); $('[EMAIL PROTECTED]https://;]').attr('target', '_blank'); $(.stripes dd).hide(); $(.stripes dt).click(function(){$(.stripes dd).toggle(slow); });}); /script Thanks for your help! -Paul
[jQuery] Re: innerfade element with opacity and IE
i don't think, that there is much you can do about it. you could change your approach and use a semi-transparent png24 as background-image for the caption instead of setting the opacity. this should do it. On 20 Jun., 01:26, aronduby [EMAIL PROTECTED] wrote: Hey everyone, I've run into an issue with innerFade and IE when I'm fading an element that has the opacity set in css. More specifically, I have a slide div, which has an img, and then a caption div. The caption div is set to 80% opacity. Of course it works fine in FF, but when IE runs the effects, it first kicks the opacity to 100%, which is greatly not desired. example at:http://client.grcmc.org/wip/nv/ thanks all Duby
[jQuery] Re: jQuery.Preload - 4 in 1 image preloader
wow! you have a massive output on plugins! it seems to me, that you release one per day. thx for all. great work On 6 Mrz., 03:19, Ariel Flesler [EMAIL PROTECTED] wrote: If anyone was having issues with Safari 2, they've been fixed in the last release. Cheers Ariel Flesler On 29 ene, 20:38, Ariel Flesler [EMAIL PROTECTED] wrote: Hi everyone Today added the first release of jQuery.Preload. As said in the project page, it's a multi-functional plugin topreloadimages. It can be used for 4 (or more) different situations. The plugin is very small ( less than 1.5kb minified ) and offers many settings to configure it. It also exposes 3 callbacks. jQuery.Preload goes beyond a simple image preloader and can be used ( for example ) to generate galleries with little code(like shown in the URL mode demo), or even to ping using images. I'm sure it can aid on many other situations as well (ideas are welcomed). The project page includes all the documentation for the different modes, every setting is explained. There're 4 small demos, one for each mode, which contain comments, and a code sample. Note that is not necessary to use it exactly as in the example. Its high versatility suits many diverse situations. Project Page:http://plugins.jquery.com/project/Preload Demos:http://www.freewebs.com/flesler/jQuery.Preload/ The demos start with the Link mode, check all 4, linked on the right with red arrows. Cheers Ariel Flesler
[jQuery] Re: jquploader 2 alpha 1 - rich file upload dialog plugin - please test and help
looks good, but works for me only in FF 2 and Safari 3 on Win XP. not in ie 6+7 and opera 9.25 is there a possibility to delete or change the selected file? cheers, torsten On 31 Jan., 12:36, Alexandre Plennevaux [EMAIL PROTECTED] wrote: Hello friends, I am working on the new version of jqUploader, a plugin that allows to replace the file inputs in a form for a more user-friendly file upload dialog via the use of an invisible flash object. The new version allows for full customization via CSS and html, instead of having to tweak the flash file. I've pretty much finished a working prototype (still need to implement all the customizable options). It works well on WinXP FF2. WARNING: THIS IS ALPHA STUFF NOT TO BE USED IN PRODUCTION YET demo is here:http://www.pixeline.be/experiments/jqUploader/v2/ I have 2 requests: query.jquploader2.jshttp://www.pixeline.be/experiments/jqUploader/v2/jquery.jquploader2.js 1/ can you test on your side and (especially mac users) let me know if the test works or not for you. 2/ for plugin experts: if you look at the code i use functions that i would like that the user be able to modify, but i don't know exactly how to do that. For the moment, the js functions called by flash are sitting outside of the plugin loop. What would be the good way to allow users to modify what these function do? Basically their task is to update the html according to the flash events. The code is here: Thank you for your time, Alexandre -- Alexandre Plennevaux LAb[au] http://www.lab-au.com
[jQuery] Re: $(this) and bind()? Noobish questions...
hi, for 01. try this: $(this).find(.thumb).animate({ height: 50px }, fast); for 02.: hover is just a helper-function. it simplifies the process of binding. see this example from the blog-entry (http://jquery.com/blog/ 2008/01/15/jquery-122-2nd-birthday-present/) for the latest jquery- release: $(li).hover(function(){ $(this).addClass(hover); }, function(){ $(this).removeClass(hover); }); $(li).bind(mouseenter, function(){ $(this).addClass(hover); }).bind(mouseleave, function(){ $(this).removeClass(hover); }); they do both the same. greetings, torsten On 25 Jan., 04:54, Micky Hulse [EMAIL PROTECTED] wrote: Hi, Two quick questions: - 01. $(.item).hover( function() { console.log(this); /* For Firebug. */ $(this + ' .thumb').animate({ height: 50px }, fast); /* How to target a child element of $(this)? */}, function() { console.log(this); /* For Firebug. */ $(this + ' .thumb').animate({ height: 25px }, fast); /* How to target a child element of $(this)? */} ); So, $(this + ' .thumb') does not work (to be expected)... But how can I make sure I target the child element $(.thumb) of $(this)? Here is the HTML: div class=item div class=thumb/div /div - 02. I am trying to learn when I should use bind() in my jQuery coding... Would I want to bind() the hover via the above code snippet? - Tips would be spectacular! :D Thanks a million in advance. Cheers, Micky
[jQuery] Re: Why this simple code isn't working
$(#add_linha).emtpy().append(data); it should be empty() not emtpy() ... On 14 Dez., 13:36, Marcelo Wolfgang [EMAIL PROTECTED] wrote: Hi all, I'm banging my head on the keyboard here ... and couldn't figure out why this isn't working I have the following code: HTML: div id=add_formColeção class=overflow label for=add_colecaoColeção:/label select name=add_colecao id=select_colecao option value=Escolha uma coleção/option option value=1Primavera Verão 2008/option option value=2Primavera Verão 2008/option /select /div div id=add_formLinha class=overflow label for=add_linhaLinha:/label select name=add_linha id=add_linha option value=escolha uma coleção/option /select /div JS: $(#select_colecao).change(function(){ var colecaoId = this.value; $.get(act/act_linhas_na_colecao.php, {colId:colecaoId}, function(data){ alert($(#add_linha).html())// outputs option value=escolha uma coleção/option alert(data)// outputs option value=7890078900 - Flex/option option value=8090080900 - Multi/option $(#add_linha).emtpy().append(data); // nothing happens }); }); Can anyone shed some light why it doesn't works ? TIA
[jQuery] Re: Set Div Width
aehm, try this: ...).children('div').css( {width: '80px'} ); On 22 Mai, 14:21, SamCKayak [EMAIL PROTECTED] wrote: I'm setting the width of a DIV using: ...).children('div').attr( {width: ('80px'} ); It seems to have no effect (I have margin:0 auto; set in CSS). The rendered (view/generated source) shows: div width=80 which isn't what I had expected. I know that: div style=width:80px will work fine. Is there a better way to set the width of a block element? Sam
[jQuery] Re: Tabs Plugin - Hiding all Tabs at startup
hm, :-/ sad to hear. do you have any suggestions how to do this in a quick and dirty version? thanks! On 14 Mai, 19:04, Klaus Hartl [EMAIL PROTECTED] wrote: tobaco wrote: hi there, is it possible to hide all tab-container at start-up and also not select the current tab in the navigation? thanks! no, unfortunatly this is not supported right now. it's on the plate vor Version 3 though, but in the light of my current workload this won't happen anytime soon. -- klaus