<commit_before>
  /**
   *  Shows a dialog to share a map view.
   *
   *  var share_view = new ShareDialog({
   *    vis: visualization_model,
   *    user: user_model
   *  })
   *
   *  - It needs an user and visualization model.
   */

  cdb.admin.ShareDialog = cdb.admin.BaseDialog.extend({

    _TEXTS: {
      title: _t('Share settings'),
      close: _t('Close'),
      insert_password_placeholder: "Insert your password",
      edit_password_placeholder: "Edit your password",
      insert_password_button_label: "set",
      edit_password_button_label: "edit",

      privacy_names: {
        LINK: "Anyone with a link",
        PASSWORD: "<PASSWORD>",
        PRIVATE: "Private",
      }

    },

    options: {
      vizjson_url: 'http://<%= host %>/api/v2/viz/<%= id %>/viz.json'
    },

    _KEYS: {
      _BITLY: {
        key: '<KEY>',
        login: 'vizzuality'
      }
    },

    events: cdb.core.View.extendEvents({
      'click .copy ul li a':    '_onMethodClick',
      'click .input':           '_onInputClick',
      'click input.password':   '_onPasswordClick',
      'keyup input.password':   '_onPasswordKeyUp',
      'click .set_password':    '_setPassword',
      'click .cartodb-share a': '_onShareClick',
      'click .radiobutton':     '_onPrivacyRadioButtonClick',
      'blur input.password':    '_onInputBlur'

    }),

    initialize: function() {

      var free_account     = (user_data.account_type.toLowerCase() == 'free');
      var paid_account     = !free_account;
      var privacy          = this.options.vis.get("privacy");
      var has_private_maps = user_data.actions.private_maps;

      var show_disabled_privacy = (free_account && !has_private_maps && privacy != 'PUBLIC') || (paid_account && privacy != 'PUBLIC' && privacy != 'LINK')

      this.options = _.extend({
        title: this._TEXTS.title,
        description: '',
        template_name: 'table/header/views/share_dialog_base',
        private_maps: user_data.actions.private_maps,
        clean_on_hide: true,
        ok_button_classes: "button grey",
        ok_title: this._TEXTS.close,

        show_disabled_privacy: show_disabled_privacy,
        disabled_privacy: this.options.vis.get("privacy").toLowerCase(),
        disabled_privacy_name: this._TEXTS.privacy_names[this.options.vis.get("privacy")],<commit_msg>Fixes privacy options in the coronelli account<commit_after>
  /**
   *  Shows a dialog to share a map view.
   *
   *  var share_view = new ShareDialog({
   *    vis: visualization_model,
   *    user: user_model
   *  })
   *
   *  - It needs an user and visualization model.
   */

  cdb.admin.ShareDialog = cdb.admin.BaseDialog.extend({

    _TEXTS: {
      title: _t('Share settings'),
      close: _t('Close'),
      insert_password_placeholder: "<PASSWORD>",
      edit_password_placeholder: "<PASSWORD>",
      insert_password_button_label: "set",
      edit_password_button_label: "edit",

      privacy_names: {
        LINK: "Anyone with a link",
        PASSWORD: "<PASSWORD>",
        PRIVATE: "Private",
      }

    },

    options: {
      vizjson_url: 'http://<%= host %>/api/v2/viz/<%= id %>/viz.json'
    },

    _KEYS: {
      _BITLY: {
        key: '<KEY>',
        login: 'vizzuality'
      }
    },

    events: cdb.core.View.extendEvents({
      'click .copy ul li a':    '_onMethodClick',
      'click .input':           '_onInputClick',
      'click input.password':   '_onPasswordClick',
      'keyup input.password':   '_onPasswordKeyUp',
      'click .set_password':    '_setPassword',
      'click .cartodb-share a': '_onShareClick',
      'click .radiobutton':     '_onPrivacyRadioButtonClick',
      'blur input.password':    '_onInputBlur'

    }),

    initialize: function() {

      var free_account     = (user_data.account_type.toLowerCase() == 'free');
      var paid_account     = !free_account;
      var privacy          = this.options.vis.get("privacy");
      var has_private_maps = user_data.actions.private_maps;

      var show_disabled_privacy = (free_account && !has_private_maps && privacy != 'PUBLIC') || (!has_private_maps && paid_account && privacy != 'PUBLIC' && privacy != 'LINK')

      this.options = _.extend({
        title: this._TEXTS.title,
        description: '',
        template_name: 'table/header/views/share_dialog_base',
        private_maps: user_data.actions.private_maps,
        clean_on_hide: true,
        ok_button_classes: "button grey",
        ok_title: this._TEXTS.close,

        show_disabled_privacy: show_disabled_privacy,
        disabled_privacy: this.options.vis.get("privacy").toLowerCase(),
        disabled_privacy_name: this._TEXTS.privacy_names[this.options.vis.get("privacy")],
{'fraction_non_alphanumeric': 0.1340841478963026, 'fraction_numerical': 0.00042498937526561835, 'mean_word_length': 2.623556581986143, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '675689', 'n_tokens_mistral': 1519, 'n_tokens_neox': 1486, 'n_words': 292}