<commit_before>const $ = require('jquery');

import ReactDOM from 'react-dom';

import '../javascripts/jsframe/swiper-3.4.0/swiper.min.js';

import '../javascripts/jsframe/swiper-3.4.0/swiper.min.css';

import './ai_swiper.css';

var React = require('react');

var AiSwiper = React.createClass({

  render: function() {
    const naviBtnHtml = (
      <div>
        <div className="swiper-button-prev">
        </div>
        <div className="swiper-button-next">
        </div>
      </div>
    );

    return (
      <div id={this.props.swpConId} className="swiper-container">
        <div className="swiper-wrapper">
        {
          this.props.sliders.map((slider) => {
            return <div className="swiper-slide">{slider.name}</div>
          })
        }
        </div>
        {
          (()=>{
            if (this.props.pagination)
              return <div className="swiper-pagination"></div>
          })()         
        }
        {(()=>{
            if (this.props.naviBtn)
              return naviBtnHtml
          })()}
      </div>
    );
  }


});

function aiSwiperWidget(slice) {
  function refresh() {
    $.getJSON(slice.jsonEndpoint(), (payload) => {
      ReactDOM.render(
        <AiSwiper
          swpConId={'mySwp_'+payload.form_data.slice_id} 
          sliders={payload.data.records}
          pagination={payload.form_data.aiswpier_pagination}
          direction={payload.form_data.aiswpier_direction}
          naviBtn={payload.form_data.aiswpier_navi}
        />,
        document.getElementById(slice.containerId)
      );
      let fd = payload.form_data;
      let mySwpCon = '#mySwp_'+fd.slice_id;
      let mySwiper = {};
      let myswpOpt = {};
      if(fd.aiswpier_pagination){<commit_msg>ai_swiper pagenation bug fixed<commit_after>const $ = require('jquery');

import ReactDOM from 'react-dom';

import '../javascripts/jsframe/swiper-3.4.0/swiper.min.js';

import '../javascripts/jsframe/swiper-3.4.0/swiper.min.css';

import './ai_swiper.css';

var React = require('react');

var AiSwiper = React.createClass({

  render: function() {
    const naviBtnHtml = (
      <div>
        <div className="swiper-button-prev">
        </div>
        <div className="swiper-button-next">
        </div>
      </div>
    );

    return (
      <div id={this.props.swpConId} className="swiper-container">
        <div className="swiper-wrapper">
        {
          this.props.sliders.map((slider) => {
            return <div className="swiper-slide">{slider.name}</div>
          })
        }
        </div>
        {
          (()=>{
            if (this.props.pagination)
              return <div className="swiper-pagination"></div>
          })()         
        }
        {(()=>{
            if (this.props.naviBtn)
              return naviBtnHtml
          })()}
      </div>
    );
  }


});

function aiSwiperWidget(slice) {
  function refresh() {
    document.getElementById(slice.containerId).innerHTML='';
    $.getJSON(slice.jsonEndpoint(), (payload) => {
      ReactDOM.render(
        <AiSwiper
          swpConId={'mySwp_'+payload.form_data.slice_id} 
          sliders={payload.data.records}
          pagination={payload.form_data.aiswpier_pagination}
          direction={payload.form_data.aiswpier_direction}
          naviBtn={payload.form_data.aiswpier_navi}
        />,
        document.getElementById(slice.containerId)
      );
      let fd = payload.form_data;
      let mySwpCon = '#mySwp_'+fd.slice_id;
      let mySwiper = {};
      let myswpOpt = {};
      if(fd.aiswpier_pagination){
{'fraction_non_alphanumeric': 0.152442448062886, 'fraction_numerical': 0.003368893879842785, 'mean_word_length': 2.0928819444444446, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 41, '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': '4321946', 'n_tokens_mistral': 1157, 'n_tokens_neox': 1142, 'n_words': 155}