B2G/gecko/browser/components/preferences/selectBookmark.js
/**
   * User accepts their selection. Set all the selected URLs or the contents
   * of the selected folder as the list of homepages.
   */
User accepts their selection. Set all the selected URLs or the contents
of the selected folder as the list of homepages.
User accepts their selection . Set all the selected URLs or the contents of the selected folder as the list of homepages .
function SBD_accept() {
    var bookmarks = document.getElementById("bookmarks");
    NS_ASSERT(bookmarks.hasSelection,
              "Should not be able to accept dialog if there is no selected URL!");
    var urls = [];
    var names = [];
    var selectedNode = bookmarks.selectedNode;
    if (PlacesUtils.nodeIsFolder(selectedNode)) {
      var contents = PlacesUtils.getFolderContents(selectedNode.itemId).root;
      var cc = contents.childCount;
      for (var i = 0; i < cc; ++i) {
        var node = contents.getChild(i);
        if (PlacesUtils.nodeIsURI(node)) {
          urls.push(node.uri);
          names.push(node.title);
        }
      }
      contents.containerOpen = false;
    }
    else {
      urls.push(selectedNode.uri);
      names.push(selectedNode.title);
    }
    window.arguments[0].urls = urls;
    window.arguments[0].names = names;
  }
function SBD_accept ( ) { var bookmarks = document . getElementById ( "bookmarks" ) ; NS_ASSERT ( bookmarks . hasSelection , "Should not be able to accept dialog if there is no selected URL!" ) ; var urls = [ ] ; var names = [ ] ; var selectedNode = bookmarks . selectedNode ; if ( PlacesUtils . nodeIsFolder ( selectedNode ) ) { var contents = PlacesUtils . getFolderContents ( selectedNode . itemId ) . root ; var cc = contents . childCount ; for ( var i = 0 ; i < cc ; ++ i ) { var node = contents . getChild ( i ) ; if ( PlacesUtils . nodeIsURI ( node ) ) { urls . push ( node . uri ) ; names . push ( node . title ) ; } } contents . containerOpen = false ; } else { urls . push ( selectedNode . uri ) ; names . push ( selectedNode . title ) ; } window . arguments [ 0 ] . urls = urls ; window . arguments [ 0 ] . names = names ; }
User accepts their selection.
User accepts their selection .