<commit_before>/**
 * Shows and Manages the lists an object belongs to.
 *
 * @name Membership
 * @param {String} id/uid Required, The object you want to comment on.
 * @template {main} Displays the basic markup information necessary to display the popover containg the list of lists
 * @template {elements} Displays the form to create a new list and all the lists that belong to the current user
 * @datasource {lists}    Collection of all the lists the user has access to
 * @datasource {listedIn} Collection of lists in which the current item is listed into
 * @action {toggle} Toggles the presence of the current item in the selected list
 * @example <div data-hull-component="lists/membership@hull" data-hull-uid="http://path.to/my/url"></div>
 * @example <div data-hull-component="lists/membership@hull" data-hull-id="HULL_OBJECT_ID"></div>
 */

/*jshint jquery:true */
/*global Hull:true */
Hull.component({
  type: 'Hull',
  templates: ['main', 'items', 'loggedOut', 'header'],
  refreshEvents: ['model.hull.me.change'],
  requiredOptions: ['id'],

  require: [ 'bootstrap-tooltip', 'bootstrap-popover' ],

  datasources: {
    /*
     * Retrieves all the lists the current user has access to
     */
    lists: function () {
      "use strict";
      var _ = this.sandbox.util._;
      return !this.loggedIn() && [] || this.api('me/lists').then(function(data) {
        return _.map(data, function (list) {
          return {id: list.id, name: list.name};
        });
      });<commit_msg>Removes the autoloading of popover and adds a mention to it in the documentation<commit_after>/**
 * Shows and Manages the lists an object belongs to.
 *
 * @name Membership
 * @param {String} id/uid Required, The object you want to comment on.
 * @template {main} Displays the basic markup information necessary to display the popover containg the list of lists
 * @template {elements} Displays the form to create a new list and all the lists that belong to the current user
 * @datasource {lists}    Collection of all the lists the user has access to
 * @datasource {listedIn} Collection of lists in which the current item is listed into
 * @requires {jQuery.fn.popover} The popover plugin available in Twitter Bootstrap
 * @action {toggle} Toggles the presence of the current item in the selected list
 * @example <div data-hull-component="lists/membership@hull" data-hull-uid="http://path.to/my/url"></div>
 * @example <div data-hull-component="lists/membership@hull" data-hull-id="HULL_OBJECT_ID"></div>
 */

/*jshint jquery:true */
/*global Hull:true */
Hull.component({
  type: 'Hull',
  templates: ['main', 'items', 'loggedOut', 'header'],
  refreshEvents: ['model.hull.me.change'],
  requiredOptions: ['id'],

  datasources: {
    /*
     * Retrieves all the lists the current user has access to
     */
    lists: function () {
      "use strict";
      var _ = this.sandbox.util._;
      return !this.loggedIn() && [] || this.api('me/lists').then(function(data) {
        return _.map(data, function (list) {
          return {id: list.id, name: list.name};
        });
      });
{'fraction_non_alphanumeric': 0.12920984455958548, 'fraction_numerical': 0.0, 'mean_word_length': 3.617339312406577, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3818928', 'n_tokens_mistral': 937, 'n_tokens_neox': 913, 'n_words': 327}