<commit_before>/* This Source Code Form is subject to the terms of the MIT license
 * If a copy of the MIT license was not distributed with this file, you can
 * obtain one at https://raw.github.com/mozilla/butter/master/LICENSE */

define( [ "localized", "util/lang", "util/uri", "util/xhr", "util/keys", "util/mediatypes", "editor/editor",
 "util/time", "util/dragndrop", "l10n!/layouts/media-editor.html", "json!/api/butterconfig" ],
  function( Localized, LangUtils, URI, XHR, KeysUtils, MediaUtils, Editor, Time, DragNDrop, EDITOR_LAYOUT, CONFIG ) {

  var _parentElement =  LangUtils.domFragment( EDITOR_LAYOUT, ".media-editor" ),
      _addMediaPanel = _parentElement.querySelector( ".add-media-panel" ),

      _clipBtnText = Localized.get( "Create clip" ),
      _searchBtnText = Localized.get( "Search" ),
      _resultsText = Localized.get( "Results" ),
      _myMediaText = Localized.get( "My Media Gallery" ),

      _urlInput = _addMediaPanel.querySelector( ".add-media-input" ),
      _addBtn = _addMediaPanel.querySelector( ".add-media-btn" ),
      _errorMessage = _parentElement.querySelector( ".media-error-message" ),
      _loadingSpinner = _parentElement.querySelector( ".media-loading-spinner" ),

      _searchInput = _addMediaPanel.querySelector( ".search-media-input" ),

      _oldValue,
      _galleryPanel = _parentElement.querySelector( ".media-gallery" ),
      _galleryHeader = _parentElement.querySelector( ".media-gallery-heading" ),
      _galleryList = _galleryPanel.querySelector( "#project-items" ),
      _GALLERYITEM = LangUtils.domFragment( EDITOR_LAYOUT, ".media-gallery-item.gallery-video" ),
      _searchSelector = _parentElement.querySelector( ".search-items > select" ),
      _pagingContainer = _parentElement.querySelector( ".paging-container" ),
      _projectTab = _parentElement.querySelector( ".project-tab" ),
      _searchTab = _parentElement.querySelector( ".search-tab" ),

      _itemContainers = {
        project: _galleryList,
        YouTube: _galleryPanel.querySelector( "#youtube-items" ),
        SoundCloud: _galleryPanel.querySelector( "#soundcloud-items" ),
        Flickr: _galleryPanel.querySelector( "#flickr-items" ),
        Giphy: _galleryPanel.querySelector( "#giphy-items" )
      },
      _sectionContainers = {
        project: _addMediaPanel.querySelector( ".project-clips" ),
        search: _addMediaPanel.querySelector( ".search-items" )
      },

      _currentSearch = "YouTube",
      _butter,
      _media,
      _mediaLoadTimeout,
      _cancelSpinner,
      _LIMIT = CONFIG.sync_limit,
      MEDIA_LOAD_TIMEOUT = 10000,
      _this,
      TRANSITION_TIME = 2000,
      _photoTypes = [
        "Giphy",
        "Flickr"
      ];

  function resetInput() {
    _urlInput.value = "";
    _searchInput.value = "";

    clearTimeout( _mediaLoadTimeout );
    clearTimeout( _cancelSpinner );
    _urlInput.classList.remove( "error" );
    _addMediaPanel.classList.remove( "invalid-field" );
    _errorMessage.classList.add( "hidden" );
    _loadingSpinner.classList.add( "hidden" );

    _addBtn.classList.add( "hidden" );
  }<commit_msg>[#965208] Add images to list of photo types.<commit_after>/* This Source Code Form is subject to the terms of the MIT license
 * If a copy of the MIT license was not distributed with this file, you can
 * obtain one at https://raw.github.com/mozilla/butter/master/LICENSE */

define( [ "localized", "util/lang", "util/uri", "util/xhr", "util/keys", "util/mediatypes", "editor/editor",
 "util/time", "util/dragndrop", "l10n!/layouts/media-editor.html", "json!/api/butterconfig" ],
  function( Localized, LangUtils, URI, XHR, KeysUtils, MediaUtils, Editor, Time, DragNDrop, EDITOR_LAYOUT, CONFIG ) {

  var _parentElement =  LangUtils.domFragment( EDITOR_LAYOUT, ".media-editor" ),
      _addMediaPanel = _parentElement.querySelector( ".add-media-panel" ),

      _clipBtnText = Localized.get( "Create clip" ),
      _searchBtnText = Localized.get( "Search" ),
      _resultsText = Localized.get( "Results" ),
      _myMediaText = Localized.get( "My Media Gallery" ),

      _urlInput = _addMediaPanel.querySelector( ".add-media-input" ),
      _addBtn = _addMediaPanel.querySelector( ".add-media-btn" ),
      _errorMessage = _parentElement.querySelector( ".media-error-message" ),
      _loadingSpinner = _parentElement.querySelector( ".media-loading-spinner" ),

      _searchInput = _addMediaPanel.querySelector( ".search-media-input" ),

      _oldValue,
      _galleryPanel = _parentElement.querySelector( ".media-gallery" ),
      _galleryHeader = _parentElement.querySelector( ".media-gallery-heading" ),
      _galleryList = _galleryPanel.querySelector( "#project-items" ),
      _GALLERYITEM = LangUtils.domFragment( EDITOR_LAYOUT, ".media-gallery-item.gallery-video" ),
      _searchSelector = _parentElement.querySelector( ".search-items > select" ),
      _pagingContainer = _parentElement.querySelector( ".paging-container" ),
      _projectTab = _parentElement.querySelector( ".project-tab" ),
      _searchTab = _parentElement.querySelector( ".search-tab" ),

      _itemContainers = {
        project: _galleryList,
        YouTube: _galleryPanel.querySelector( "#youtube-items" ),
        SoundCloud: _galleryPanel.querySelector( "#soundcloud-items" ),
        Flickr: _galleryPanel.querySelector( "#flickr-items" ),
        Giphy: _galleryPanel.querySelector( "#giphy-items" )
      },
      _sectionContainers = {
        project: _addMediaPanel.querySelector( ".project-clips" ),
        search: _addMediaPanel.querySelector( ".search-items" )
      },

      _currentSearch = "YouTube",
      _butter,
      _media,
      _mediaLoadTimeout,
      _cancelSpinner,
      _LIMIT = CONFIG.sync_limit,
      MEDIA_LOAD_TIMEOUT = 10000,
      _this,
      TRANSITION_TIME = 2000,
      _photoTypes = [
        "Giphy",
        "Flickr",
        "Image"
      ];

  function resetInput() {
    _urlInput.value = "";
    _searchInput.value = "";

    clearTimeout( _mediaLoadTimeout );
    clearTimeout( _cancelSpinner );
    _urlInput.classList.remove( "error" );
    _addMediaPanel.classList.remove( "invalid-field" );
    _errorMessage.classList.add( "hidden" );
    _loadingSpinner.classList.add( "hidden" );

    _addBtn.classList.add( "hidden" );
  }
{'fraction_non_alphanumeric': 0.1296119592875318, 'fraction_numerical': 0.004452926208651399, 'mean_word_length': 3.4351198871650213, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '964520', 'n_tokens_mistral': 1947, 'n_tokens_neox': 1913, 'n_words': 364}