Loading ...
Sorry, an error occurred while loading the content.

Re: [OLmws] Need help with print function

Expand Messages
  • Foteos Macrides
    ... From: Foteos Macrides To: overlibmws@yahoogroups.com Sent: Saturday, April 30, 2005 12:02 AM Subject: Re: [OLmws] Need help with print function In
    Message 1 of 17 , Apr 30 12:58 AM
    • 0 Attachment
       
      ----- Original Message -----
      Sent: Saturday, April 30, 2005 12:02 AM
      Subject: Re: [OLmws] Need help with print function
       
      <snip>
      In your wrappers for the overlib() calls via onclick, replace the return overlib(...); statements with overlib(...); return false; to ensure that the images are fully loaded despite the use of onclick.  You are not getting the image loading problem discussed in:
       
       
      because you are not including a STATUS, AUTOSTATUS or AUTOSTATUSCAP command, which cause overlib to return a value of true.  But it is better to understand that issue and set things up so that any overlib() call via onclick always will yield a return value of false.
      <snip>
      Hmm... You do have AUTOSTATUSCAP in overlib() wrappers, but are preloading the images so that they generally come from cache and you win the race condition.  But even so, it is better to force the return value of false so as to avoid the race condition.
       
      I don't offhand see a reliable way for you to include a changeBG() call in the popup's close link, but I'm still thinking about that.
       
      Fote
      --
       
    • Foteos Macrides
      ... From: Foteos Macrides To: overlibmws@yahoogroups.com Sent: Saturday, April 30, 2005 3:58 AM Subject: Re: [OLmws] Need help with print function I don t
      Message 2 of 17 , Apr 30 1:34 AM
      • 0 Attachment
        ----- Original Message -----
        Sent: Saturday, April 30, 2005 3:58 AM
        Subject: Re: [OLmws] Need help with print function
         
        I don't offhand see a reliable way for you to include a changeBG() call in the popup's close link, but I'm still thinking about that.
        OK, this works.  Where you presently define function leftOverlib(txt,cap) {...} make it:
         
        myClick = cClick;
         
        function BGcClick() {
         changeBg('#ffffff','#000000');
         myClick();
         cClick = myClick;
         return false;
        }
         
        function leftOverlib(txt,cap) {
         overlib(txt, CAPTION, cap ,CGCLASS, 'caption',
          BGCOLOR, '#000000', FGCOLOR , '#ffffff',
          BORDER, 1, TEXTPADDING,0,LEFT,WRAP,STICKY,
          CLOSETEXT,closeimg, CLOSECLICK,NOJUSTY,
          PRINT,PRINTTEXT,printimg,AUTOSTATUSCAP,
          RELX,40,RELY,20, FILTER,
          FILTERSHADOW,2,FILTERSHADOWCOLOR,'#cccccc');
         cClick = BGcClick;
         return false;
        }
         
        and get rid of the onMouseOut="changeBg('#ffffff','#000000');" in the img elements.
         
        Fote
        --
         
      • manon_purple
        Fote, thank you so much for the helpful comments! I made some quick changes on the page. http://www.purplespirit.com/overlib/ol_print.htm best wishes manon ...
        Message 3 of 17 , Apr 30 1:46 AM
        • 0 Attachment
          Fote, thank you so much for the helpful comments! I made some quick
          changes on the page. http://www.purplespirit.com/overlib/ol_print.htm

          best wishes
          manon

          --- In overlibmws@yahoogroups.com, "Foteos Macrides" <fote@m...> wrote:
          I do hope all of the present issues with that example document get
          resolved.
          >
          > Fote
          > --
        • manon_purple
          Hi Fote, just saw this comment after I did send my earlier one. Will make these changes some time later this weekend. Thank you very much for all your
          Message 4 of 17 , Apr 30 1:49 AM
          • 0 Attachment
            Hi Fote, just saw this comment after I did send my earlier one. Will
            make these changes some time later this weekend. Thank you very
            much for all your efforts!

            best wishes,
            manon
            --- In overlibmws@yahoogroups.com, "Foteos Macrides" <fote@m...>
            wrote:
            > ----- Original Message -----
            > From: Foteos Macrides
            > To: overlibmws@yahoogroups.com
            > Sent: Saturday, April 30, 2005 3:58 AM
            > Subject: Re: [OLmws] Need help with print function
            >
            > I don't offhand see a reliable way for you to include a changeBG
            () call in the popup's close link, but I'm still thinking about that.
            > OK, this works. Where you presently define function leftOverlib
            (txt,cap) {...} make it:
            >
            > myClick = cClick;
            >
            > function BGcClick() {
            > changeBg('#ffffff','#000000');
            > myClick();
            > cClick = myClick;
            > return false;
            > }
            >
            > function leftOverlib(txt,cap) {
            > overlib(txt, CAPTION, cap ,CGCLASS, 'caption',
            > BGCOLOR, '#000000', FGCOLOR , '#ffffff',
            > BORDER, 1, TEXTPADDING,0,LEFT,WRAP,STICKY,
            > CLOSETEXT,closeimg, CLOSECLICK,NOJUSTY,
            > PRINT,PRINTTEXT,printimg,AUTOSTATUSCAP,
            > RELX,40,RELY,20, FILTER,
            > FILTERSHADOW,2,FILTERSHADOWCOLOR,'#cccccc');
            > cClick = BGcClick;
            > return false;
            > }
            >
            > and get rid of the onMouseOut="changeBg('#ffffff','#000000');" in
            the img elements.
            >
            > Fote
            > --
          • Foteos Macrides
            ... From: manon_purple To: overlibmws@yahoogroups.com Sent: Saturday, April 30, 2005 4:49 AM Subject: Re: [OLmws] Need help with print function Hi Fote, just
            Message 5 of 17 , Apr 30 3:05 AM
            • 0 Attachment
              ----- Original Message -----
              Sent: Saturday, April 30, 2005 4:49 AM
              Subject: Re: [OLmws] Need help with print function
               
              Hi Fote, just saw this comment after I did send my earlier one. Will make these changes  some time later this weekend. Thank you very much for all your efforts!

              best wishes,
              manon
              Manon,
               
              Looks like you have made the additional changes, but on playing with it I found that the leftOverlib() definition needs an additional tweak for "perfection":
               
              function leftOverlib(txt,cap) {
               cClick = myClick;
               overlib(txt, CAPTION, cap ,CGCLASS, 'caption',
                BGCOLOR, '#000000', FGCOLOR , '#ffffff',
                BORDER, 1, TEXTPADDING,0,LEFT,WRAP,STICKY,
                CLOSETEXT,closeimg, CLOSECLICK,NOJUSTY,
                PRINT,PRINTTEXT,printimg,AUTOSTATUSCAP,
                RELX,40,RELY,20, FILTER,
                FILTERSHADOW,2,FILTERSHADOWCOLOR,'#cccccc');
               cClick = BGcClick;
               return false;
              }
               
              Also, do not use lead zeros in your TextStr[#] and CapStr[#] array definitions and overlib() calls because that technically makes such numbers octal and the browsers with good JavaScript Consoles will complain about TextStr[08], TextStr[09], CapStr[08], and CapStr[09] (though their "forgiving" javascript interpreters will, as you intend, treat them as decimal, i.e., TextStr[8], TextStr[9], CapStr[8], and CapStr[9]).
               
              Fote
              --
               
            • manon_purple
              Thanks very much Fote for all this work. I made the changes and am glad to understand where this illegal ECMA-262 octal constant error came from.
              Message 6 of 17 , Apr 30 6:40 AM
              • 0 Attachment
                Thanks very much Fote for all this work. I made the changes and am
                glad to understand where this 'illegal ECMA-262 octal constant'
                error came from.

                http://www.purplespirit.com/overlib/ol_print.htm

                --- In overlibmws@yahoogroups.com, "Foteos Macrides" <fote@m...> >
                > Manon,
                >
                > Looks like you have made the additional changes, but on playing
                with it I found that the leftOverlib() definition needs an
                additional tweak for "perfection":
                >
                > function leftOverlib(txt,cap) {
                > cClick = myClick;
                > overlib(txt, CAPTION, cap ,CGCLASS, 'caption',
                > BGCOLOR, '#000000', FGCOLOR , '#ffffff',
                > BORDER, 1, TEXTPADDING,0,LEFT,WRAP,STICKY,
                > CLOSETEXT,closeimg, CLOSECLICK,NOJUSTY,
                > PRINT,PRINTTEXT,printimg,AUTOSTATUSCAP,
                > RELX,40,RELY,20, FILTER,
                > FILTERSHADOW,2,FILTERSHADOWCOLOR,'#cccccc');
                > cClick = BGcClick;
                > return false;
                > }
                >
                > Also, do not use lead zeros in your TextStr[#] and CapStr[#] array
                definitions and overlib() calls because that technically makes such
                numbers octal and the browsers with good JavaScript Consoles will
                complain about TextStr[08], TextStr[09], CapStr[08], and CapStr[09]
                (though their "forgiving" javascript interpreters will, as you
                intend, treat them as decimal, i.e., TextStr[8], TextStr[9], CapStr
                [8], and CapStr[9]).
                >
                > Fote
                > --
              • Foteos Macrides
                ... From: manon_purple To: overlibmws@yahoogroups.com Sent: Saturday, April 30, 2005 9:40 AM Subject: Re: [OLmws] Need help with print function Thanks very
                Message 7 of 17 , Apr 30 9:43 AM
                • 0 Attachment
                  ----- Original Message -----
                  Sent: Saturday, April 30, 2005 9:40 AM
                  Subject: Re: [OLmws] Need help with print function
                   
                  Thanks very much Fote for all this work. I made the changes and am glad to understand where this 'illegal ECMA-262 octal constant' error came from.

                  http://www.purplespirit.com/overlib/ol_print.htm
                  Manon,
                   
                  Here's another issue brought out by your example document that is of general relevance when using DHTML popups.
                   
                  You are using onclick attributes within each img element (rather than an encasing anchor element) to invoke the popups, and are assigning the img elements classes (.thumb or .thumbb) which include a cursor:hand; rule as an indicator for the user when hovering over an image to click on it.  But hand is IE-DOM specific such that it achieves the intended cursor shape change for IE and Opera, but not browsers such as the Geckos that use the W3C-DOM standard of pointer.  The trick in such situations is to follow the class="thumb" or class="thumbb" attribute=value pair in each img element with style="cursor:pointer;" so that you create a cascade for which the one set of browsers respects one component but not the other component, and the other set of browsers behaves oppositely, but both sets of browsers do end up with a CSS rule that yields the cursor shape you desire.  Note that it doesn't matter whether the rule with hand comes before the rule with pointer in the cascade or vise versa. but only that you set up such a cascade to accommodate both types of DOM. Also note that browsers which recognize both hand and pointer will use whichever comes second in the cascade, and that's OK, too.
                   
                  Fote
                  --
                   
                • manon_purple
                  Hi Fote, indeed, should have used cursor:pointer. That works best in all browsers. Am getting a bit inattentive, working for IE only much of the time. Have
                  Message 8 of 17 , Apr 30 12:31 PM
                  • 0 Attachment
                    Hi Fote, indeed, should have used cursor:pointer. That works best in
                    all browsers. Am getting a bit inattentive, working for IE only much
                    of the time. Have changed the style rules.

                    best wishes,
                    manon


                    --- In overlibmws@yahoogroups.com, "Foteos Macrides" <fote@m...>
                    wrote:
                    classes (.thumb or .thumbb) which include a cursor:hand; rule as an
                    indicator for the user when hovering over an image to click on it.
                    But hand is IE-DOM specific such that it achieves the intended
                    cursor shape change for IE and Opera, but not browsers such as the
                    Geckos that use the W3C-DOM standard of pointer. The trick in such
                    situations is to follow the class="thumb" or class="thumbb"
                    attribute=value pair in each img element with
                    style="cursor:pointer;" so that you create a cascade for which the
                    one set of browsers respects one component but not the other
                    component, and the other set of browsers behaves oppositely, but
                    both sets of browsers do end up with a CSS rule that yields the
                    cursor shape you desire. Note that it doesn't matter whether the
                    rule with hand comes before the rule with pointer in the cascade or
                    vise versa. but only that you set up such a cascade to accommodate
                    both types of DOM. Also note that browsers which recognize both hand
                    and pointer will use whichever comes second in the cascade, and
                    that's OK, too.
                    >
                    > Fote
                    > --
                  • Foteos Macrides
                    ... From: Foteos Macrides To: overlibmws@yahoogroups.com Sent: Saturday, April 30, 2005 12:02 AM Subject: Re: [OLmws] Need help with print function ... From:
                    Message 9 of 17 , May 11, 2005
                    • 0 Attachment
                      ----- Original Message -----
                      Sent: Saturday, April 30, 2005 12:02 AM
                      Subject: Re: [OLmws] Need help with print function
                      ----- Original Message -----
                      Sent: Friday, April 29, 2005 4:44 PM
                      Subject: Re: [OLmws] Need help with print function
                       
                      That main problem in the document at the above URL is that you are invoking the popups via onclick but are including an nd() call for onmouseout.  All of your popups are sticky, and one nd() call will not close a sticky, but two will.  You get one nd() call when you leave the image on which you clicked, and may or may not get a second one depending on whether you traverse another image enroute to the popup.  So you end up with what seems like erratic closing of the popups.  Get rid of all the nd() calls, so that you close any displayed popup only via its close link or by clicking on another image to replace the displayed popup by that for the image on which you clicked.
                      Manon,
                       
                      I should mention in this thread that I got rid of the undocumented "feature" that a pair of nd() calls acted like a cClick() call, because one cannot always remove the onmouseout="nd():" from elements with onclick popups, e.g., if the element also has an onmouseover call to overlib().  For more information, see the May 9, 2005 entry in the Change History:
                       
                       
                      and Section 1 of the Command Reference:
                       
                       
                      concerning the nd() versus cClick() and nd2() versus cClick2() public functions for primary and secondary popups, respectively.
                       
                      Fote
                      --
                       
                    Your message has been successfully submitted and would be delivered to recipients shortly.