<commit_before>(function ($) {
   $(window).load(function(){
      var fields = document.getElementsByClassName('field-widget-hologram-image');
      Array.prototype.forEach.call(fields, function(field){
         var area = $(field).find('.hologram-area').get(0);
         var handle = window.hologram(area, {
            uploadUrl: Drupal.settings.Hologram.uploadUrl,
            onComplete: function(result){
               var jsonField = $(field).find('input').get(0);
               var json = JSON.stringify(result);
               $(jsonField).val(json);
            },
            config: {
               uploader: '/hologram/upload'
            },
         });
         handle.store
         handle.addFiles
      });
   });
})(jQuery);<commit_msg>Store can pass file json to input field<commit_after>(function ($) {
   $(window).load(function(){
      var fields = document.getElementsByClassName('field-widget-hologram-image');
      Array.prototype.forEach.call(fields, function(field){
         var jsonField = $(field).find('input').get(0);
         var area = $(field).find('.hologram-area').get(0);
         var handle = window.hologram(area, {
            uploadUrl: Drupal.settings.Hologram.uploadUrl,
            onComplete: function(result){
               var json = JSON.stringify(result);
               $(jsonField).val(json);
            },
            config: {
               uploader: '/hologram/upload'
            },
         });
         handle.store
         handle.addFiles

         //Push exist images to holgoram widget

         try{
            var files = $(jsonField).val();
            if(files){
               files = JSON.parse(files);
               handle.store.dispatch(handle.addFiles(files));
            }
         }catch(ex){
            console.log(ex);
         }

         handle.store.subscribe(function(){
            var files = handle.store.getState().files;
            var json = JSON.stringify(files);
            $(jsonField).val(json);
         });

      });
   });
})(jQuery);
{'fraction_non_alphanumeric': 0.1444662095984329, 'fraction_numerical': 0.0019588638589618022, 'mean_word_length': 1.790983606557377, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3567536', 'n_tokens_mistral': 546, 'n_tokens_neox': 541, 'n_words': 90}