Open main menu

CDOT Wiki β

BookmarkPage

Revision as of 11:28, 29 September 2006 by Melz (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Bookmark > Bookmark This Page

/extensions/cck/browser/resources/content/cckwizard/bookmark.xul

 45 <dialog id="createbookmark" title="&bookmark.label;"
 46         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
 47         buttons="accept,cancel"
 48         ondialogaccept="return OnBookmarkOK()"
 49         onload="OnBookmarkLoad();"
 50         width="500"
 51         height="200"
 52         >
 53   <script src="chrome://cckwizard/content/cckwizard.js"/>
 54   <vbox>
 55     <label>&bookmark.description;</label>
 56     <label control="bookmarkname">&bookmarkTitle.label;</label>
 57     <textbox flex="1" id="bookmarkname" onchange="bookmarkCheckOKButton();" onkeyup="bookmarkCheckOKButton();"/>
 58     <label control="bookmarkurl">&bookmarkURL.label;</label>
 59     <textbox flex="1" id="bookmarkurl" onchange="bookmarkCheckOKButton();" onkeyup="bookmarkCheckOKButton();"/>
 60     <checkbox id="liveBookmark" label="Live Bookmark"/>
 61   </vbox>
 62 </dialog>

- Defines the the Add Bookmark dialog box.

/extensions/cck/browser/resources/content/cckwizard/cckwizard.js

538 function bookmarkCheckOKButton()
539 {
540   if ((document.getElementById("bookmarkname").value) && (document.getElementById("bookmarkurl").value)) {
541     document.documentElement.getButton("accept").setAttribute( "disabled", "false" );
542   } else {
543     document.documentElement.getButton("accept").setAttribute( "disabled", "true" );  
544   }
545 }

- Enable the OK button only if the bookmark name and URL is defined.