<commit_before>/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

//******************************
// Class FicheDetail
function FicheDetail() {
  var self = this; 
  var detailSelector = null;
  var indiceElement = null;
  var idFiche = null;
  var objetFiche = null;
  
  var champsActif = null;
  
  var largeurImposee = 240;
  var hauteurImposee = 320;
  
  var imageToShare = null;
  
  
  // constructeur
  this.initialise = function(_parent, element) {
    self.parent = _parent;
    var vignette = $(element);
    self.indiceElement = vignette.attr('data-id');
    self.detailSelector = $('#detailManager');
    
    self.detailSelector.load('js/tpl/detail.html', function(){
      // récuperation de la fiche de l'élément
      var idElement = self.indiceElement;
      self.objetFiche = donneesJson[idElement];
      
      self.idFiche = self.objetFiche["id"];
            
      var titre = self.objetFiche["texte"].split('<br>')[0];
      var reg=new RegExp("(<br>)", "g")
      self.messagePerso = "";//elementVignette["texte"].replace(reg, ' ');
      
      var imagePreview = cdn_visuel+'images/preview/'+self.objetFiche["preview"];
      var imageVierge = cdn_visuel+'images/image/'+self.objetFiche["preview"];
      
      // customisation de la fiche detail
      //self.detailSelector.find('.titre').html('<h1>'+titre+'...</h1>');
      self.detailSelector.find('.titre').html('<h1>&nbsp;</h1>');
      
      // modification dimension en fonction du téléphone
      var hauteurElementsUI = 131;
      var hauteurPossible = window.innerHeight - hauteurElementsUI;
      var largeurPossible = window.innerWidth;
      
      self.largeurImposee = 240;
      self.hauteurImposee = 320;
      
      if(largeurPossible > 300){
        if(hauteurPossible > 400){
          largeurImposee = 300;
          hauteurImposee = 400;
        }
      }
      
      self.detailSelector.find('.visuel .wrapper').css({'width':self.largeurImposee, 'height':self.hauteurImposee});
      self.detailSelector.find('.visuel .wrapper').html('<img src="'+imagePreview+'" width="'+self.largeurImposee+'" height="'+self.hauteurImposee+'">');
      
      // liaison des boutons
      self.detailSelector.find('.fermer a').bind('click', function(event){
        event.preventDefault();
        fermerDetail(element);
      });
      
      self.detailSelector.find('.editer a').bind('click', function(event){
        event.preventDefault();
        personnalisation(imageVierge);
      });
      
      self.detailSelector.find('.envoyer a').bind('click', function(event){
        event.preventDefault();
        if($(this).hasClass('share'))
        {
          self.imageToShare = cdn_visuel+'images/preview/'+donneesJson[idElement]["preview"];
          ouvreChoixPartage();//element,idElement);
        }/*else if($(this).hasClass('share-sms'))
        {
          ouvreChoixPartage(element,idElement);
        }else if($(this).hasClass('share-mail'))
        {
          envoiChoixParMail(element,idElement);
        }else if($(this).hasClass('share-fb'))
        {
          ouvreChoixPartage(element,idElement);
        }else if($(this).hasClass('share-tw'))
        {
          ouvreChoixPartage(element,idElement);
        }*/
        
        $.ajax({
                  type: 'POST',
                  url: webservice_stats,
                  data: {id:idShare},
                  async:true
                })
        
      });
      
      
      self.detailSelector.find('.envoyerPerso a').bind('click', function(event){
        event.preventDefault();
        if($(this).hasClass('sharePerso'))
        {
          var champs1 = self.detailSelector.find('.visuel .wrapper p.ligne1');
          var champs2 = self.detailSelector.find('.visuel .wrapper p.ligne2');
                  
                  txt_gauche
          
          var text1val = '';
          var text2val = '';
          var align1 = 'c';
          var align2 = 'c';<commit_msg>bug lié à un copier/coller<commit_after>/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

//******************************
// Class FicheDetail
function FicheDetail() {
  var self = this; 
  var detailSelector = null;
  var indiceElement = null;
  var idFiche = null;
  var objetFiche = null;
  
  var champsActif = null;
  
  var largeurImposee = 240;
  var hauteurImposee = 320;
  
  var imageToShare = null;
  
  
  // constructeur
  this.initialise = function(_parent, element) {
    self.parent = _parent;
    var vignette = $(element);
    self.indiceElement = vignette.attr('data-id');
    self.detailSelector = $('#detailManager');
    
    self.detailSelector.load('js/tpl/detail.html', function(){
      // récuperation de la fiche de l'élément
      var idElement = self.indiceElement;
      self.objetFiche = donneesJson[idElement];
      
      self.idFiche = self.objetFiche["id"];
            
      var titre = self.objetFiche["texte"].split('<br>')[0];
      var reg=new RegExp("(<br>)", "g")
      self.messagePerso = "";//elementVignette["texte"].replace(reg, ' ');
      
      var imagePreview = cdn_visuel+'images/preview/'+self.objetFiche["preview"];
      var imageVierge = cdn_visuel+'images/image/'+self.objetFiche["preview"];
      
      // customisation de la fiche detail
      //self.detailSelector.find('.titre').html('<h1>'+titre+'...</h1>');
      self.detailSelector.find('.titre').html('<h1>&nbsp;</h1>');
      
      // modification dimension en fonction du téléphone
      var hauteurElementsUI = 131;
      var hauteurPossible = window.innerHeight - hauteurElementsUI;
      var largeurPossible = window.innerWidth;
      
      self.largeurImposee = 240;
      self.hauteurImposee = 320;
      
      if(largeurPossible > 300){
        if(hauteurPossible > 400){
          largeurImposee = 300;
          hauteurImposee = 400;
        }
      }
      
      self.detailSelector.find('.visuel .wrapper').css({'width':self.largeurImposee, 'height':self.hauteurImposee});
      self.detailSelector.find('.visuel .wrapper').html('<img src="'+imagePreview+'" width="'+self.largeurImposee+'" height="'+self.hauteurImposee+'">');
      
      // liaison des boutons
      self.detailSelector.find('.fermer a').bind('click', function(event){
        event.preventDefault();
        fermerDetail(element);
      });
      
      self.detailSelector.find('.editer a').bind('click', function(event){
        event.preventDefault();
        personnalisation(imageVierge);
      });
      
      self.detailSelector.find('.envoyer a').bind('click', function(event){
        event.preventDefault();
        if($(this).hasClass('share'))
        {
          self.imageToShare = cdn_visuel+'images/preview/'+donneesJson[idElement]["preview"];
          ouvreChoixPartage();//element,idElement);
        }/*else if($(this).hasClass('share-sms'))
        {
          ouvreChoixPartage(element,idElement);
        }else if($(this).hasClass('share-mail'))
        {
          envoiChoixParMail(element,idElement);
        }else if($(this).hasClass('share-fb'))
        {
          ouvreChoixPartage(element,idElement);
        }else if($(this).hasClass('share-tw'))
        {
          ouvreChoixPartage(element,idElement);
        }*/
        
        $.ajax({
                  type: 'POST',
                  url: webservice_stats,
                  data: {id:idShare},
                  async:true
                })
        
      });
      
      
      self.detailSelector.find('.envoyerPerso a').bind('click', function(event){
        event.preventDefault();
        if($(this).hasClass('sharePerso'))
        {
          var champs1 = self.detailSelector.find('.visuel .wrapper p.ligne1');
          var champs2 = self.detailSelector.find('.visuel .wrapper p.ligne2');
                  
          var text1val = '';
          var text2val = '';
          var align1 = 'c';
          var align2 = 'c';
{'fraction_non_alphanumeric': 0.13878549399127937, 'fraction_numerical': 0.009358715303626503, 'mean_word_length': 2.519461077844311, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '5187048', 'n_tokens_mistral': 2834, 'n_tokens_neox': 2780, 'n_words': 596}