B2G/gecko/browser/components/places/content/bookmarkProperties.js
/**
   * This method should be called by the onload of the Bookmark Properties
   * dialog to initialize the state of the panel.
   */
This method should be called by the onload of the Bookmark Properties
dialog to initialize the state of the panel.
This method should be called by the onload of the Bookmark Properties dialog to initialize the state of the panel .
function BPP_onDialogLoad() {
    this._determineItemInfo();
    document.title = this._getDialogTitle();
    var acceptButton = document.documentElement.getButton("accept");
    acceptButton.label = this._getAcceptLabel();
    this._beginBatch();
    switch (this._action) {
      case ACTION_EDIT:
        this._fillEditProperties();
        acceptButton.disabled = this._readOnly;
        break;
      case ACTION_ADD:
        this._fillAddProperties();
        if (this._itemType == BOOKMARK_ITEM)
          acceptButton.disabled = !this._inputIsValid();
        break;
    }
    if (!this._element("tagsRow").collapsed) {
      this._element("tagsSelectorRow")
          .addEventListener("DOMAttrModified", this, false);
    }
    if (!this._element("folderRow").collapsed) {
      this._element("folderTreeRow")
          .addEventListener("DOMAttrModified", this, false);
    }
    if (!this._readOnly) {
      if (this._itemType == BOOKMARK_ITEM) {
        this._element("locationField")
            .addEventListener("input", this, false);
        if (this._isAddKeywordDialog) {
          this._element("keywordField")
              .addEventListener("input", this, false);
        }
      }
      else if (this._itemType == LIVEMARK_CONTAINER) {
        this._element("feedLocationField")
            .addEventListener("input", this, false);
        this._element("siteLocationField")
            .addEventListener("input", this, false);
      }
    }
    window.sizeToContent();
  }
function BPP_onDialogLoad ( ) { this . _determineItemInfo ( ) ; document . title = this . _getDialogTitle ( ) ; var acceptButton = document . documentElement . getButton ( "accept" ) ; acceptButton . label = this . _getAcceptLabel ( ) ; this . _beginBatch ( ) ; switch ( this . _action ) { case ACTION_EDIT : this . _fillEditProperties ( ) ; acceptButton . disabled = this . _readOnly ; break ; case ACTION_ADD : this . _fillAddProperties ( ) ; if ( this . _itemType == BOOKMARK_ITEM ) acceptButton . disabled = ! this . _inputIsValid ( ) ; break ; } if ( ! this . _element ( "tagsRow" ) . collapsed ) { this . _element ( "tagsSelectorRow" ) . addEventListener ( "DOMAttrModified" , this , false ) ; } if ( ! this . _element ( "folderRow" ) . collapsed ) { this . _element ( "folderTreeRow" ) . addEventListener ( "DOMAttrModified" , this , false ) ; } if ( ! this . _readOnly ) { if ( this . _itemType == BOOKMARK_ITEM ) { this . _element ( "locationField" ) . addEventListener ( "input" , this , false ) ; if ( this . _isAddKeywordDialog ) { this . _element ( "keywordField" ) . addEventListener ( "input" , this , false ) ; } } else if ( this . _itemType == LIVEMARK_CONTAINER ) { this . _element ( "feedLocationField" ) . addEventListener ( "input" , this , false ) ; this . _element ( "siteLocationField" ) . addEventListener ( "input" , this , false ) ; } } window . sizeToContent ( ) ; }
This method should be called by the onload of the Bookmark Properties
 dialog to initialize the state of the panel.
This method should be called by the onload of the Bookmark Properties dialog to initialize the state of the panel .
// if this is an uri related dialog disable accept button until // the user fills an uri value. // When collapsible elements change their collapsed attribute we must // resize the dialog. // sizeToContent is not usable due to bug 90276, so we'll use resizeTo // instead and cache the element size. See WSucks in the legacy // UI code (addBookmark2.js). // Listen on uri fields to enable accept button if input is valid