[jQuery] Re: Initial Setup

2009-07-03 Thread Pyrolupus

On Fri, Jul 3, 2009 at 8:51 AM, Andrew m...@andrewcampbell.us wrote:
 I'm new to JavaScript -- and cannot get jQuery to work (unless I
 access http://code.jquery.com/jquery-latest.js)
 ...
 * my hosting service does doesn't have gzip compression enabled --
 what file do I need to install on my server if I don't have GZIP
 available?

If you want/need to hotlink to jQuery on a remote server, it's
better to use ajax.googleapis.com.  For example:

http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js

That will pull the minimized (comments and whitespace stripped ==
smaller download) 1.3.2 version of jQuery from Google.  Google DOES
GZip these files, which is useful if you can't get it gzipped on your
hosting service.



[jQuery] Re: Call for contributors: A simple, fast and flexible grid/spreadsheet component.

2009-03-12 Thread Pyrolupus

Great timing!  I needed a lightweight data grid, and here you just
contributed one! ^_^  I used FlexiGrid[1] in the past, but it's
overkill for what I needed right now, plus development on it looks to
have stalled.

As I come across ways that I'd like to improve it--such as integrating
into themerolled themes--I'll submit them back to you.  Thanks!

Cheers,
Pyro

[1] http://www.flexigrid.info/


[jQuery] Re: idiot requests SIMPLE ajax explanation!

2008-06-16 Thread Pyrolupus

Have you already run through the stuff at jQuery Ajax Tutorials[1]?  I
thought that Akash Mehta's article[2] looked like a pretty good
sampling with lots of step-by-step stuff.  Older version of jQuery,
but pretty much all still applicable.

[1] http://docs.jquery.com/Tutorials#Ajax
[2] http://www.sitepoint.com/article/ajax-jquery

~Pyro

On Jun 16, 10:12 am, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
 I'm embarrassed. I used to cheerfully mix PHP with Javascript, but now
 I don't understand the terminology! I see the advantages of
 'asynchronous' data exchange and I would like some of that  but I
 can't for the life of me understand what to do!!

 Does anybody know where to find a REALLY SIMPLE, step-by-step
 explanation?

 Supposing I eventually get to grips with this, has anybody (Mike
 Alsup!) written a REALLY simple explanation of the Taconite plugin, as
 that's where I'm heading?

 Thank you [blushes]
 Cherry.


[jQuery] Re: Cornerz 0.4

2008-06-03 Thread Pyrolupus

Jonah,

I'm not sure whether this is a settings issue or a version issue, but
the demo page looks a little off on my Opera-9.27/WinXP:

http://pyrolupus.com/img/opera-9.27_cornerz.png

(Note the white curve inside the green box for Examples--all the
green boxes on the page are l like that and the box second from the
bottom (border: 1 display: inline) which has a little spillover on
the right.

Is there anything I can do to troubleshoot it?

Cheers,
Pyro

On Jun 3, 7:53 am, weepy [EMAIL PROTECTED] wrote:
 Hi

 I've just released Cornerz 0.4

 http://groups.google.com/group/cornerz

 Bullet Proof Corners plugin for jQuery using Canvas/VML

     * Antialiased
     * Fast - this pages renders in 200ms on my Vaio in Firefox and
 there's quite a few corners!!
     * Support for any size radius and border width with minimal
 performance increase
     * No excanvas
     * Current layout is maintained
     * Works with many tested positions/display/floats (current
 limitation with inline)
     * Supports fluid layouts.
     * Original div still shows through, so can easily do hover effects
     * Script is only 4.0k uncompressed
     * Requires jQuery 1.2.6+
     * Tested on :
           o IE6 XP/Vista
           o IE7 XP/Vista
           o Firefox 2 Ubuntu/Windows
           o Safari 3 Windows
           o Opera 9 Windows/Linux

       Limitations:
           o Problem with some Inline elements in IE - due to incorrect
 reporting of width
           o For IE as it cannot handle right/bottom aligned elements
 with odd (2n+1) dimensions - positioning is calculated at page load.
 If an element changes height or width - the cornerz need adding again.

 Cheers

 Jonah


[jQuery] Re: JqModal

2008-06-02 Thread Pyrolupus

If the datestamps on your posts are right, then you are complaining of
no response in under two hours?  Is that correct?  You just need to
practice a bit more patience.  Personally, I browse new posts to the
group somewhere between zero and three times per day.  I would not
expect an immediate response no matter what the formatting; calling
out the group members with sarcasm will instead have the result of
pushing people away or even getting flamed.

For jqModal[1], you need to use all three:

1. There must be an HTML page for testing/viewing the result of the
goodness.
2. That HTML page must have the CSS, either included (in a rel / tag
or a css @import directive) or inline.
3. You need jQuery, the jqModal plugin, and the doc.ready() block that
initializes the behavior for the intended elements.

Non-compliant example (paraphrase of the first example on the linked
page):

htmlheadstyle@import jqModal.css;/style/headbody
a class=jqModal href=#Whatever/a
div id=dialogBlah/div
script src=jquery.js/scriptscript src=jqmodal.js/script
script
$().ready(function() {
$('#dialog').jqm();
});
/script/body/html

~Pyro

[1] http://dev.iceburg.net/jquery/jqModal/

On Jun 2, 1:13 pm, highjo [EMAIL PROTECTED] wrote:
 am i ignored or something or what i'm aking for is so obvious that nobody
 replies to me at least one directive?
 I don't think i'm in the wrong place.
 i 'm member of differents forums and it not like this for newbies.
 tell me if i miss something or not follwing this forums rules.
 wow i'm impressed!!
 thanks anyway.



 highjo wrote:

  Hi!
  i'm new to this an quite new to programming.I can fel this is great.I'm
  from the jqModal tutorial page and i just want to try it and add it to my
  project.First i did a copy and paste but it not working.Ok i thought it's
  because i don't understand the library and i went to try another tuto like
  get started and how jquery works.It was great.
  one thing confuse me from thehttp://dev.iceburg.netpage is don't know
  which tools to use.
   i'm interested in the styling view a .don't know here to start.
  i've understood that i should have jquery (i've downloaded the
  jquery-1.2.6.js wit which i worked with the get started).
  i've downloaded the styling i mean the jqModal.css
  i've downloaded the jqModal.js
  the there are javascript,css,html code snipet for the example.
  i'm confused wich one should i use ? or should i use all of them.code
  snipet javascript + jqModal.js + jquery.js+ code snipet css+ jqModal.css
  and html or no need for jquery since jqModal is there.
  Please if any one has done it ,help me to start this interesting plugin

 --
 View this message in 
 context:http://www.nabble.com/JqModal-tp17601317s27240p17606212.html
 Sent from the jQuery General Discussion mailing list archive at Nabble.com.


[jQuery] Re: $(document).ready Events not firing on elements of code injected via ajax call

2008-05-30 Thread Pyrolupus

On May 30, 12:08 am, truent [EMAIL PROTECTED] wrote:
 Im using $(document).ready to bind an onsubmit and onclick event to 2
 elements of my form.  Either of these events fires separately with no
 problem.  However, when the onsubmit injects html into a div on page,
 and I then attempt to click on one of the newly injected elements
 expecting the onclick to fire, it doesnt.  Is there something about
 the dom not being refreshed or  $(document).ready not able to bind
 elements after the page has been loaded and new html injected?  Can I
 update the dom?  is there an even other than .ready to bind to?

You note that you have bound onclick to two elements of your form but
not that you've attempted to bind it to anything else.  I'm not sure
what events you intend to be attached to the new elements.

However, $(document).ready() only fires after the document initially
loads.  If you want to bind events DOM elements that are generated or
included after the fact, you need to either bind something to a parent
element and catch the event as it bubbles up (event delegation[1]) or
use a plugin to do that for you.  jQuery Live Query[2] is a easy,
sound way to handle that.

~Pyro

[1] http://www.learningjquery.com/2008/03/working-with-events-part-1
[2] http://brandonaaron.net/docs/livequery/


[jQuery] Re: REMINDER: jQuery Site Detection Greasemonkey Script

2008-05-30 Thread Pyrolupus

Karl, that's fantastic!  I've copied Paul's script to my own site with
the title change you suggested.  I frequently wish to know what
version sites are running.

Sorry for the necropost; was searching to see if there was any talk
about updating the jQuery Detector plugin[1] to work with FF3 and
found this.

For Opera users, Paul's userscript works great in Opera (which has no
Greasemonkey--or need of it), too:

Adding user scripts to Opera:
http://www.opera.com/support/tutorials/userjs/using/#writingscripts

User scripts can be Greasemonkey (no plug-in necessary):
http://www.opera.com/support/tutorials/userjs/examples/#greasemonkey

~Pyro

[1] http://www.sunsean.com/jquerydetect/

On Apr 21, 10:30 am, Karl Swedberg [EMAIL PROTECTED] wrote:
 hey Paul,

 I love that Greasemonkey user script! Use it all the time. Thanks  
 again for making it available.

 I modified your original just a bit for my personal use, adding a  
 title attribute to the jQuery icon that tells me which jQuery version  
 is running:

 ... title=' + jQuery.fn.jquery + ' ...

 This has been really helpful for me when checking on my sites to  
 quickly determine which ones to update. Perhaps you (or others) would  
 find it useful, too.

 Cheers,

 --Karl
 _
 Karl Swedbergwww.englishrules.comwww.learningjquery.com

 On Apr 21, 2008, at 5:47 AM, Paul Bakaus wrote:



  Thanks Rey :)
  and the Firefox plugin here:http://www.sunsean.com/jquerydetect/

  On Apr 20, 10:50 pm, Rey Bango [EMAIL PROTECTED] wrote:
  Hi everyone. The number of jQuery-powered sites being listed is
  incredible and the numbers just continue to grow.

  One of the methods that I use to find sites is via jQuery Team Member
  Paul Bakaus' awesome jQuery Site Detection Greasemonkey Script.  
  It's a
  small script that detects the jQuery object and displays a small  
  icon in
  the lower-right corner of the browser if it finds a jQuery-powered  
  site.

  To install it, just follow these simple instructions:

  This is a Greasemonkey user script.  To install it, you need
  Greasemonkey 0.3 or later:http://greasemonkey.mozdev.org/

  Restart Firefox and visit this 
  script:http://paul.jquery.com/jquerydetector.user.js

  Under Tools, there will be a new menu item to Install User Script.
  Accept the default configuration and install.

  That's it!

  I want to thank Paul for this wonderful script.

  Rey...
  jQuery Project Team


[jQuery] Re: Tooltip

2008-05-30 Thread Pyrolupus

Have you seen or tried clueTip?  http://plugins.learningjquery.com/cluetip/demo/

~Pyro

On May 30, 10:22 am, armyofda12monkeys [EMAIL PROTECTED]
wrote:
 Hello all,

 I was looking at tooltip examples in Tooltip plugin and just saw all
 examples where it makes the tooltip based off the title attribute. I
 was wondering if there were any other solutions? i was using a
 prototype based solution seen 
 herehttp://blog.innerewut.de/files/tooltip/demo.html,
 where the tooltip is whatever you want it to be. So that div is hidden
 until hover over something else, so you would provide the id of the
 element to hover over, and the id of the tooltip that is shown after
 hovered over. This is nice to tooltips which are more customized.
 correct me if i'm wrong that you cant do that 
 withhttp://bassistance.de/jquery-plugins/jquery-plugin-tooltip/?

 Thanks,
 Ari


[jQuery] Re: submit a form when an image is clicked rather than using input type=submit

2008-05-28 Thread Pyrolupus

On May 28, 12:45 pm, cfdvlpr [EMAIL PROTECTED] wrote:
 I'd like to use an image to submit a form.  Is there an easy way to do
 this using jQuery?

Is there some reason you can't use input type=image /?

Alternatively,

img id=submitimg src=image.png /

::style::
#submitimg {
  cursor: pointer;
}

::onready::
$('#submitimg').click(function() {
  //submit its form
});

Pyro


[jQuery] Re: submit a form when an image is clicked rather than using input type=submit

2008-05-28 Thread Pyrolupus

Why does it take four hours for my replies to show up?  :(

On May 28, 1:31 pm, Pyrolupus [EMAIL PROTECTED] wrote:
 On May 28, 12:45 pm, cfdvlpr [EMAIL PROTECTED] wrote:

  I'd like to use an image to submit a form.  Is there an easy way to do
  this using jQuery?

 Is there some reason you can't use input type=image /?

 Alternatively,

 img id=submitimg src=image.png /

 ::style::
 #submitimg {
   cursor: pointer;

 }

 ::onready::
 $('#submitimg').click(function() {
   //submit its form

 });

 Pyro


[jQuery] Re: Select Boxes and choosing a value on page load

2008-05-22 Thread Pyrolupus

On May 22, 3:30 pm, Randy Johnson - CFConcepts
[EMAIL PROTECTED] wrote:
 I have a page that auto loads States and Cities from a database.

 When you change the state, the city name changes.

 This works fine on the page when you go to fill it out for the first time.

 What I can seem to find anywhere is how to pre select the boxes if I am
 doing an edit on the page.

 For example:

 If I fill out the form with South Carolina as the state and Myrtle Beach
 as the city, how do I go about getting the state select box to have
 South Carolina Selected, then have the city list load with the South
 Carolina Cities but have Myrtle Beach Selected.

 I will keep reading over the mailing list archives and plugins to find
 an answer, in the meantime if anyone could help me out I'd appreciate it.

Without knowing your edit sequence, this is going to be generic and
possibly not quite applicable.  In final code, I would also prefer
that things were handled by events (so that #city figured itself out
after you changed #state), but that requires more knowledge than I
have of your app in order to implement intelligently.

::html::
select id=state name=state/select
select id=city name=city/select

::script::
function loadStateCity(stateid, cityid) {
$s.val(stateid);
loadCity(stateid, cityid);
}

function loadCity(stateid, cityid) {
$c.load('getcityoptions.php?stateid=' + stateid, function() {
if (typeof cityid != 'undefined')
$('option[value=' + cityid + ']', $c).attr('selected', 
'true');
});
}

~Pyro


[jQuery] Re: Show/hide toggle hides form too...bah!

2008-05-22 Thread Pyrolupus

You need to have your event handler handle things differently
depending upon the specific child element that was clicked.

For example:

$('div#homepage_boxes div.col').click(function(event) {
var $tgt = $(event.target);
if ($tgt.not('form')) { //don't toggle when clicking the form!
$
(this).siblings('.selected').andSelf().toggleClass('selected').end().end();
}
});

See http://www.learningjquery.com/2008/03/working-with-events-part-1
for more complete coverage of this.  It's where I learned it. :)

~Pyro
On May 22, 3:55 pm, Ridge [EMAIL PROTECTED] wrote:
 I have this page:http://tinyurl.com/5hascg. I'm using JQuery for a
 few things - :hover on the main content blocks, form validation, and
 show/hide.

 By themselves, everything is working great! But it's the
 interoperability of the last two that are causing me a headache. When
 you click anywhere in the For your home box, the content appears.
 There's a form in that div. However, when you try to focus in that
 div by clicking, the form hides.

 So, what I'd like to know is how to show the div contents by
 clicking anywhere in the div, but only hide it by clicking on the
 header (which I've temporarily given a background color of green to
 make it stand out).

 For reference, here's the contents of my $(document).ready section
 which is linked from the page above. Thanks!:

 $(document).ready(function(){

    // Add class to shift background images on load
    $('#box_home').addClass('pageload');
    $('#box_business').addClass('pageload');
    $('#box_account').addClass('pageload');

    // Show/hide forms
    $('div#homepage_boxes form').hide();
    $('div#homepage_boxes div.col').click(function() {
       $
 (this).siblings('.selected').andSelf().toggleClass('selected').end().end()
          //.next('form').slideToggle('fast')
          //.siblings('form:visible').slideUp('fast');
    });

    // Add homepage box hover effect for IE6
    $('div#homepage_boxes .col').hover(function() {
       $(this).addClass('ie6boxhover');
    }, function() {
       $(this).removeClass('ie6boxhover');
    });

    // Form validation
    $.validator.setDefaults({
       submitHandler: function() { alert(submitted!); }
    });

    $(#homeform).validate({
       rules: {
          txtZipcode: {
             required: true,
             minlength: 5
          }
       },
       messages: {
          txtZipcode: {
             required: To continue processing your request, we need a
 5-digit zip code.  Please re-type the zip code of your service
 address.,
             minlength: Your zip code must be 5-digits long. Please re-
 type the zip code of your service address.
          }
       }
    });

 });


[jQuery] Re: Help getting the AJAX load() to work in Firefox

2008-05-22 Thread Pyrolupus

The simple answer is that you can't make Ajax calls to a file
resource.  Apache httpd is fairly easy to install (http://
httpd.apache.org)--or check your distro if you're running Linux.  If
you're using a pro version of Windows, you can also enable IIS or
PWS.  (There are also simpler lightweight httpd servers out there, but
I don't run those, so I can't speak for them. :-) )

There are ways to possibly get around that, but if your goal is to
test Ajax operating properly, I suggest setting up a simple web server
for your purposes.  Otherwise, you may end up expending debugging time
on something that will never come into play.

~Pyro

On May 22, 4:56 am, John [EMAIL PROTECTED] wrote:
 Hello.
 I'm fairly new to JQuery. In my learning I'm testing out very simple
 Ajax. I'm just trying to inject a small piece of HTML into a div in my
 current page.
 I get the same error every time.

 Permission denied to call method XMLHttpRequest.open
  xml.open(s.type, s.url, s.async);

 I've read several post here and I understand that this is some
 limitation of Javascript or AJAX and cross domain stuff. But that IE
 allows it. Or something to that affect.

 But I'm just trying to get it to work locally. On my computer, working
 with files in the same folder. I've haven't found any post with
 anything this simple so I'm having trouble finding a solution.

 Any help would be great. I'm just trying to learn the basics before I
 try and master using server side scripting to grab cross domain pages
 and then load them through AJAX and all that jazz.

 Here's an example:
 //     JQuery
 $(document).ready(function(){
    $(#ajax).click(function(){
      $(#text).load(a.html);
    });

 });

 !-- HTML --
 p id=ajaxAjax/p

 div id=text
 p /Hope this works
 /div

 !-- Chunk of HTML from a.html --
 p /All Kinds of Stufff
 p /More stuff


[jQuery] HotChili (Greasemonkey/userscript) breaks easing

2008-05-20 Thread Pyrolupus

I have (well, had) HotChili[1] enabled for all sites for its
convenient go-anywhere syntax highlighting ability.  Today, I tracked
a problem with one of my sites to having HotChili enabled (as a
Greasemonkey userscript) on my installation of Firefox.  I assume that
since HotChili pulls in its own copy of jQuery that it's blowing away
plugin extensions.  I presume the same could be true of other
userscripts (Firefox or Opera--can Safari/IE do userscripts?) that
pull in their own jQuery.

Text of error:

jQuery.easing[jQuery.easing.def] is not a function
http://[mydomain].com/js/lib/jquery/jquery.easing.1.3.js
Line 20

Disabling HotChili made the problem go away.
Has anyone else experienced this?  Can anyone verify or debunk me?

I don't yet know whether a userscript can check for the existence of
jQuery already in a page before trying to pull in a separate copy--
thus blowing away extensions--but that would be cool.

Cheers,
Pyro

[1] http://noteslog.com/category/hotchili/


[jQuery] Re: Traversing AJAX Response?

2008-05-20 Thread Pyrolupus

On May 20, 9:40 am, Yansky [EMAIL PROTECTED] wrote:
 How exactly does $(response).find('#mylinks') work? How does it traverse the
 dom tree if the response is just a text version of the page's html?

If response is HTML, then $(response) creates a DOM.  That's what $
(string) does with HTML (instead of a CSS selector).  E.g., $('pA
new paragraph!/p') generates a brand new paragraph element.
Reference:

http://docs.jquery.com/Core/jQuery#html

jQuery( html )
Create DOM elements on-the-fly from the provided String of raw HTML.

Cheers,
Pyro


[jQuery] Re: How to extract an object from a jQuery reference?

2008-05-20 Thread Pyrolupus

On May 20, 3:37 pm, Jerome [EMAIL PROTECTED] wrote:
 I'm not quite sure how to describe, or search for, my question in
 existing discussions.  I apologize in advance for my lack of search
 savvy.

 I understand that you can take an ordinary DOM object and create a
 jQuery reference out of it:

 var myDOMObject = document.myform.mytextfield;
 var myJQueryRef = $(myDOMObject);
 var myHtml = myJQueryRef.html();

 I know, I can chain.  But for the sake of this example, I won't.

 Is there a way to do the opposite?  An imaginary method could be:

 var extractedDOMObject = myJQueryRef.extractObject();
 var myHtml2 = extractedDOMObject.innerHTML;

 What might be used to replace the imaginary extractObject() method?

You want $.get(), which returns an array of DOM elements, or
$.get(index) which returns a single element.  If you want a single
item, then $('#objectOfMyDesire').get(0) is your method of choice.

Reference:  http://docs.jquery.com/Core/get

Cheers,
Pyro


[jQuery] Re: twitter

2008-05-20 Thread Pyrolupus

On May 20, 3:48 pm, Alexandre Plennevaux [EMAIL PROTECTED]
wrote:
 now that jquery uses twitter, i might give twitter a chance. Can you
 recommend a good way to use it? A twitter client? Which?
 i'm a bit afraid of the distraction it brings. but using it in my Greader
 is not very satisfactory. Any clue, welcomed !

I have my Twitter set up to send IMs to my Google Talk account.  Works
great.


[jQuery] Re: Ajax doesn't work on Opera Mobile(partially supports ActiveXObject)

2008-05-19 Thread Pyrolupus

Takayoshi Fujiki wrote:
 I found that Ajax function of jQuery doesn't work with Opera Mobile
 8.7(on Advanced [es] W-ZERO3), and I added a workaround for this
 problem to jQuery code as follows. Then it worked on the platform.

 --- jquery-1.2.3.orig.js  2008-05-16 16:19:36.0 +0900
 +++ jquery-1.2.3.modified.js  2008-05-16 17:28:49.0 +0900
 @@ -2658,9 +2658,7 @@

   var requestDone = false;

 - // Create the request object; Microsoft failed to properly
 - // implement the XMLHttpRequest in IE7, so we use the 
 ActiveXObject
 when it is available
 - var xml = window.ActiveXObject ? new
 ActiveXObject(Microsoft.XMLHTTP) : new XMLHttpRequest();
 + var xml = window.XMLHttpRequest ? new XMLHttpRequest() : new
 ActiveXObject(Microsoft.XMLHTTP);

   // Open the socket
   xml.open(s.type, s.url, s.async, s.username, s.password);

 It seems that Opera Mobile 8.7 supports window.ActiveXObject, but it
 doesn't not support ActiveXObject(Microsoft.XMLHTTP). So creation of
 XMLHttpRequest instance seems to be failed.

 Q1. I think that ActiveXObject is not only for XMLHTTP, so just
 checking the existence of ActiveXObject is not enough. Is there any
 reason that jQuery doesn't verify that the instance is created
 properly when creating the request object?

 Q2. Is there any way to solve this problem without modification of
 jQuery code?

 -- My Test page used for this --
 [HTML file]
 html
 head
   titlejQuery test/title
   script type=text/javascript src=./jquery.js/script
   script type=text/javascript
 $(document).ready(function(){
   $('#target').load('./test.txt');
 });
   /script
 /head
 body
 result: b id=target--/bbr /
 /body
 /html

 [test.txt]
 OK

Patch:  I believe that simply reversing the check may have similar
repurcussions on IE7 as you are seeing on Opera Mobile.  This segues
into Q1...

Q1:  You may be right, but I don't know whether there is a penalty
to attempting to instantiate an ActiveX object that is not supported
by the browser/platform.  This could be end up being one of the
unfortunate cases that requires browser sniffing.

Q2:  If your only concern is avoiding changing the core code, you
could possibly override the functionality with a plugin.

I believe this question should be submitted to the jquery-dev group;
I'm not sure whether it will reach all the necessary eyes here.

Pyro


[jQuery] Re: Load (AJAX) callback after javascript evaluations

2008-05-18 Thread Pyrolupus

On May 15, 12:44 am, jk [EMAIL PROTECTED] wrote:
 JQuery.load can receive a callback function as one of its parameters.
 According to the online docs, this function is called when theajax
 request is complete. In practice, it appears this callback is
 performed after theajaxrequest is complete and after the dom is
 inserted, but before new javascript in the HTML isevaluated. Is there
 a way to set a callback for after the javascript isevaluated?

I had to handle this just yesterday; I ended up using setTimeout() to
make it work.

In my case, I have a login form view that is intended to be as
portable as possible.  It allows the including page to perform its own
actions after the login is successfully completed.  To accomplish
this, it executes a loginComplete() method that is supposed to be set
by its parent page.  My quandary as it relates to you is that I can't
override loginComplete() until it exists!

So, loginform.js has a LoginForm namespace with the loginComplete()
function:

var LoginForm = {   //page namespace
username: function() {
return $('#loginform_user').val();
},
loginComplete: function() { //override by parent page
alert('login OK');
}
}
// this should be moved into the LoginForm namespace...
function loginSuccess(responseText, statusText)  {
if (responseText == 'OK') {
LoginForm.loginComplete();
}
}



While main.js loads and overrides the login completion method:

//$div = jQuery(div where the login form resides);
$div.load('auth/loginform', {}, function(){
//once the loginform's scripts have been evaluated,
//set its event listener
(function setlistener() {
if (typeof LoginForm == 'undefined') {
//recurse until LoginForm is available, i.e. script 
evaluated
setTimeout(setlistener, 10);//wait 10 ms before 
trying again
} else {
LoginForm.loginComplete = function() {
$main.before($loaddiv); //show loading spinner
$div.hide('slow');  //hide login form
$main.load('http://localhost/wdm/home/wdmhome', 
{}, function() {
$loaddiv.remove();
});
}
}
})();   //immediately execute setlistener()
});

---

I edited out a bunch of additional text; hopefully the gist remains
and is useful.

Pyro


[jQuery] Re: jQuery Site Detection Greasemonkey Script

2007-11-07 Thread Pyrolupus

As a followup to my prior message about the jQuery Detect plugin for
Firefox, I do want to point out that I still use Paul Bakaus's
Greasemonkey script in Opera to great effect.

Adding user scripts to Opera:
http://www.opera.com/support/tutorials/userjs/using/#writingscripts

User scripts can be Greasemonkey (no plug-in necessary):
http://www.opera.com/support/tutorials/userjs/examples/#greasemonkey

In short, specify a userscripts directory in your JavaScript
preferences and then save the script there.  Presto!  (No restarting
the browser necessary.)

Pyro

On Nov 6, 9:57 pm, Rey Bango [EMAIL PROTECTED] wrote:
 Hi everyone. The number of jQuery-powered sites being listed is
 incredible and the numbers just continue to grow.

 One of the methods that I use to find sites is via Paul Bakaus' awesome
 jQuery Site Detection Greasemonkey Script. It's a small script that
 detects the jQuery object and displays a small icon in the lower-right
 corner of the browser if it finds a jQuery-powered site.

 To install it, just follow these simple instructions:

 This is a Greasemonkey user script.  To install it, you need
 Greasemonkey 0.3 or later:http://greasemonkey.mozdev.org/

 Restart Firefox and visit this 
 script:http://paul.jquery.com/jquerydetector.user.js

 Under Tools, there will be a new menu item to Install User Script.
 Accept the default configuration and install.

 That's it!

 I want to thank Paul for this wonderful script.

 Rey...
 jQuery Project Team



[jQuery] Re: Spam - not a complaint, more an observation

2007-11-07 Thread Pyrolupus

Whoa, hadn't noticed that.  It does explain why my messages sometimes
take an entire weekend to post, though.  :\

Pyro

On Nov 7, 10:51 am, Eric Martin [EMAIL PROTECTED] wrote:
 I see from the About this group page:
 Messages from new members are moderated

 How long is this moderation in effect? I've been posting here for a
 month or so and I think my messages are still getting moderated
 because sometimes it takes a long time for them to show up...

 Just curious ;)

 On Nov 7, 7:37 am, John Resig [EMAIL PROTECTED] wrote:

  jquery-ui is not - which is why a whole mess made it through. We'll
  have to start filtering that one as well, unfortunately.

  --John

  On 11/7/07, Michael Price [EMAIL PROTECTED] wrote:

   I've noticed a steady increase in the amount of spam coming through to
   the jQuery lists I'm subscribed to (jquery-en and jquery-ui) - this
   isn't a complaint as hitting Delete to get rid of it takes about half a
   second to do but I'd been under the impression first posts to the group
   were filtered to stop spam getting through?

   Regards,
   Michael Price



[jQuery] Re: jQuery Site Detection Greasemonkey Script

2007-11-07 Thread Pyrolupus

I rather like the jQuery Detect Firefox plugin, myself:
http://www.sunsean.com/jquerydetect/

The Greasemonkey script works great, as well.

Pyro

On Nov 6, 9:57 pm, Rey Bango [EMAIL PROTECTED] wrote:
 Hi everyone. The number of jQuery-powered sites being listed is
 incredible and the numbers just continue to grow.

 One of the methods that I use to find sites is via Paul Bakaus' awesome
 jQuery Site Detection Greasemonkey Script. It's a small script that
 detects the jQuery object and displays a small icon in the lower-right
 corner of the browser if it finds a jQuery-powered site.

 To install it, just follow these simple instructions:

 This is a Greasemonkey user script.  To install it, you need
 Greasemonkey 0.3 or later:http://greasemonkey.mozdev.org/

 Restart Firefox and visit this 
 script:http://paul.jquery.com/jquerydetector.user.js

 Under Tools, there will be a new menu item to Install User Script.
 Accept the default configuration and install.

 That's it!

 I want to thank Paul for this wonderful script.

 Rey...
 jQuery Project Team



[jQuery] $('.class1,.class2').filter(':first') always finds first .class1

2007-11-05 Thread Pyrolupus

Basically, what I want to do is find the first element that matches
either class1 OR class2.  However, using the syntax from the subject
line:

  var $jqElem = $('.class1,.class2').filter(':first');

$jqElem is always the first element that has class1 (i.e., the first
class specified), rather than the first element for the whole
selector.  E.g., using the above on the following:

  input type=text id=elem1 class=class2 /
  input type=text id=elem2 class=class1 /

it is getting elem2.

Am I using the wrong syntax?  I also tried $
('.class1').add('.class2').filter(':first'), but I get the same
result.

Thanks,
Pyro



[jQuery] Re: $('.class1,.class2').filter(':first') always finds first .class1

2007-11-05 Thread Pyrolupus

Thank you for the explanation and the suggestion, but elements are
already (potentially) sporting multiple classes, due to multiple types
of validation occurring on the fields.

Oversimplified pseudo-psuedocode example:

//
// begin code
//
if (requiredField  $.trim(requiredField.val()).length == 0) {
  requiredField.addClass('requiredFail');
  isValid = false;
}

if (emailField
  emailField.val().length  0
  !emailField.val().test(emailregex)) {
  emailField.addClass('validationFail');
  isValid = false;
}

if (!isValid) {
  //here's where we break down...
  var $firstFail = $
('.requiredFail,.validationFail').filter(':first');
  var elemOffset = $firstFail.offset().top;

  $('html,body').animate({scrollTop: elemOffset}, 400);
}
//
// end code
//

There are fields that are required, and we check them for content.
There are also fields that, if provided, must be valid content.  A few
fields fall into both categories.

I am using CSS classes to distinguish between the two to make it easy
for the designer to add new fields--just give them the required
class.  If it's an email field, put email somewhere in its ID
attribute.  Both cases get picked up, but I'm unable to get the page
to scroll to the FIRST item that matches EITHER validation failure
class (requiredFail or validationFail).

 Your issue doesn't actually have anything to do with the filter, it's
 the selection. $('.class1,.class2') selects all class1, then all
 class2.

This totally explains why I have the issue, and I thank you for
describing it.  I expected the select element statement to behave
something like, className ~= /^(?:class1|class2)$/, but it really
operates more like, (.class1).push(.class2).

Pyro

On Nov 5, 1:45 pm, Erik Beeson [EMAIL PROTECTED] wrote:
 Your issue doesn't actually have anything to do with the filter, it's
 the selection. $('.class1,.class2') selects all class1, then all
 class2. So even if class2 appears before class1, class one will still
 get selected first (since you specified it first in the selector), and
 your filter will return it.

 I suggest you apply the same class to all elements that you want to
 select from. If nothing else, you could do:

 $('.class1,.class2').addClass('class1_or_class2');
 $('.class1_or_class2').filter(':first')...;

 And that second line could be simplified to:
 $('.class1_or_class2:first')...;

 Hope it helps.

 --Erik

 On 11/5/07, Pyrolupus [EMAIL PROTECTED] wrote:



  Basically, what I want to do is find the first element that matches
  either class1 OR class2.  However, using the syntax from the subject
  line:

var $jqElem = $('.class1,.class2').filter(':first');

  $jqElem is always the first element that has class1 (i.e., the first
  class specified), rather than the first element for the whole
  selector.  E.g., using the above on the following:

input type=text id=elem1 class=class2 /
input type=text id=elem2 class=class1 /

  it is getting elem2.

  Am I using the wrong syntax?  I also tried $
  ('.class1').add('.class2').filter(':first'), but I get the same
  result.

  Thanks,
  Pyro



[jQuery] Re: [NEWS] Humanized Messages

2007-10-18 Thread Pyrolupus

I'm thinking of this as a drop-in for alert() messages, and we already
have no say where alert() places its dialog.  Impromptu, mentioned
earlier in this thread, does a great job of improving the basic
JavaScript dialogs, already, and I'm thinking of supplementing those
dialogs with these Humanized Messages for items where waiting for
user response is not desirable.

I'm thinking that short, positive messages (Comment Posted,
Record Updated) would be a great candidate for this--especially if
the start location of the dialog was tied somewhere close to the area
where action occurred (submit button, last text input, etc.).  Errors,
longer messages, and items that are more important would continue to
use the alert()-esque dialogs (a la Impromtu).

While the scenarios I describe above do not need the bouncy Log tab,
I again think this might be useful in a couple of cases:  An Ajax chat
program, when minimized, could pop up the Humanized message and
bounce the chat log in the location where it is being kept.

It has its uses, certainly.  I like it.  Just don't think of it as the
catch-all for alert()s and confirm()s, and I think you'll begin to get
some ideas on where you might use it. :)

Pyro

On Oct 17, 2:24 pm, Michael Geary [EMAIL PROTECTED] wrote:
 http://binarybonsai.com/archives/2007/10/15/humanized-messages-for-jq...

 Ugh. Am I the only one who doesn't like this user interface at all?

 I click in the middle of the screen. A message appears up at the top - where
 I'm not looking - AND another bouncy message appears at the BOTTOM of the
 screen, so it tries to draw my eye in two directions at once.

 Then, when I finally notice the message at the top, I follow my natural
 instinct and move the mouse toward it - and it immediately disappears!

 Not user friendly.

 -Mike



[jQuery] Re: Flash and jQuery

2007-10-17 Thread Pyrolupus

ActionScript (inside the Flash movie):  getURL(javascript:$('# + id
+ ').hide());

Better yet, create a hider function that does the work:

ActionScript:
getURL(javascript:hideElem(' + id + '));

JavaScript:
function hideElem(elemID) {
  //error checking, verification, etc.
  $('#' + elemID + ').hide();
}

Pyro

On Oct 16, 1:21 pm, rsmolkin [EMAIL PROTECTED] wrote:
 Hi All,

 I tried doing this

 $(document).ready(function(){
  $('#link_menu1').bind('click', function () {
  $('#mainTable').hide();});

 });

 But it's not working.  I think Flash is still taking away the click
 event.  Can you please help me figure out how can I detect the click
 in flash and then have it call the jQuery function to hide the
 element?  I am using sIFR'd links, so somewhere in the created Flash
 movie I think I have to detect a click and then call the javascript
 function, but I have no idea how to actually do it.  Please help.

 -Roman

 On Oct 14, 2:06 pm, Pyrolupus [EMAIL PROTECTED] wrote:

  I originally thought that it was justFlashand JavaScript
  interaction, in which case you'd use the
  getUrl('javascript:yourfunc()') ActionScript statement, but it sounds
  more like you just want your previously working links to continue
  working the way you remember them.

  I skimmed the sIFR docs and found the following:

 http://wiki.novemberborn.net/sifr/FAQ#replacing-links

  That *might* answer your question, but without a code example of what
  you're trying to accomplish, I can't be sure.  If you are simply
  trying to use a link to get your show/hide behavior, then the link
  above still helps you:  essentially, you just want to wrap the sIFRed
  text/element that you want to use for show/hide functionality and then
  use that instead:

  span id=showHideThing1a class=sifrMeUgly Text to be
  Prettified/a/span

  (script area)
  sIFR.replace(sifrMe, blah, blah)  //I don't use sIFR, correct as
  necessary

  $('#showHideThing1').bind('click', function () {
myShowHideFunc(this);

  });

  So, you replace the siferMe item and bind your click event to
  showHideThing1.

  Pyro

  On Oct 14, 11:55 am, pixelwizzard [EMAIL PROTECTED] wrote:

   Hi Guys,

   Did you figure this out?

   I have a problem with links that were converted using sIFR and then I need
   to use them to do a show/hide usingjQueryand it looks likeFlashis
   stealing my click event, so the click event never gets called byjquery.

   Is there any way to getFlashto trigger the event for a specific link?

   Thanks,
   -Roman

   njsuperfreak wrote:

Sweet! Good Find Brett, and thanks Sam! I think I am definitely going
to experiment with this. looks interesting...

On Oct 4, 8:19 pm, Brett [EMAIL PROTECTED] wrote:
Interesting, I googled up and found an example of
this:http://www.quirksmode.org/js/flash_call.html

NotjQueryas such in the demo, but any function you write can refer
tojQuery.

On Oct 5, 8:10 am, Sam Sherlock [EMAIL PROTECTED] wrote:

 yourflashwould need to be wmode=transparent

 and you'd need to call a javascript function from withinflashthat in
turn
 calls the grey box function

 sincejqueryapplies the onclick event to all anchors with a class of
 greybox you'll need simluar code inside you function that you call 
 from
flash.

 getURL('javascript:callGreyboxFromFlash()');

 - S

 On 04/10/2007, njsuperfreak [EMAIL PROTECTED] wrote:

  CanFlashcommunicate withjQuery? I would like to useflashto
  interact withjQuerylike opening up a dialogbox using the greybox.js
  plugin. How would I go about doing that any ideas?

  The code is activated by the class=greybox

   --
   View this message in 
   context:http://www.nabble.com/Flash-and-jQuery-tf4569724s27240.html#a13159151
   Sent from thejQueryGeneral Discussion mailing list archive at 
   Nabble.com.- Hide quoted text -

  - Show quoted text -



[jQuery] Re: two subscriptions to the same group

2007-10-16 Thread Pyrolupus

If both email addresses are attached to the same GGroups login, you
could try unsubscribing and then resubscribing with just the one.
Alternately, set a GMail filter to trash the messages sent to one of
your addresses.

Pyro

On Oct 15, 6:50 pm, rsmolkin [EMAIL PROTECTED] wrote:
 Hi All,

 This is strange, and I am not sure how it happened, but I think
 somehow I got 2 different subscriptions to this group, one as rsmolkin
 and one as pixelwizzard.  I went to edit my membership and changed it
 to only get 1 daily e-mail, yet I am still getting every message
 posted.  Any idea how I can fix this?

 -Roman



[jQuery] Re: Get the value of a radio button ?

2007-10-16 Thread Pyrolupus

You could also use the :checked selector:

$('input[name=othersTransLink]:checked').val()

Pyro

On Oct 16, 10:11 am, Mike Alsup [EMAIL PROTECTED] wrote:
 One option would be to use the form plugin:

 var value = $('[name=othersTransLInk]').fieldValue();

 This will return the value of the selected radio.

 Mike

  I have a radio button like this one:

  input type=radio name=othersTransLink value=familiale
  class=radionbsp;Lien familiale
  input type=radio name=othersTransLink value=étroit
  class=radionbsp;Lien étroit
  input type=radio name=othersTransLink value=Intérêt direct ou
  indirect class=radionbsp;Intérêt direct ou indirect

  How can I have the value of the checked radio button ?
  Is this possible ?



[jQuery] Re: Get the value of a radio button ?

2007-10-16 Thread Pyrolupus

Dang.  I *hate* the delay that sometimes comes into play when posting
to Google Groups.  I mean, it makes it look like I ignored the fact
that there were multiple similar responses that read basically the
same.

On closer look, it appears that my response has an earlier datestamp
than many of the responses that sort higher in the thread.

Why, Google?  WHY!?  ;-)

Pyro

On Oct 16, 10:37 am, Pyrolupus [EMAIL PROTECTED] wrote:
 You could also use the :checked selector:

 $('input[name=othersTransLink]:checked').val()

 Pyro

 On Oct 16, 10:11 am, Mike Alsup [EMAIL PROTECTED] wrote:

  One option would be to use the form plugin:

  var value = $('[name=othersTransLInk]').fieldValue();

  This will return the value of the selected radio.

  Mike

   I have a radio button like this one:

   input type=radio name=othersTransLink value=familiale
   class=radionbsp;Lien familiale
   input type=radio name=othersTransLink value=étroit
   class=radionbsp;Lien étroit
   input type=radio name=othersTransLink value=Intérêt direct ou
   indirect class=radionbsp;Intérêt direct ou indirect

   How can I have the value of the checked radio button ?
   Is this possible ?



[jQuery] Re: Flash and jQuery

2007-10-15 Thread Pyrolupus

I originally thought that it was just Flash and JavaScript
interaction, in which case you'd use the
getUrl('javascript:yourfunc()') ActionScript statement, but it sounds
more like you just want your previously working links to continue
working the way you remember them.

I skimmed the sIFR docs and found the following:

http://wiki.novemberborn.net/sifr/FAQ#replacing-links

That *might* answer your question, but without a code example of what
you're trying to accomplish, I can't be sure.  If you are simply
trying to use a link to get your show/hide behavior, then the link
above still helps you:  essentially, you just want to wrap the sIFRed
text/element that you want to use for show/hide functionality and then
use that instead:

span id=showHideThing1a class=sifrMeUgly Text to be
Prettified/a/span

(script area)
sIFR.replace(sifrMe, blah, blah)  //I don't use sIFR, correct as
necessary

$('#showHideThing1').bind('click', function () {
  myShowHideFunc(this);
});

So, you replace the siferMe item and bind your click event to
showHideThing1.

Pyro

On Oct 14, 11:55 am, pixelwizzard [EMAIL PROTECTED] wrote:
 Hi Guys,

 Did you figure this out?

 I have a problem with links that were converted using sIFR and then I need
 to use them to do a show/hide using jQuery and it looks like Flash is
 stealing my click event, so the click event never gets called by jquery.

 Is there any way to get Flash to trigger the event for a specific link?

 Thanks,
 -Roman



 njsuperfreak wrote:

  Sweet! Good Find Brett, and thanks Sam! I think I am definitely going
  to experiment with this. looks interesting...

  On Oct 4, 8:19 pm, Brett [EMAIL PROTECTED] wrote:
  Interesting, I googled up and found an example of
  this:http://www.quirksmode.org/js/flash_call.html

  Not jQuery as such in the demo, but any function you write can refer
  to jQuery.

  On Oct 5, 8:10 am, Sam Sherlock [EMAIL PROTECTED] wrote:

   your flash would need to be wmode=transparent

   and you'd need to call a javascript function from within flash that in
  turn
   calls the grey box function

   since jquery applies the onclick event to all anchors with a class of
   greybox you'll need simluar code inside you function that you call from
   flash.

   getURL('javascript:callGreyboxFromFlash()');

   - S

   On 04/10/2007, njsuperfreak [EMAIL PROTECTED] wrote:

Can Flash communicate with jQuery? I would like to use flash to
interact with jQuery like opening up a dialogbox using the greybox.js
plugin. How would I go about doing that any ideas?

The code is activated by the class=greybox

 --
 View this message in 
 context:http://www.nabble.com/Flash-and-jQuery-tf4569724s27240.html#a13159151
 Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: Flash and jQuery

2007-10-11 Thread Pyrolupus

Roman,

The fact that you can call any JavaScript function from within Flash
implies that it is indeed possible.  Assuming for the sake of this
example that your links are identified with id attributes:

(flash)==triggerFromFlash(linkID);

function triggerFromFlash(id) {
$('#' + id).click();
}

Depending upon what your links are doing, it may also make more sense
to bypass the click() event and just do what you want done, e.g.,

location.href = $('#' + id).attr('href');

Pyro

On Oct 11, 12:49 pm, rsmolkin [EMAIL PROTECTED] wrote:
 Hi Guys,

 Did you figure this out?

 I have a problem with links that were converted using sIFR and then I
 need
 to use them to do a show/hide using jQuery and it looks like Flash is
 stealing my click event, so the click event never gets called by
 jquery.

 Is there any way to get Flash to trigger the event for a specific
 link?

 Thanks,
 -Roman

 On Oct 5, 10:51 am, njsuperfreak [EMAIL PROTECTED] wrote:

  Sweet! Good Find Brett, and thanks Sam! I think I am definitely going
  to experiment with this. looks interesting...

  On Oct 4, 8:19 pm, Brett [EMAIL PROTECTED] wrote:

   Interesting, I googled up and found an example of 
   this:http://www.quirksmode.org/js/flash_call.html

   NotjQueryas such in the demo, but any function you write can refer
   tojQuery.

   On Oct 5, 8:10 am, Sam Sherlock [EMAIL PROTECTED] wrote:

yourflashwould need to be wmode=transparent

and you'd need to call a javascript function from withinflashthat in 
turn
calls the grey box function

sincejqueryapplies the onclick event to all anchors with a class of
greybox you'll need simluar code inside you function that you call from
   flash.

getURL('javascript:callGreyboxFromFlash()');

- S

On 04/10/2007, njsuperfreak [EMAIL PROTECTED] wrote:

 CanFlashcommunicate withjQuery? I would like to useflashto
 interact withjQuerylike opening up a dialogbox using the greybox.js
 plugin. How would I go about doing that any ideas?

 The code is activated by the class=greybox



[jQuery] LearningJQuery Demo page suggestion: parse hash

2007-10-10 Thread Pyrolupus

Karl et al,

I just tried to link directly to the examples tab of the demo page for
ClueTip.  Unless there's a trick that I don't know about (and please
educate me, if that's the case!), there's no way to do that.

May I suggest using location.hash in demo.js to see if it matches any
of the hrefs in #navigation a and navigating to the appropriate
tab?  Maybe:

if ($('#navigation [EMAIL PROTECTED]' + location.hash + ']').length  0) {
   $('#navigation [EMAIL PROTECTED]' + location.hash + ']').click();
}

That would allow, e.g., 
http://plugins.learningjquery.com/cluetip/demo/#examplesection
to work as expected.

Just a thought,
Pyro



[jQuery] Re: ClueTip: Nice work, Karl!

2007-10-10 Thread Pyrolupus

It's easy to test (I just did so in IE7).  More difficult than when
able to use FireBug, but we get by.  ;-)

Browse to http://plugins.learningjquery.com/cluetip/demo/ and click on
the Examples tab.  (Sorry don't know how to link directly to
Examples--or if it is even possible.)  Once you're looking at that
page, paste the following into the address bar:

javascript:alert($('a.basic:first').after('select id=selma
name=selmaoptionblueoptionblack/select'));

That needs to be on one line--and it will likely get broken up in
transit.  The alert() is simply to prevent IE from displaying [Object
object] (the return value for $.after()) all by itself in the document
area after adding the select element.

That script line will add a select dropdown right after the
simplest example there is link, and then hovering over that link
will put the ClueTip window right above the newly-added dropdown.

Presto!  Insta-test.  ^_^

HTH,
Pyro

On Oct 10, 11:57 am, Joel Noble [EMAIL PROTECTED] wrote:
 Question I didn't see answered on the clueTip site: do clueTips
 have a problem when appearing on top of form elements (particularly
 select drop-downs) in IE 6?

 The Interface tooltips I'm using seem to appear behind certain
 form elements in IE, and the workaround suggested on this list for
 the general problem I haven't been able to make work with the
 tooltips (probably because they don't exist yet at page load time,
 but maybe it's more subtle than that.)

 I'd happily switch tooltip methods if there was a well-regarded
 library that didn't have this problem!

 Thanks!

 On Wed, Oct 10, 2007 at 11:07:28AM -0400, Karl Swedberg wrote:
   Hey Rick,

   Thanks a lot! Wow, that totally made my day.

   I'm just about ready to post another revision to the plugin's project page
   and write up a little blog entry on it. I've received excellent feedback
   from a lot of people and have tried to incorporate as many of their
   requests. Special thanks to Hector Santos (aka Pops) for all the recent
   suggestions and code snippets.

   --Karl
   _
   Karl Swedberg
   www.englishrules.com
   www.learningjquery.com

   On Oct 10, 2007, at 5:29 AM, Rick Faircloth wrote:

   Just wanted to say that I?ve just now had another look at

   clueTip since I used it a couple of months back.

   I wanted to say, Karl, that I?m impressed!  Although I haven?t

   put the new version to use, just reading over the docs

   leaves me impressed with all the new features.

   There are a ton of options!

   I?m sure I?ll get a lot of use out of this plug-in!

  http://plugins.learningjquery.com/cluetip/demo/

   Thanks for all the hard work!

   Rick



[jQuery] Re: ANNOUNCEMENT: Chili 1.9 much faster

2007-09-27 Thread Pyrolupus

Hey! When're you going to update Chili Central[1] with the new link?
^_^

Pyro

[1] http://noteslog.com/chili/



[jQuery] Re: How to use google group ?

2007-09-25 Thread Pyrolupus

On Sep 25, 5:43 am, Fabrizio [EMAIL PROTECTED] wrote:
 I try to use this google group and it's the first time I use a google
 group. I wrote 3 differents message. I have a reply on only one of
 this but I never seen my new message on the list of the discussion.

 If some body could help to teacth me how the group and the discussion
 works ?

 I m French so if a frenchy could reply just one time in french i'll be
 very glad !!!

Sorry, no sprecken ze French, but:

Google Groups take some time--somewhere between a few minutes to a few
hours to never--to post your message.  It's slow, but it's free.

One of the jQuery users has started a forum at http://jqueryhelp.com/
- it doesn't have a whole lot of activity, yet, but it only started.
However, I have yet to see an unanswered post on there.

Pyro

Pyro



[jQuery] Re: multiple select box to textarea

2007-09-18 Thread Pyrolupus

On Sep 18, 9:33 am, FrankTudor [EMAIL PROTECTED] wrote:
 var s = $('select').serializeArray(), t = [];
 $.each(s,function(n,v){ t[t.length]=v.value; });
 $('textarea').val(t.join('\n'));

 Hi I understand maybe 40 percent of the above code. Can someone
 explain it? What does the brackets mean the []  brackets.

Brackets are used in this context as an array literal:

var arrayVar = [];  //initialize arrayVar as an array.
 //  Cheaper/faster than var arrayVar = new Array();
var newVar = [1, 1, 2, 3, 5, 8];  //init array with values

 And can someone tell me what is happening in the
 $.each(s,function(n,v)  what's happening here.

$.each(obj, func)  applies func() to each obj.

http://docs.jquery.com/Core/each#callback
Execute a function within the context of every matched element.

 also the t[t.length]=v.value;  what is happening here.

Array.length is one more than the last index.  Thus,
 arrayVar[arrayVar.length] = val
has the effect as
 arrayVar.push(val)
(I.e., it appends an item onto the array.)

 and finally
 the t.join \n is that adding a carriage return or something?

array.join(joinChar) returns a string, with joinChar between each of
the elements.  E.g., arrayVar.join('\n') returns a string with each
element of arrayVar separated by a newline.

Cheers,
Pyro

 On Sep 18, 2:16 am, Wizzud [EMAIL PROTECTED] wrote:

  This will put all selects (just selected values, no names) into textarea...
var s = $('select').serializeArray(), t = [];
$.each(s,function(n,v){ t[t.length]=v.value; });
$('textarea').val(t.join('\n'));

  FrankTudor wrote:

   Hi all,

   I am creating a little tool that has two multiple select boxes and
   then a text area.  I need to figure out how to take the selected
   conets of one box, or the other, or both and pop them to the textarea.

   If there are no examples can someone tell me what dom or events I need
   to be looking at?

  --
  View this message in 
  context:http://www.nabble.com/multiple-select-box-to-textarea-tf4469504s15494...
  Sent from the JQuery mailing list archive at Nabble.com.



[jQuery] Re: Using wrap() and then removing the wrapped element without removing the children

2007-09-13 Thread Pyrolupus


On Sep 12, 10:43 pm, Richard D. Worth [EMAIL PROTECTED] wrote:
 On 9/12/07, Richard D. Worth [EMAIL PROTECTED] wrote:

  On 9/12/07, Pyrolupus [EMAIL PROTECTED] wrote:

   Also, children() is not the right method.  I should have originally
   said find('*').  children() is only for immediate descendants, while
   find('*') gets them all.

  children() is fine here because as you get the immediate children and
  move/remove them, their contents/descendant elements come with them.

 Not only is children() fine, but find('*') won't do at all, as it will
 flatten all the descendants into one selection set and they'll all be
 inserted at the same level.

Thank you for the pointers!

Pyro



[jQuery] Re: NEWS: jQuery 1.2 Released

2007-09-12 Thread Pyrolupus

Peter,

On Sep 11, 5:57 pm, Peter Bengtsson [EMAIL PROTECTED] wrote:
 Do I need the XPath Compatibility Plugin to do
 $('[EMAIL PROTECTED]file]') or does the deprecation only apply to
 $('[EMAIL PROTECTED]')?

1) It's only deprecated, not removed, so it will continue to work even
without the XPath Plugin.

2) John noted earlier in this thread that the 1.2 implementation just
ignores the @:

On Sep 11, 10:28 am, John Resig [EMAIL PROTECTED] wrote:
 Yep, it's still just deprecated in 1.2. If you provide an extra @, we
 just ignore it and treat it like a normal attribute selector.

Pyro



[jQuery] Re: Superfish plugin fix for jQ1.2

2007-09-12 Thread Pyrolupus

On Sep 11, 7:17 pm, Joel Birch [EMAIL PROTECTED] wrote:
 On 9/12/07, sozzi [EMAIL PROTECTED] wrote:

  No biggie but I might as well save someone a few grey hair.

 Hey thanks for working this out for me. I am planning on debugging
 Superfish for jQuery 1.2 very soon so it's nice to know it seems to
 work after that small change. I'm kind of surprised that is the only
 change needed to tell the truth. Thanks.

Joel,

Wanted to highlight one of the other items in case you missed it:

On Sep 11, 4:35 pm, sozzi [EMAIL PROTECTED] wrote:
 After spending 30 minutes ruling out all other possibilities and a few
 broken gt(0) etc..

Sounds like there's the two XPath references PLUS a few gt(0)'s.

Pyro



[jQuery] Re: Visual jQuery

2007-09-12 Thread Pyrolupus

Yeah...but...

We're currently working on new tools to convert the documentation
into the old XML format (so that sites like Visual jQuery can be
updated for 1.2).

It's just what the man said.  I guess it'd be nice for said output to
be generated and then linked on jquery.com, though.

Pyro

On Sep 11, 3:59 pm, JeffG [EMAIL PROTECTED] wrote:
 On Sep 11, 12:07 pm, Stosh [EMAIL PROTECTED] wrote:



  On Sep 11, 11:22 am, Pyrolupus [EMAIL PROTECTED] wrote:

   All documentation has now been moved out of the jQuery internal code
   and onto the jQuery Documentation Wiki. We're currently working on new
   tools to convert the documentation into the old XML format (so that
   sites like Visual jQuery can be updated for 1.2).

   We'll be sure to let everyone know when that move is complete.

   Sounds like it'll take a bit before it's updated.

  What's the rationale here?  Seems like a shame.  When I'm on the road
  traveling and working I don't always have a net connection and love
  being able to just open the source.  I really hope standardize offline
  docs compatible with the wiki become available and a priority.  The
  docs are a big advantage of using jQuery.

 +1, having an xml file of the docs also makes it easier for people to
 support jQuery in things like dashboard widgets and editors like
 Komodo.

 JeffG



[jQuery] Re: Learning JQuery book typo: plugins repo URL is 404

2007-09-12 Thread Pyrolupus

Karl,

I think that part of what Stephen was suggesting is that the webmaster
for jquery.com symlink (or rewrite or whatever) Plugins to
plugins/ so that the URL inside the printed book will work for its
readers.

Pyro

On Sep 11, 8:34 pm, Karl Swedberg [EMAIL PROTECTED] wrote:
 Thanks a lot, Stephan, for the note. I will send this on to the
 publisher.

 In the future, you can report errata directly at Packt's web 
 site:http://www.packtpub.com/support/book/jQuery

 Also, I'm keeping an informal list of errata on the book's companion
 site at:http://book.learningjquery.com/forums/

 Cheers,

 --Karl
 _
 Karl Swedbergwww.englishrules.comwww.learningjquery.com

 On Sep 11, 2007, at 6:02 PM, Stephan Beal wrote:



  Hiya!

  i'm not sure where to post bugs related to the Learning jQuery book,
  so i'll drop it here:

  Page 309 says:

  The jquery.com Plugin Repository athttp://jquery.com/Plugins/
  is a
  great place
  to start when looking for documentation.

  That URL is a 404, though - plugins should be lower-case.

  Perhaps the webmaster can adjust for that, rather than waiting on the
  next edition of the book.

  :)



[jQuery] Re: Using wrap() and then removing the wrapped element without removing the children

2007-09-12 Thread Pyrolupus

On Sep 11, 7:06 pm, Joan Piedra [EMAIL PROTECTED] wrote:
 Hmm.. Can't you clone the nodes and then just remove the _old_ parent div?

Sure, but if I'm not mistaken, using clone() is more expensive:  it
creates copies of everything just to subsequently remove the
originals.  By using children(), we just work with the same number of
DOM elements, just change their root.  (This is based on an untested
assumption that the browser is re-linking existing items, not doing
its own internal clone-then-delete type behavior.)

In either case, though, the old parent div does get removed.

Pyro


 On 9/11/07, Pyrolupus [EMAIL PROTECTED] wrote:

  On Sep 11, 3:03 pm, Brook Davies [EMAIL PROTECTED] wrote:
   Easy Question I think. If I use (from Jquery 1.2):

   $(#myElem).wrapAll(div id='myDiv'/div);

   To wrap the div 'myDiv' around 'myElem', how can I later remove that div
   without removing the pre-existing myElem and any other contents of that
  div?

  I'm newish to jQuery, so my syntax is not the uberest, but something
  like the following would work:

  $('div#myDiv').after($('div#myDiv').children()).remove()

  In fact, it does work--I just tested it in FireBug.  (I just don't
  know the correct syntax to avoid referring to div#myDiv twice.)

  Pyro

 --
 Joan Piedra  ||  Frontend web developerhttp://www.justaquit.com/ ||  
 http://www.joanpiedra.com/



[jQuery] Re: jQuery 1.2 - Serialize a form as JSON

2007-09-12 Thread Pyrolupus

In testing Chistoph's code, I encountered a separate but possibly
related issue:  serialize() and serializeArray() are returning things
I did not expect for multiple selects.  For the following form:

form id=mydForm
select id=myd name=myd multiple
option value=blackBlack/option
option value=blue selectedBlue/option
/select
/form

Calling  $('form#mydForm').serialize() returns:

myd=0

Am I doing something wrong as well (besides my old-timey no-value
multiple and selected attributes--though proper XHMTL gives the
same result), or should this be posted to -dev as a bug?

Pyro

On Sep 12, 4:20 am, Christoph Roeder [EMAIL PROTECTED]
wrote:
 Hello,

 I'm trying to serialize a form with select-fields defined as multiple,
 e.g.:
 ~
 select multiple=multiple name=test[]
 option value=one selected=selectedOne/option
 option value=twoTwo/option
 option value=three selected=selectedThree/option
 /select
 ~

 When I now try this:

 ~
 $(select).serialize();
 ~

 or this:

 ~
 $(select).serializeArray();
 ~

 I get an empty string resp. array.

 But I should get this:

 ~
 test[]=onetest[]=three
 ~

 resp. this:

 ~
 {
   test: [one, two]}

 ~

 Whats wrong with my code?

 PS: I'm currently using Prototype with PHP in the backend, there it
 just works fine.



[jQuery] Re: NEWS: jQuery 1.2 Released

2007-09-11 Thread Pyrolupus

On Sep 11, 12:06 am, John Resig [EMAIL PROTECTED] wrote:
 jQuery 1.2 has been released!

 Full release notes and download 
 information:http://docs.jquery.com/Release:jQuery_1.2

  $([EMAIL PROTECTED]) XPath Attribute Selector
  Note: While this selector is being deprecated in this release, it
will not be removed in jQuery 1.2.

Under Selectors at 
http://docs.jquery.com/Release:jQuery_1.2#Removed_Functionality
- I would edit the text, but I'm not sure what the correct wording
should be here.  It was deprecated in 1.1.4 and is still deprecated
but not removed, right?

Aw, it's a wiki--I went ahead and changed it.  Fix it better if need
be.  ;-)

Pyro



[jQuery] Re: NEWS: jQuery 1.2 Released

2007-09-11 Thread Pyrolupus

One questions about new functionality, specifically .val():

http://docs.jquery.com/Release:jQuery_1.2/Attributes

When accessing a checkbox or radio button with a value attribute,
does val() return its checked state, its value attribute, both its
value and its checked state, or its value attribute only if
checked=true?

I.e., input type=checkbox id=chkMe1 value=Check 1 /
  vs. input type=checkbox id=chkMe2 value=Check 2 checked /
  vs. input type=checkbox id=chkMe3 /
  vs. input type=checkbox id=chkMe4 checked /

Along the same lines, how will the new .serialize()
and .serializeArray() handle the same situations?

Cheers,
Pyro



[jQuery] Re: Visual jQuery

2007-09-11 Thread Pyrolupus

 Is there an update for Visual jQuery (http://visualjquery.com/
 1.1.2.html), or is it always up to date with the latest version of
 jQuery? Or has it merely been left to die? :-(

From http://docs.jquery.com/Release:jQuery_1.2/Internals

All documentation has now been moved out of the jQuery internal code
and onto the jQuery Documentation Wiki. We're currently working on new
tools to convert the documentation into the old XML format (so that
sites like Visual jQuery can be updated for 1.2).

We'll be sure to let everyone know when that move is complete.

Sounds like it'll take a bit before it's updated.

Pyro



[jQuery] Re: IE 7(mostly likey all 6 too) issue with added content with javascript dynamically

2007-09-11 Thread Pyrolupus

Since I don't see anything actually creating the tabset elements, I am
working on the assumption that TabSet.makeTabs() is utilizing
document.write() to do its work (like Thawte's script in my example).

---
div id=tabset/div

script type=text/javascript
function createTabset() {
var tabs = new TabSet();

tabs.addTab('Prices', '?=$prices_table?',
'tabs_price_normal', 'tabs_price_highlight');
tabs.addTab('Ratings', '?= $ratings; ?');
tabs.addTab('Photos', '?= $slides; ?');

tabs.makeTabs('tabs_?= $hotel-table_id; ?');
}//createTabset()

function sortStuff() {
$('div#tabset').empty();//clear existing tabset

//do your sorting
//...

//rereate tabset in its div
createTabset();
}//sortStuff()

//document ready statements
$(function() {
//replace doc.write() to work with external object's method
document.write = (function () {
for (var i = 0; i  arguments.length; i++) {
$('div#tabset').append(arguments[i]);
}
});

//create tabset in its div
createTabset();
});//$.ready()
/script
---

One gotcha is that the overridden document.write() will now append to
that one div for everything that calls it on this page.

This may serve as a starting point, however.

Pyro

 div class=tabset
 script type=text/javascript
 //![CDATA[
 try {
 var tabs = new TabSet();

 tabs.addTab('Prices', '?=$prices_table?',
 'tabs_price_normal', 'tabs_price_highlight');
 tabs.addTab('Ratings', '?= $ratings; ?');
 tabs.addTab('Photos', '?= $slides; ?');

 tabs.makeTabs('tabs_?= $hotel-table_id; ?');

 } catch (e) {
 alert(e);
 }
 //]]
 /script
 /div

 This code loads fine and the tabs stuff(not my javscript code) creates divs
 with content in them.  In the sort I sort that data i need to and this block
 of code is part of a big div that get reordered.  At first when i was doing
 this, after reordering the links for the tabs were messed up.  So now what i
 am doing is when i reorder, i remove the html content this javascript create
 so that it can recreate it will the correct linking.  This works fine in FF
 but when i tried it is IE, the javascript code does not seem to be running
 because it is not recreating the tab divs and stuff.  This is the best i can
 explain it and the most code i can show, if it is not enough then i am
 sorry.  Worst case is i have to reload the page to sort.



 Pyrolupuswrote:

  Can you give a code example or a more precise description of your
  issue?

  I had to overcome a remote script's use of document.write(), but it
  works properly in all the browsers I test (FF 2, Saf 3, Op 9, IE 6/7):

 http://pyrolupus.com/demo/thawte.html

  In it, a remote script changes the contents of a div.  However, I
  don't know if this applies to your problem.

  Pyro

  On Sep 10, 2:04 pm, Eridius [EMAIL PROTECTED] wrote:
  That that is not the issue.  it is not on an event, just plain javascript
  that should when it is parsed.

  Glen Lipka wrote:

   Have you tried the Live jQuery plugin?  I'm not sure if this is
  applicable
   for your needs.

   Glen

   On 9/10/07, Eridius [EMAIL PROTECTED] wrote:

   I have a script that reorder some content an this content includes
   javascript
   that runs.  I basically take the html/javscript text and put it into a
   variable in the correct order and then i empty out the current content
   and
   replace is with the new content.  Now if FF, this works fine because
  the
   javscript gets ran when i load the content dynamically but in IE 7 the
   javscript does not seems to get run and was wondering if this is an
  issue
   known about IE?



[jQuery] Re: Using wrap() and then removing the wrapped element without removing the children

2007-09-11 Thread Pyrolupus

On Sep 11, 3:03 pm, Brook Davies [EMAIL PROTECTED] wrote:
 Easy Question I think. If I use (from Jquery 1.2):

 $(#myElem).wrapAll(div id='myDiv'/div);

 To wrap the div 'myDiv' around 'myElem', how can I later remove that div
 without removing the pre-existing myElem and any other contents of that div?

I'm newish to jQuery, so my syntax is not the uberest, but something
like the following would work:

$('div#myDiv').after($('div#myDiv').children()).remove()

In fact, it does work--I just tested it in FireBug.  (I just don't
know the correct syntax to avoid referring to div#myDiv twice.)

Pyro



[jQuery] Re: IE 7(mostly likey all 6 too) issue with added content with javascript dynamically

2007-09-10 Thread Pyrolupus

Can you give a code example or a more precise description of your
issue?

I had to overcome a remote script's use of document.write(), but it
works properly in all the browsers I test (FF 2, Saf 3, Op 9, IE 6/7):

http://pyrolupus.com/demo/thawte.html

In it, a remote script changes the contents of a div.  However, I
don't know if this applies to your problem.

Pyro

On Sep 10, 2:04 pm, Eridius [EMAIL PROTECTED] wrote:
 That that is not the issue.  it is not on an event, just plain javascript
 that should when it is parsed.



 Glen Lipka wrote:

  Have you tried the Live jQuery plugin?  I'm not sure if this is applicable
  for your needs.

  Glen

  On 9/10/07, Eridius [EMAIL PROTECTED] wrote:

  I have a script that reorder some content an this content includes
  javascript
  that runs.  I basically take the html/javscript text and put it into a
  variable in the correct order and then i empty out the current content
  and
  replace is with the new content.  Now if FF, this works fine because the
  javscript gets ran when i load the content dynamically but in IE 7 the
  javscript does not seems to get run and was wondering if this is an issue
  known about IE?



[jQuery] [RESOLVED] Adding a Remote Script that Adds an Image (Thawte)

2007-09-03 Thread Pyrolupus

   I have a site that uses aThawtecertification image, but the
   image shows up slowly at times thatThawte'sserver is
   feeling under the weather.  Since I have no control over
   their script or their server-- and since the image's current
   position is mid-page--I'd like to be able to just put in a
   placeholder and then load it after the rest of the page is
   done.  (Presently, it can delay the page's loading.)

   I've dummied up a couple of pages to show what's happening.
   (So far, I've only tested in FF 2.0.0.6.)

  http://dreamwolf.us/demo/jqscript.php
  http://dreamwolf.us/demo/jqscript_button.php

(Note that these two pages may be recommissioned in the future.  See
updated, semi-permanent URL below.)

  One thing you could do is replace document.write with your own version that
  uses jQuery or other methods to insert the image dynamically:

 document.write = function( text ) {
// do your own stuff here
 };

  The document.write call at the end would be easy because it's self
  contained. Just call $(something).append() or the like with that text. The
  three calls in a row for IE would be a little trickier - you could save the
  text for each call as you receive it, and then when you get the ending
  document.write(/div); slap them together and do an append() or whatever.

Got it working.  I tried a couple of different things, but here's the
one that finally worked.  In my page, I have a div with a script
descendant:

div id=thawtescript type=text/javascript/script/div

and the following JavaScript:

$(function() {
//this line just replaces the entire document with the Thawte image:
//$('div#thawte  script').attr('src', 'https://siteseal.thawte.com/
cgi/server/thawte_seal_generator.exe');

//replacement doc.write() for use on closed doc
document.write = (function () {
for (var i = 0; i  arguments.length; i++) {
$('div#thawte').append(arguments[i]);
}
});

//thawte's script calls doc.write() to do its work; will now append
to the
//appropriate div instead of replacing the document
$('#thawte  script').attr('src', 'https://siteseal.thawte.com/cgi/
server/thawte_seal_generator.exe');
});

That may wrap funny, but you can see the working code in my demos
area:

http://dreamwolf.us/demo/thawte.html

Thanks for pointing me in the right direction, Mike.  What I did wrong
in my first attempt:  I tried to play nice by replacing the original
document.write() after the call to the thawte script.  However, that
replacement appears to have taken place prior to the completion of the
remote script.  Removing that call solved the issue, but I'm not sure
why, exactly.

Pyro



[jQuery] Re: Some jQuery Questions

2007-09-01 Thread Pyrolupus

On Aug 31, 5:26 pm, Michael Geary [EMAIL PROTECTED] wrote:
  Mark Gibson wrote a lightweight jQuery plugin with $.toJSON() and
  $.parseJSON():
 http://jollytoad.googlepages.com/json.js

 Actually, Douglas JSON Crockford wrote the original code, so it's been
 well tested and proven:

 http://www.json.org/js.html

 Unfortunately, Doug's original code adds the toJSON and parseJSON to
 Object.prototype, which breaks jQuery and a lot of other code. Mark changed
 them into standalone functions (in the jQuery/$ namespace), making the code
 compatible with jQuery. (Thanks, Mark!)

Actually, we're currently using Crockford's json.js script as well as
a couple of XML and JSON helper objects by Yusuke Kawasaki[1].  We did
have to go back and fix all of our object iterators,
inserting .hasOwnProperty() wherever necessary.

We're enriching the client-side experience moving forward, though
(yay!), so Mark's code is something on my Implement Post Haste list
after we officially include our selected toolkits (currently MS Ajax
and jQuery).

Pyro

[1] http://www.kawa.net/xp/index-e.html



[jQuery] Re: Some jQuery Questions

2007-08-31 Thread Pyrolupus

 2)  Best way to create a toJSON() string or object.
 I didn't see a direct way to do this, if not, is this best way:
// Create JSON from form input id=wc* fields

$jj = $('[EMAIL PROTECTED]').get();
json = {};
try {
   for (var j=0; j $jj.length; j++) {
  json[$jj[j].getAttribute(name)] = $jj[j].value;
   }
} catch(e) {
  alert(EXCEPTION:\n\n+e);
  return false;
}

You need to recurse so that you can get subobjects-arrays.

Mark Gibson wrote a lightweight jQuery plugin with $.toJSON() and
$.parseJSON():

http://jollytoad.googlepages.com/json.js

I haven't tried it out, yet, but it looked good at a cursory glance.

Pyro



[jQuery] Re: Form Input Lookup

2007-08-30 Thread Pyrolupus

 1: Grab the value of a form input
 2: Grab results of a .php page via AJAX ( $.get()?? )
 3: Check through the AJAX results ( should i return the data as JSON?
 or just | it? )
 4: If there is a match / likeness for what is in the form input
 addClass('error') IF NOT addClass('accept')
...
 Thanks for the replies i am actually using the autocomplete plugin for
 my live search parts, but what im trying to create is just a lookup
 which will not return any selection values but just addClass depending
 what it finds.

When returning data that is to be used directly by JavaScript (#3
above), I always prefer JSON unless there are specific reasons to do
otherwise.  (JSON is already in a JavaScript-digestible format.)

I don't know the nature of your data or what you are trying to match,
but if it is something like

Form field:  'myentry'

And the returnData = {
 myentry: this is a real user,
 film: at eleven
}

Then:

//may have to test this slightly differently,
//i.e., if (returnData.hasOwnProperty('myentry') {...}
if (typeof returnData.myentry !== 'undefined') {
 ...addClass('returnDataMatches');..
} else {
 ...addClass('noMatchMan');
}

Pyro



[jQuery] Re: Cookie Plugin - Trying to get the values of elements in the array of cookies.

2007-08-30 Thread Pyrolupus

 I'm using the cookie plugin.  And, I have created 4 cookies with it
 and they are named [Expanded[]].

 I also keep a count of the number of cookies that have been created
 and the name of this cookie is [onExpandCount].

 How do I loop through these cookies?

 function expandMenuUsingCookie() {
 for (var index=0;index$.cookie('onExpandCount');index++) {
 //console.log(index);
 
 YAHOO.widget.TreeView.getNode('menu',$.cookie('Expanded['+index
 +']')).toggle();
 }

 }

 There's something wrong with this line right about where I try to get
 the value of the cookie:
 YAHOO.widget.TreeView.getNode('menu',$.cookie('Expanded['+index
 +']')).toggle();
You are mixing up your quotes.  Too make this work (did not test
syntax or library) and also make it a tad more readable, get your node
index before you try to access the node:

nodeIdx = $.cookie('Expanded')[index]);
...getNote('menu', $.cookie(nodeIdx))...

Note the movement of the square brackets to the outside of
$.cookie().  Having just looked through the source for
jquery.cookie.js, though (I haven't used the plugin before), I'm not
sure that it returns an array of subcookies.  You may need to
experiment with split()ing the return value to get what you're after.

Also, your loop will perform much faster if you store your array
length before starting the loop so that it's not looked up each
iteration (e.g., var arrLen = arr.length; for (var i = 0; i  arrLen; i
++) {}).[1]

Pyro

[1] http://www.thinksharp.org/?p=83



[jQuery] Adding a Remote Script that Adds an Image (Thawte)

2007-08-27 Thread Pyrolupus

I'm a complete newbie to jQuery.  I've been looking at and toying with
it for a few weeks, but this is my first real world attempt to
implement it.

I have a site that uses a Thawte certification image, but the image
shows up slowly at times that Thawte's server is feeling under the
weather.  Since I have no control over their script or their server--
and since the image's current position is mid-page--I'd like to be
able to just put in a placeholder and then load it after the rest of
the page is done.  (Presently, it can delay the page's loading.)

Currently (just for testing), I have tried placing a script block
inside an IDed div, and setting that script's src attribute, but the
entire page is replaced with the Thawte image.  Is what I'm after even
possible?  Or am I just going about it in the wrong way?

I've dummied up a couple of pages to show what's happening.  (So far,
I've only tested in FF 2.0.0.6.)

http://dreamwolf.us/demo/jqscript.php
http://dreamwolf.us/demo/jqscript_button.php

The first page tries to load the image on ready().  Since you can't
see the page after the Thawte image takes over, I created the second
page (..._button...) to execute the same process after clicking a
button.

The Secured by Thawte logo requires including a script tag with an
SRC that points to an EXE on Thawte's servers.  I presume that
Thawte's scripts use either doc.write() or add a new Image() to the
parent element.  I'm honestly not sure.

Thanks in advance,
Pyro



[jQuery] Re: Adding a Remote Script that Adds an Image (Thawte)

2007-08-27 Thread Pyrolupus

Many thanks for the redefine doc.write() suggestion!  It didn't work,
but it was certainly a good idea. ^_^

I updated http://dreamwolf.us/demo/jqscript_button.php with the
redefined document.write(), but it still does not solve the issue of
the Thawte image replacing the page.  I added a second button that
calls the altered document.write() to append some plain Jane text to
the #thawte container div (for proof of concept).  That button works
nicely in every browser I tested.

Results of the Insert Thawte button:
  IE 7:  Nothing seems to happen (throbber throbs but nothing changes)
  Firefox 2.0.0.6:  Same as before (replaces page contents with image)
  Safari 3.0.3: Same as FF
  Opera 9.10:  Works as Intended (Yay, Opera!)

Is the remote doc scoped separately?  Is document.write() semi-
protected?

Pyro

On Aug 27, 12:28 pm, Michael Geary [EMAIL PROTECTED] wrote:
 Your hunch is right: Thawte's script uses document.write, and that is what
 is causing the problem. Once the document has been closed, a new
 document.write replaces the entire document.

 If you load this page directly from the browser address bar you will see
 their JavaScript code:

 https://siteseal.thawte.com/cgi/server/thawte_seal_generator.exe

 You'll see a document.write at the end that's used for all browsers, as well
 as three document.write calls in a row that appear to have something to do
 with certain versions of IE and Windows.

 One thing you could do is replace document.write with your own version that
 uses jQuery or other methods to insert the image dynamically:

document.write = function( text ) {
   // do your own stuff here
};

 The document.write call at the end would be easy because it's self
 contained. Just call $(something).append() or the like with that text. The
 three calls in a row for IE would be a little trickier - you could save the
 text for each call as you receive it, and then when you get the ending
 document.write(/div); slap them together and do an append() or whatever.

 -Mike

  From: Pyrolupus

  I have a site that uses a Thawte certification image, but the
  image shows up slowly at times that Thawte's server is
  feeling under the weather.  Since I have no control over
  their script or their server-- and since the image's current
  position is mid-page--I'd like to be able to just put in a
  placeholder and then load it after the rest of the page is
  done.  (Presently, it can delay the page's loading.)

  Currently (just for testing), I have tried placing a script
  block inside an IDed div, and setting that script's src
  attribute, but the entire page is replaced with the Thawte
  image.  Is what I'm after even possible?  Or am I just going
  about it in the wrong way?

  I've dummied up a couple of pages to show what's happening.
  (So far, I've only tested in FF 2.0.0.6.)

 http://dreamwolf.us/demo/jqscript.php
 http://dreamwolf.us/demo/jqscript_button.php

  The first page tries to load the image on ready().  Since you
  can't see the page after the Thawte image takes over, I
  created the second page (..._button...) to execute the same
  process after clicking a button.

  The Secured by Thawte logo requires including a script tag
  with an SRC that points to an EXE on Thawte's servers.  I
  presume that Thawte's scripts use either doc.write() or add a
  new Image() to the parent element.  I'm honestly not sure.



[jQuery] Re: jQuery 1.1.4: Faster, More Tests, Ready for 1.2

2007-08-26 Thread Pyrolupus

I ran the test suite at http://jquery.com/test/ on my five browsers
(Firefox 2.0.0.6, MSIE 6, MSIE 7, Opera 9.23, and Safari (Windows)
3.0.3), and in four of them, 0 tests of 816 failed.  In Safari,
however, 0 tests of 745 failed.  What happened to the other 71
tests?

I'm new to jQuery, so perhaps this is documented, but I just don't
know where.  If so, please excuse and direct me.  ^_^

Pyro



[jQuery] Re: LavaLamp for jQuery lovers released!

2007-08-24 Thread Pyrolupus

On Aug 23, 10:16 pm, Ganeshji Marwaha [EMAIL PROTECTED] wrote:
 Yes Pops u r right... i wasn't able to test in IE 6 coz, i don't have one...

 I had to borrow my friends laptop to find out the problem after u pointed it
 out... I guess, i will try to fix it sometime tonight.

If you (or anyone) is running Windows, you can use the freely
available IE6 (or IE7) Virtual PC image directly from Microsoft.

http://go.microsoft.com/fwlink/?LinkId=70868

There are links on that page to download an IE6 or an IE7 VPC image,
as well as a hyperlink to download MS Virtual PC (also free)--required
to host the VPC images.

They're big, yes, but invaluable for cross-browser testing.

Cheers,
Pyro