Plugin Directory

Changeset 3036333

Timestamp:
02/15/2024 01:49:50 PM (5 months ago)
Author:
soportecibeles
Message:

fix: files...

Location:
cibeles-ai/trunk
Files:
6 added
18 edited

Legend:

Unmodified
Added
Removed
  • cibeles-ai/trunk/cibeles-ai.php

    r3036331 r3036333  
    1010 * Author: Cibeles.net
    1111 * Author URI:  https://www.cibeles.net/
    12  * Version: 1.1.2
     12 * Version: 1.
    1313 * License: GPLv2
    1414 * Released under the GNU General Public License (GPL)
     
    2323$cibelesAiPlugin = [
    2424  'namespace' => 'cibeles-ai',
    25   'version' => '1.1',
     25  'version' => '1.',
    2626  'path' => dirname(__FILE__).DS,
    2727  'url' => plugin_dir_url( __FILE__ ),
    2828  'filename' => __FILE__,
    2929  'api_url' => 'https://openai.editmaker.com/wp/api/',
     30
    3031];
    3132
  • cibeles-ai/trunk/css/main.css

    r3036331 r3036333  
     1
     2
     3
     4
    15.cibelesAi_button {
    26    background: #2271b1;
     
    2226    color: #f9f9f9;
    2327}
     28
     29
     30
     31
    2432.cibelesAi_button i{
    2533    margin-left: 5px;
     
    3543}
    3644#div_button_resumen,
     45
     46
    3747#div_button_autoexcerpt,
    38 #div_button_refrito{
     48#div_button_refrito,
     49#div_button_corrector,
     50#div_button_youtube,
     51#div_button_cifras,
     52#div_button_cronologia,
     53#div_button_faq{
    3954    margin-bottom: 0px;
    4055    margin-top: 5px;
    4156    margin-left: 5px;
    4257}
    43 
    44 .result .refritoResponse,
    45 .result .original{
     58.corrector span.caip_blue {
     59    color: blue;
     60    font-weight: 500;
     61}
     62
     63.result .Left,
     64.result .Right{
    4665    padding:10px;
    4766}
    48 .result .containerRefritoResponse,
    49 .result .containerOriginal{
     67.result .container,
     68.result .container{
    5069    width: 50%;
    5170    float: left;
    5271}
    53 .result .containerOriginal:before,
    54 .result .containerRefritoResponse:before {
     72.result .container:before,
     73.result .containerR:before {
    5574    font-size: large;
    5675    text-decoration: underline;
    5776    width: 100%;
     77
     78
     79
     80
     81
     82
     83
     84
     85
     86
     87
     88
     89
    5890}
    5991
     
    101133
    102134#TB_window .result .titular,
    103 #TB_window .result .resumenText{
     135#TB_window .result .resumenText,
     136#TB_window .result .youtubeText,
     137#TB_window .result .introduccionText,
     138#TB_window .result .conclusionText{
    104139    padding: 10px;
    105140    margin-top: 10px;
     
    163198    100% { transform: rotate(360deg); }
    164199}
     200
     201
     202
     203
     204
  • cibeles-ai/trunk/init.php

    r3036331 r3036333  
    33/* Inicializa*/
    44add_action('admin_init','caip_init');
     5
     6
     7
    58/* Inicializa thickbox*/
    69add_action('admin_init','caip_init_thickbox');
    710/*  Agrega fontawesome y main*/
    811add_action('admin_init','caip_init_files_CSS');
     12
     13
    914/*  Agrega main */
    1015add_action('admin_enqueue_scripts','caip_init_files_JS');
     
    1318/* Agrega notices */
    1419add_action( 'admin_notices', 'caip_admin_notice_warn' );
     20
     21
     22
     23
     24
     25
     26
     27
     28
    1529
    1630if ( ! function_exists( 'caip_init' ) ) {
     
    2438        $cibelesAiPlugin['settings']['caip_numero_tags'] =      (isset($cibelesAiPlugin['settings']['caip_numero_tags']))? $cibelesAiPlugin['settings']['caip_numero_tags'] : '10';
    2539        $cibelesAiPlugin['settings']['caip_numero_resumenes'] = (isset($cibelesAiPlugin['settings']['caip_numero_resumenes']))? $cibelesAiPlugin['settings']['caip_numero_resumenes'] : '3';
     40
     41
     42
     43
     44
     45
     46
     47
     48
     49
     50
     51
     52
     53
     54
     55
     56
     57
     58
    2659    }
    2760}
     
    4073    function caip_init_files_CSS(){
    4174        global $pagenow;
    42         if ( ( 'post.php' == $pagenow || 'post-new.php' == $pagenow ) ) {
     75       
     76        if ( ( 'post.php' == $pagenow || 'post-new.php' == $pagenow ) || ( 'options-general.php' == $pagenow ) ) {
    4377            wp_enqueue_style('fontawesome_css',  plugin_dir_url( __FILE__ ) . 'libs/fontawesome/css/main.css', '', '', 'all');
    44             wp_enqueue_style('post_css',  plugin_dir_url( __FILE__ ) . 'css/main.css', '', '1.0.0', 'all');
    45         }
    46     }
    47 }
     78            wp_enqueue_style('post_css',  plugin_dir_url( __FILE__ ) . 'css/main.css', '', '1.9.0', 'all');
     79        }
     80    }
     81}
     82
    4883
    4984if ( ! function_exists( 'caip_init_files_JS' ) ) {
     
    5590
    5691        if ( ( 'post.php' == $pagenow || 'post-new.php' == $pagenow ) && 'post' == $post->post_type ) {
    57             wp_enqueue_script( 'language_js', plugin_dir_url( __FILE__ ) . 'js/init_language.js', array( 'jquery' ), '1.0', true );
     92            wp_enqueue_script( 'language_js', plugin_dir_url( __FILE__ ) . 'js/init_language.js', array( 'jquery' ), '1.0', true );
    5893            wp_set_script_translations( 'language_js', 'cibeles-ai', plugin_basename( __DIR__ ) . '/languages/');
    5994           
    6095            if (caip_is_classic_editor()) {
    61                 wp_enqueue_script( 'post_js', plugin_dir_url( __FILE__ ) . 'js/init_ai_fields.js', array( 'jquery' ), '1.0', true );
     96                wp_enqueue_script( 'post_js', plugin_dir_url( __FILE__ ) . 'js/init_ai_fields.js', array( 'jquery' ), '1.0', true );
    6297                wp_set_script_translations( 'post_js', 'cibeles-ai', plugin_basename( __DIR__ ) . '/languages/');
    6398                wp_localize_script( 'post_js', 'caip_settings', $cibelesAiPlugin['settings']  );
     
    67102                wp_set_script_translations( 'caip_main',    'cibeles-ai', plugin_basename( __DIR__ ) . '/languages/');
    68103                */
    69                
    70                 wp_enqueue_script(  'caip_functions',       plugin_dir_url( __FILE__ )      .'js/classes/caip_Functions.js',    array( 'jquery' ), '1.0', true );
    71                 wp_enqueue_script(  'caip_button',          plugin_dir_url( __FILE__ )      .'js/classes/caip_Button.js',       array( 'jquery' ), '1.0', true );
    72                 wp_enqueue_script(  'caip_action',          plugin_dir_url( __FILE__ )      .'js/classes/caip_Action.js',       array( 'jquery' ), '1.0', true );
    73                 wp_enqueue_script(  'caip_titulo',          plugin_dir_url( __FILE__ )      .'js/classes/caip_Titulo.js',       array( 'jquery' ), '1.0', true );
    74                 wp_enqueue_script(  'caip_tag',             plugin_dir_url( __FILE__ )      .'js/classes/caip_Tag.js',          array( 'jquery' ), '1.0', true );
    75                 wp_enqueue_script(  'caip_resumenp',        plugin_dir_url( __FILE__ )      .'js/classes/caip_ResumenP.js',     array( 'jquery' ), '1.0', true );
    76                
    77                 wp_enqueue_script(  'caip_clickbait',       plugin_dir_url( __FILE__ )      .'js/classes/clickbait.js',         array( 'jquery' ), '1.0', true );
    78                 wp_enqueue_script(  'caip_titularcorto',    plugin_dir_url( __FILE__ )      .'js/classes/titularcorto.js',      array( 'jquery' ), '1.0', true );
    79                 wp_enqueue_script(  'caip_titular',         plugin_dir_url( __FILE__ )      .'js/classes/titular.js',           array( 'jquery' ), '1.0', true );
    80                 wp_enqueue_script(  'caip_tags',            plugin_dir_url( __FILE__ )      .'js/classes/tags.js',              array( 'jquery' ), '1.0', true );
    81                 wp_enqueue_script(  'caip_autotags',        plugin_dir_url( __FILE__ )      .'js/classes/autotags.js',          array( 'jquery' ), '1.0', true );
    82                 wp_enqueue_script(  'caip_resumen',         plugin_dir_url( __FILE__ )      .'js/classes/resumen.js',           array( 'jquery' ), '1.0', true );
    83                 wp_enqueue_script(  'caip_autoexcerpt',     plugin_dir_url( __FILE__ )      .'js/classes/autoexcerpt.js',       array( 'jquery' ), '1.0', true );
    84                 wp_enqueue_script(  'caip_refrito',         plugin_dir_url( __FILE__ )      .'js/classes/refrito.js',           array( 'jquery' ), '1.0', true );
    85                
    86                 wp_set_script_translations( 'caip_functions',   'cibeles-ai', plugin_basename( __DIR__ ) . '/languages/');
    87                 wp_set_script_translations( 'caip_button',      'cibeles-ai', plugin_basename( __DIR__ ) . '/languages/');
    88                 wp_set_script_translations( 'caip_action',      'cibeles-ai', plugin_basename( __DIR__ ) . '/languages/');
    89                 wp_set_script_translations( 'caip_titulo',      'cibeles-ai', plugin_basename( __DIR__ ) . '/languages/');
    90                 wp_set_script_translations( 'caip_tag',         'cibeles-ai', plugin_basename( __DIR__ ) . '/languages/');
    91                 wp_set_script_translations( 'caip_resumenp',    'cibeles-ai', plugin_basename( __DIR__ ) . '/languages/');
    92                
    93                 wp_set_script_translations( 'caip_clickbait',   'cibeles-ai', plugin_basename( __DIR__ ) . '/languages/');
    94                 wp_set_script_translations( 'caip_titularcorto','cibeles-ai', plugin_basename( __DIR__ ) . '/languages/');
    95                 wp_set_script_translations( 'caip_titular',     'cibeles-ai', plugin_basename( __DIR__ ) . '/languages/');
    96                 wp_set_script_translations( 'caip_tags',        'cibeles-ai', plugin_basename( __DIR__ ) . '/languages/');
    97                 wp_set_script_translations( 'caip_autotags',    'cibeles-ai', plugin_basename( __DIR__ ) . '/languages/');
    98                 wp_set_script_translations( 'caip_resumen',     'cibeles-ai', plugin_basename( __DIR__ ) . '/languages/');
    99                 wp_set_script_translations( 'caip_autoexcerpt', 'cibeles-ai', plugin_basename( __DIR__ ) . '/languages/');
    100                 wp_set_script_translations( 'caip_refrito',     'cibeles-ai', plugin_basename( __DIR__ ) . '/languages/');
     104                wp_enqueue_script(  'caip_diff',        plugin_dir_url( __FILE__ )      .'node_modules/diff-dom/browser/diffDOM.js',array( 'jquery' ), false, true );
     105                wp_enqueue_script(  'caip_difftext',        plugin_dir_url( __FILE__ )      .'libs/diff/diff.js',                       array( 'jquery' ), false, true );
     106               
     107                wp_enqueue_script(  'caip_functions',       plugin_dir_url( __FILE__ )      .'js/classes/caip_Functions.js',    array( 'jquery' ), '1.9.0', true );
     108                wp_enqueue_script(  'caip_button',          plugin_dir_url( __FILE__ )      .'js/classes/caip_Button.js',       array( 'jquery' ), '1.9.0', true );
     109                wp_enqueue_script(  'caip_action',          plugin_dir_url( __FILE__ )      .'js/classes/caip_Action.js',       array( 'jquery' ), '1.9.0', true );
     110                wp_enqueue_script(  'caip_titulo',          plugin_dir_url( __FILE__ )      .'js/classes/caip_Titulo.js',       array( 'jquery' ), '1.9.0', true );
     111                wp_enqueue_script(  'caip_tag',             plugin_dir_url( __FILE__ )      .'js/classes/caip_Tag.js',          array( 'jquery' ), '1.9.0', true );
     112                wp_enqueue_script(  'caip_resumenp',        plugin_dir_url( __FILE__ )      .'js/classes/caip_ResumenP.js',     array( 'jquery' ), '1.9.0', true );
     113                wp_enqueue_script(  'caip_multiaction',     plugin_dir_url( __FILE__ )      .'js/classes/caip_Multiaction.js',  array( 'jquery' ), '1.9.0', true );
     114               
     115                wp_enqueue_script(  'caip_clickbait',       plugin_dir_url( __FILE__ )      .'js/classes/clickbait.js',         array( 'jquery' ), '1.9.0', true );
     116                wp_enqueue_script(  'caip_titularcorto',    plugin_dir_url( __FILE__ )      .'js/classes/titularcorto.js',      array( 'jquery' ), '1.9.0', true );
     117                wp_enqueue_script(  'caip_titular',         plugin_dir_url( __FILE__ )      .'js/classes/titular.js',           array( 'jquery' ), '1.9.0', true );
     118                wp_enqueue_script(  'caip_tags',            plugin_dir_url( __FILE__ )      .'js/classes/tags.js',              array( 'jquery' ), '1.9.0', true );
     119                wp_enqueue_script(  'caip_autotags',        plugin_dir_url( __FILE__ )      .'js/classes/autotags.js',          array( 'jquery' ), '1.9.0', true );
     120                wp_enqueue_script(  'caip_resumen',         plugin_dir_url( __FILE__ )      .'js/classes/resumen.js',           array( 'jquery' ), '1.9.0', true );
     121                wp_enqueue_script(  'caip_autoexcerpt',     plugin_dir_url( __FILE__ )      .'js/classes/autoexcerpt.js',       array( 'jquery' ), '1.9.0', true );
     122                wp_enqueue_script(  'caip_refrito',         plugin_dir_url( __FILE__ )      .'js/classes/refrito.js',           array( 'jquery' ), '1.9.0', true );
     123                wp_enqueue_script(  'caip_corrector',       plugin_dir_url( __FILE__ )      .'js/classes/corrector.js',         array( 'jquery' ), '1.9.0', true );
     124                wp_enqueue_script(  'caip_introduccion',    plugin_dir_url( __FILE__ )      .'js/classes/introduccion.js',      array( 'jquery' ), '1.9.0', true );
     125                wp_enqueue_script(  'caip_conclusion',      plugin_dir_url( __FILE__ )      .'js/classes/conclusion.js',        array( 'jquery' ), '1.9.0', true );
     126                wp_enqueue_script(  'caip_youtube',         plugin_dir_url( __FILE__ )      .'js/classes/youtube.js',           array( 'jquery' ), '1.9.0', true );
     127                wp_enqueue_script(  'caip_cifras',          plugin_dir_url( __FILE__ )      .'js/classes/cifras.js',            array( 'jquery' ), '1.9.0', true );
     128                wp_enqueue_script(  'caip_cronologia',      plugin_dir_url( __FILE__ )      .'js/classes/cronologia.js',        array( 'jquery' ), '1.9.0', true );
     129                wp_enqueue_script(  'caip_faq',             plugin_dir_url( __FILE__ )      .'js/classes/faq.js',               array( 'jquery' ), '1.9.0', true );
     130
     131           
     132                wp_localize_script( 'caip_tags', 'ajax_var', array(
     133                    'url'    => admin_url( 'admin-ajax.php' ),
     134                    'check_nonce'  => wp_create_nonce( 'site_ajax_nonce' ),
     135                ) );
     136           
     137                wp_set_script_translations( 'caip_functions',   'cibeles-ai', plugin_dir_path(__FILE__). '/languages/');
     138                wp_set_script_translations( 'caip_button',      'cibeles-ai', plugin_dir_path(__FILE__). '/languages/');
     139                wp_set_script_translations( 'caip_action',      'cibeles-ai', plugin_dir_path(__FILE__). '/languages/');
     140                wp_set_script_translations( 'caip_titulo',      'cibeles-ai', plugin_dir_path(__FILE__). '/languages/');
     141                wp_set_script_translations( 'caip_tag',         'cibeles-ai', plugin_dir_path(__FILE__). '/languages/');
     142                wp_set_script_translations( 'caip_resumenp',    'cibeles-ai', plugin_dir_path(__FILE__). '/languages/');
     143                wp_set_script_translations( 'caip_multiaction', 'cibeles-ai', plugin_dir_path(__FILE__). '/languages/');
     144               
     145                wp_set_script_translations( 'caip_clickbait',   'cibeles-ai', plugin_dir_path(__FILE__). '/languages/');
     146                wp_set_script_translations( 'caip_titularcorto','cibeles-ai', plugin_dir_path(__FILE__). '/languages/');
     147                wp_set_script_translations( 'caip_titular',     'cibeles-ai', plugin_dir_path(__FILE__). '/languages/');
     148                wp_set_script_translations( 'caip_tags',        'cibeles-ai', plugin_dir_path(__FILE__). '/languages/');
     149                wp_set_script_translations( 'caip_autotags',    'cibeles-ai', plugin_dir_path(__FILE__). '/languages/');
     150                wp_set_script_translations( 'caip_resumen',     'cibeles-ai', plugin_dir_path(__FILE__). '/languages/');
     151                wp_set_script_translations( 'caip_autoexcerpt', 'cibeles-ai', plugin_dir_path(__FILE__). '/languages/');
     152                wp_set_script_translations( 'caip_refrito',     'cibeles-ai', plugin_dir_path(__FILE__). '/languages/');
     153                wp_set_script_translations( 'caip_corrector',   'cibeles-ai', plugin_dir_path(__FILE__). '/languages/');
     154                wp_set_script_translations( 'caip_introduccion','cibeles-ai', plugin_dir_path(__FILE__). '/languages/');
     155                wp_set_script_translations( 'caip_conclusion',  'cibeles-ai', plugin_dir_path(__FILE__). '/languages/');
     156                wp_set_script_translations( 'caip_youtube',     'cibeles-ai', plugin_dir_path(__FILE__). '/languages/');
     157               
     158                //wp_set_script_translations( 'caip_cifras',        'cibeles-ai', plugin_dir_path(__FILE__). '/languages/');
     159                //wp_set_script_translations( 'caip_cronologia',    'cibeles-ai', plugin_dir_path(__FILE__). '/languages/');
     160                //wp_set_script_translations( 'caip_faq',           'cibeles-ai', plugin_dir_path(__FILE__). '/languages/');
     161               
     162               
    101163               
    102164            }else{
    103                 wp_enqueue_script( 'gutenberg_js', plugin_dir_url( __FILE__ ) . 'js/gutenberg.js', array( 'jquery' ), '1.0', true );
    104                 wp_set_script_translations( 'gutenberg_js', 'cibeles-ai', plugin_basename( __DIR__ ) . '/languages/');
     165                wp_enqueue_script( 'gutenberg_js', plugin_dir_url( __FILE__ ) . 'js/gutenberg.js', array( 'jquery' ), '1.0', true );
     166                wp_set_script_translations( 'gutenberg_js', 'cibeles-ai', plugin_. '/languages/');
    105167            }
    106168           
     
    129191                require_once $cibelesAiPlugin['path'] . 'views' . DS . 'thickbox' . DS . 'autoexcerpt.php';
    130192                require_once $cibelesAiPlugin['path'] . 'views' . DS . 'thickbox' . DS . 'refrito.php';
     193
     194
     195
     196
     197
     198
     199
    131200            }       
    132201        }
     
    151220    }
    152221}
     222
     223
     224
     225
     226
     227
     228
     229
     230
     231
     232
     233
     234
     235
     236
     237
     238
     239
     240
     241
     242
     243
     244
     245
     246
     247
     248
     249
     250
     251
     252
     253
     254
     255
     256
     257
     258
     259
     260
     261
     262
     263
     264
     265
     266
     267
  • cibeles-ai/trunk/js/classes/caip_Action.js

    r3036331 r3036333  
    77        this.contenido = '';
    88        this.tokens = 500;
     9
    910        this.responseText = '';
    1011        this.htmlresult = '';
     
    1415        this.loadingDiv.innerHTML = "<div class='loading-indicator'></div>";
    1516        this.responseStartsWhith = '';
     17
    1618    }
    1719   
     
    6062    }
    6163   
    62     ajaxFunction(child, elementoArray = 'xxx') {
     64    ajaxFunction(child, elementoArray = false) {
     65        let inputAjax = '';
     66        if(elementoArray === false){
     67            inputAjax = child.input;
     68        }else{
     69            inputAjax = child.input[elementoArray];
     70        }
    6371        jQuery.ajax({
    6472            url : cibelesAiPlugin.api_url,
    65             data : { input : child.input , tokens : child.tokens, usuario : cibelesAiPlugin.nick, accion : child.id},
     73            data : { input : , tokens : child.tokens, usuario : cibelesAiPlugin.nick, accion : child.id},
    6674            type : 'POST',
    6775            dataType : 'json',
     
    8290                    alert(json.error.message + ' API OPENAI X');
    8391                    child.responseText = '';
    84                     child.ajaxFunction();
     92                    child.ajaxFunction();
    8593                }else{
    86                     if(elementoArray == 'xxx'){
     94                    if(elementoArray ==){
    8795                        child.responseText += json.texto;
    8896                    }else{
    89                         child.responseText = json.texto;
     97                        child.responseText[elementoArray] = json.texto;
     98                        //child.responseText = json.texto;
    9099                    }
    91100                   
     
    98107
    99108                    if(fin == 'length'){
    100                         child.input = child.input + json.texto
    101                         child.ajaxFunction();
     109                        if(elementoArray === false){
     110                            child.input = child.input + json.texto
     111                            child.ajaxFunction();
     112                        }else{
     113                            child.input[elementoArray] = child.input[elementoArray] + json.texto
     114                            child.ajaxFunction();
     115                        }
     116                       
    102117                    }else{
    103118                        console.log('fin ' + child.id + ': ' + fin);
     
    105120                            child.manageResponse(elementoArray);
    106121                        }else{// fin == null
    107                             if(child.responseText.length > 3){
     122                            if(child.responseText.length > 3 || child.responseText[elementoArray] > 3){
     123                               
    108124                                child.manageResponse(elementoArray);
    109125                            }else{
     
    116132                }
    117133            },
     134
     135
     136
     137
     138
     139
     140
    118141            error : function(xhr, status) {
    119142                child.responseText = '';
    120                 child.ajaxFunction();
    121                 alert('Disculpe, existió un problema ajax');
     143                child.ajaxFunction();
     144                alert('Disculpe, existió un ajax');
    122145            },
    123146            complete : function(xhr, status) {
  • cibeles-ai/trunk/js/classes/caip_ResumenP.js

    r3036331 r3036333  
    66        this.tokens = 300;
    77        this.responseStartsWhith = '';
    8         this.prompt = __('Genera un resumen de no más de 35 palabras o 300 caracteres sobre el siguiente texto en español: \n\n','cibeles-ai');
     8        this.prompt = __('Genera un resumen );
    99        this.input = this.prompt + this.contenido + '\n\n' + this.responseStartsWhith;
    1010        this.alertSinContenido = __('No hay ningún texto o contenido en la entrada con la que poder generar el resumen.','cibeles-ai');
  • cibeles-ai/trunk/js/classes/caip_Tag.js

    r3036331 r3036333  
    66        this.responseStartsWhith = '1.';
    77        this.cantidad = caip_settings.caip_numero_tags;
    8         this.prompt = __('Una lista ordenada de 10 etiquetas sobre en siguiente texto:\n\n','cibeles-ai').replace('%d', caip_settings.caip_numero_tags);
     8        this.prompt = __('Una lista ordenada de );
    99        this.originalPrompt = this.prompt;
    1010        this.input = this.prompt + this.contenido + '\n\n' + this.responseStartsWhith;
  • cibeles-ai/trunk/js/classes/clickbait.js

    r3036331 r3036333  
    88        this.id = 'clickbait';
    99        this.divresult = '.result.clickbait';
    10         this.prompt = __('Un listado de %d titulares estilo clickbait sobre el siguiente texto: \n\n','cibeles-ai').replace('%d', caip_settings.caip_numero_titulares);
     10        this.prompt = __('Un listado de %d titulares estilo clickbait );
    1111        this.input = this.prompt + this.contenido + '\n\n';
    1212        this.setButtons();
  • cibeles-ai/trunk/js/classes/refrito.js

    r3036331 r3036333  
    1 class caip_Refrito extends caip_Action{
     1class caip_Refrito extends caip_ction{
    22       
    33    constructor() {
     
    66          return caip_Refrito.instance;
    77        }
    8         this.inputHTML = true;
    9         this.tokens = 2000;
    10         this.prompt = __('Reescribe con otras frases u oraciones, cambiando algunas palabras o expresiones por sinónimos, modificando el orden del sujeto y predicado, preservando las etiquetas HTML por otras semejantes, etc, sobre el siguiente texto en español: \n\n','cibeles-ai');
    11         this.responseStartsWhith = 'ORIGINAL: <p>Los refritos son baratos y dan visitas.</p> \n\nREESCRITO: <p>Refritar resulta económico y atrae tráfico.</p> \n\nORIGINAL:';
    12         this.input = this.prompt + '\n\n' + this.responseStartsWhith + this.contenido + '\n\nREFRITO:'  ;
     8        this.prompt = __('Reescribe con otras frases u oraciones, reemplazando palabras o expresiones por sinónimos y cambiando el orden del sujeto y predicado, preservando las etiquetas HTML por otras semejantes, etc, %s sobre el siguiente texto: \n\n','cibeles-ai').replace('%s',cibelesAiPlugin['idioma']);
     9        this.responseStartsWhith = __('ORIGINAL: <p>Los refritos son <strong>baratos</strong> y dan visitas.</p> \nREESCRITO: <p>Refritar resulta <strong>económico</strong> y atrae tráfico.</p> \n\nORIGINAL:','cibeles-ai');
     10        this.responseEndsWhith = __('\nREESCRITO: ','cibeles-ai');
     11        this.input = this.prompt + this.responseStartsWhith + this.contenido + this.responseEndsWhith  ;
    1312        this.alertSinContenido = __('No hay ningún texto o contenido en la entrada con la que poder generar el refrito.','cibeles-ai');
    1413        this.id = 'refrito';
    1514        this.divresult = '.result.refrito';
     15
     16
     17
     18
     19
     20
     21
    1622        this.setButtons();
    1723        this.viewHeadingsStyle();
    18         this.partes = [];
    19         this.partesOriginal = [];
     24       
    2025        caip_Refrito.instance = this;
    21     }
    22    
    23     refrito(div){
    24         if(tinyMCE && tinyMCE.activeEditor != null){
    25             tinymce.get("content").setContent(jQuery(this.divresult + ' .refritoResponse').html());
    26             this.boton.changeIconToChecked(div);
    27         }else{
    28             alert(__('Hay un problema con el edior tinyMCE, asegúrese que está en modo visual','cibeles-ai'));
    29         }
    30                
    31     }
    32    
    33     launch(){
    34         let partesContenido = this.setDivsContent();
    35         this.boton.changeIconToPower();
    36         this.launched = true;
    37         this.showLoadingDiv(); 
    38         jQuery('#'+this.buttons_id).remove();
    39         for(var i=0; i<partesContenido.length; i++){
    40             this.input = this.prompt + '\n\n' + this.responseStartsWhith + partesContenido[i] + '\n\n REFRITO:'  ;
    41             let textoLimpio = this.partesOriginal[i].replace(/(<([^>]+)>)/gi, "");
    42             textoLimpio = textoLimpio.replace('&nbsp;',' ');
    43             textoLimpio = textoLimpio.trim();
    44             if(this.partesOriginal[i].length > 5000 || this.partesOriginal[i].trim() == '' || textoLimpio == ''){
    45                 this.partes[i] = this.partesOriginal[i];
    46                 this.manageResponse(i,this.partesOriginal[i]);
    47             }else{
    48                 this.partes[i] = '...@@@xxxPROCESSEDFALSExxx@@@...'
    49                 super.ajaxFunction(this,i);
    50             }
    51            
    52         }
    53     }
    54    
    55     manageResponse(i,responseOriginal=false){
    56         if(responseOriginal!=false){
    57             this.partes[i] = responseOriginal;
    58         }else{
    59             this.partes[i] = this.responseText.trim();
    60         }
    61        
    62         this.pintaAvanceResponse();     
    63     }
    64     endResponses(){
    65         super.manageResponse();
    66         jQuery(this.divresult).append(this.buttons_html);
    67         jQuery('#' + this.buttons_id).append(this.button_recargarOriginal + this.button_regenerar + this.button_refrito  + this.button_copy);
    68     }
    69    
    70     pintaAvanceResponse(){
    71         let refritoResponse = '';
    72         let processedFalse = '...@@@xxxPROCESSEDFALSExxx@@@...';
    73 
    74         for(var i=0; i<this.partes.length; i++){
    75             if(this.partes[i] != processedFalse){
    76                 refritoResponse = refritoResponse + this.partes[i];
    77                 if((i+1) == this.partes.length){
    78                     this.endResponses();
    79                 }
    80             }else{
    81                 break;
    82                
    83             }
    84         }
    85         jQuery(this.divresult + ' .refritoResponse').html(refritoResponse);     
    86     }
    87    
    88     setDivsContent(){
    89         let textoNoticiaHtml = this.functions.get_todo_contenido(this.inputHTML);
    90         let partes = this.functions.getArrayPartsFromHTMLString(textoNoticiaHtml);
    91         jQuery(this.divresult + ' .original').html(textoNoticiaHtml);
    92         jQuery(this.divresult + ' .refritoResponse').html('');
    93         this.partesOriginal = partes;
    94         return partes;
    95     }
    96        
    97     recargarOriginal(div){
    98         let textoNoticiaHtml = this.functions.get_todo_contenido(this.inputHTML);
    99         jQuery(this.divresult + ' .original').html(textoNoticiaHtml);
    100         this.boton.changeIconToChecked(div);
    101     }
    102    
    103     viewHeadingsStyle(){
    104         jQuery(this.divresult).append('<div class="containerOriginal"></div>');
    105         jQuery(this.divresult).append('<div class="containerRefritoResponse"></div>');
    106         jQuery(this.divresult + ' .containerOriginal').append('<div class="original"></div>');
    107         jQuery(this.divresult + ' .containerRefritoResponse').append('<div class="refritoResponse"></div>');
    108        
    109         var styleElement = jQuery('<style>');
    110         var headingOriginal = __('Original','cibeles-ai');
    111         var headingRefrito = __('Refrito','cibeles-ai');
    112         styleElement.append('.refrito .containerOriginal::before { content: "' + headingOriginal + '"; }');
    113         styleElement.append('.refrito .containerRefritoResponse::before { content: "' + headingRefrito + '"; }');
    114         jQuery('head').append(styleElement);
    115        
    116         jQuery(window).resize( function() {
    117             try {
    118                 if(jQuery(caip_refrito.divresult).width()>0){
    119                     caip_refrito.refrito_resize_thickbox_fullsize();
    120                 }
    121             } catch (error) {
    122                 console.log(error);
    123             }
    124         });
    125     }
    126     refrito_resize_thickbox_fullsize() {
    127         let anchoWorkspace = jQuery('#wpcontent').width();
    128         let anchoWPWindow = jQuery('#wpwrap').width();
    129         let anchoWPmenu_izq = anchoWPWindow - anchoWorkspace;
    130         jQuery(document).find('#TB_window').width(anchoWorkspace-20).css( 'margin-left', -  ((anchoWorkspace) / 2) + (anchoWPmenu_izq/2) );
    131     }
    132 
    133     setButtons(){
    134         super.setButtons(this.id);
    135         this.buttons_id =   'div_buttons_' + this.id;
    136         this.buttons_html = '<div id="'+this.buttons_id+'" class="more center"></div>';
    137        
    138         this.button_recargarOriginal =  '<div class="cibelesAi_button" onclick="caip_'+this.id+'.recargarOriginal(this);"><a title="'+__('Refrescar original','cibeles-ai')+'">'+__('Refrescar original','cibeles-ai')+ this.boton.powerIcon +'</a></div>';
    139         this.button_regenerar =     '<div class="cibelesAi_button" onclick="caip_'+this.id+'.launch();"><a title="'+__('Generar de nuevo','cibeles-ai')+'">'+__('Regenerar','cibeles-ai')+ this.boton.powerIcon +'</a></div>';
    140         this.button_refrito =   '<div class="cibelesAi_button" onclick="caip_'+this.id+'.refrito(this);"><a title="'+__('Reemplazar contenido de la entrada con el refrito generado','cibeles-ai')+'">'+__('Insertar contenido','cibeles-ai')+'</a></div>';
    141         this.button_copy =  '<div class="cibelesAi_button" onclick="caip_'+this.id+'.copiar(this,\'.result.refrito .refritoResponse\');"><a title="'+__('Copiar','cibeles-ai')+'">'+__('Copiar','cibeles-ai')+'</a></div>';
    142     }
     26    }   
    14327   
    14428}
  • cibeles-ai/trunk/js/classes/resumen.js

    r3036331 r3036333  
    4646            this.boton.changeIconToChecked(div);
    4747        }else{
    48             alert(__('Hay un problema con el edior tinyMCE, asegúrese que está en modo visual','cibeles-ai'));
     48            alert(__('Hay un problema con el edior tinyMCE, asegúrese que está en modo visual','cibeles-ai'));
    4949        }
    5050               
  • cibeles-ai/trunk/js/classes/tags.js

    r3036331 r3036333  
    2626        jQuery('#' + this.buttons_id).append(this.button_more + this.button_all + this.button_custom);
    2727        //this.functions.spin_buttons();
     28
    2829        this.makeTagSelectable();
    2930    }
     
    3334        jQuery('#TB_closeWindowButton').click();
    3435    }
     36
     37
     38
     39
     40
     41
     42
     43
     44
     45
     46
     47
     48
     49
     50
     51
     52
     53
     54
     55
     56
     57
     58
     59
     60
     61
     62
     63
     64
    3565
    3666
  • cibeles-ai/trunk/js/classes/titular.js

    r3036331 r3036333  
    88        this.id = 'titular';
    99        this.divresult = '.result.titular';
    10         this.prompt = __('Un listado de %d titulares sobre el siguiente texto: \n\n','cibeles-ai').replace('%d', caip_settings.caip_numero_titulares);
     10        this.prompt = __('Un listado de %d titulares );
    1111        this.input = this.prompt + this.contenido + '\n\n';
    1212        this.setButtons();
  • cibeles-ai/trunk/js/classes/titularcorto.js

    r3036331 r3036333  
    88        this.id = 'titularcorto';
    99        this.divresult = '.result.titularcorto';
    10         this.prompt = __('Un listado de %d titulares muy cortos sobre el siguiente texto: \n\n','cibeles-ai').replace('%d', caip_settings.caip_numero_titulares);
     10        this.prompt = __('Un listado de %d titulares muy cortos );
    1111        this.input = this.prompt + this.contenido + '\n\n';
    1212        this.setButtons();
  • cibeles-ai/trunk/js/init_ai_fields.js

    r3036331 r3036333  
    2020let caip_autotags;
    2121let caip_resumen;
    22 
     22let caip_autoexcerpt;
     23let caip_refrito;
     24let caip_corrector;
     25let caip_introduccion;
     26let caip_conclusion;
     27let caip_youtube;
    2328
    2429document.addEventListener("DOMContentLoaded", () => {   
     
    8085    });
    8186   
     87
     88
     89
     90
     91
     92
    8293   
     94
     95
     96
     97
     98
     99
     100
     101
     102
     103
     104
     105
     106
     107
     108
     109
     110
     111
     112
     113
     114
     115
     116
     117
     118
     119
     120
     121
     122
     123
     124
     125
     126
     127
     128
     129
     130
     131
     132
     133
     134
    83135});
    84136
  • cibeles-ai/trunk/options.php

    r3036331 r3036333  
    2222        'caip_pluginPage'
    2323    );
    24 /*
     24
    2525    add_settings_field(
    26         'caip_API_KEY',
    27         __( 'API KEY', 'cibeles-ai' ),
    28         'caip_API_KEY_render',
     26        'caip_',
     27        __( '', 'cibeles-ai' ),
     28        'caip__render',
    2929        'caip_pluginPage',
    3030        'caip_pluginPage_section'
    3131    );
    32 */
     32   
    3333    add_settings_field(
    3434        'caip_numero_titulares',
     
    4646        'caip_pluginPage_section'
    4747    );
    48     /*
     48   
    4949    add_settings_field(
    50         'caip_numero_resumenes',
    51         __( 'Cantidad de resúmenes generados', 'cibeles-ai' ),
    52         'caip_numero_resumenes_render',
     50        'caip_s',
     51        __( 's', 'cibeles-ai' ),
     52        'caip_s_render',
    5353        'caip_pluginPage',
    5454        'caip_pluginPage_section'
    5555    );
    56     */
    57 }
    58 
    59 
    60 function caip_API_KEY_render(  ) {
     56
     57}
     58
     59function caip_radio_idioma_render(  ) {
    6160
    6261    $options = get_option( 'caip_settings' );
     62
     63
     64
     65
     66
     67
    6368    ?>
    64     <input type='text' name='caip_settings[caip_API_KEY]' value='<?php esc_html_e($options['caip_API_KEY']); ?>' style="min-width:400px;">
     69    <label>
     70        <input type="radio" name="caip_settings[caip_radio_idioma]" value="1" <?php if($options['caip_radio_idioma']=='1'){ esc_html_e('checked'); }?>>
     71        <?php esc_html_e(__( 'Idioma del usuario en WP', 'cibeles-ai' )); ?>
     72        <?php echo wp_kses_post(' ('.__( 'idioma detectado', 'cibeles-ai' ).': <strong>'.$WP_lang.'</strong>)'); ?>
     73    </label>
     74    <br>
     75    <br>
     76    <label>
     77        <input type="radio" name="caip_settings[caip_radio_idioma]" value="2" <?php if($options['caip_radio_idioma']=='2'){ esc_html_e('checked'); }?>>
     78        <?php esc_html_e(__( 'WPML automático', 'cibeles-ai' )); ?>
     79        <?php echo wp_kses_post(' ('.__( 'idioma detectado', 'cibeles-ai' ).': <strong>'.$WPML_lang.'</strong>)'); ?>
     80    </label>
     81    <!--
     82    <br>
     83    <br>
     84    <label>
     85        <input type="radio" name="idioma" value="2" <?php if($options['caip_radio_idioma']=='3'){ esc_html_e('checked'); }?>>
     86        <?php esc_html_e(__( 'Idioma fijo', 'cibeles-ai' )); ?>
     87    </label>
     88    <br>
     89    -->
    6590    <?php
    66 
    6791}
    6892
     
    88112    <?php
    89113}
    90 function caip_numero_resumenes_render(  ) {
     114
     115function caip_enable_buttons_render(  ) {
    91116
    92117    $options = get_option( 'caip_settings' );
    93     if(!isset($options['caip_numero_resumenes']) || $options['caip_numero_resumenes'] == ''  || $options['caip_numero_resumenes'] < 1  || $options['caip_numero_resumenes'] > 7){
    94         $options['caip_numero_resumenes'] = 3;
    95     }
     118    Global $cibelesAiPlugin;
     119    include_once($cibelesAiPlugin['path'] . 'options_buttons_default.php');
     120   
     121
     122
    96123    ?>
    97     <input type='number' name='caip_settings[caip_numero_resumenes]' min="1" max="7" value='<?php esc_html_e($options['caip_numero_resumenes']); ?>' style="max-width:80px;">
     124    <table class="options-cibelesai">
     125        <tr>
     126            <td>
     127                <input type='hidden' name='caip_settings[caip_enable_buttons][titular]' value='off'>
     128                <input type='checkbox' name='caip_settings[caip_enable_buttons][titular]' style="max-width:80px;" <?php if($options['caip_enable_buttons']['titular'] == 'on'){ echo 'checked';} ?> />
     129            </td>
     130            <td>
     131                <div class="cibelesAi_button">
     132                    <a href="#" title="<?php esc_html_e('Generación titular','cibeles-ai'); ?>">
     133                        <?php  esc_html_e('Titular','cibeles-ai'); ?>
     134                        <i class="fa fa-superpowers"></i>
     135                    </a>
     136                </div>
     137                <div class="descriptionOptions"><?php esc_html_e('Generación titular','cibeles-ai'); ?></div>
     138            </td>
     139        </tr>
     140        <tr>
     141            <td>
     142                <input type='hidden' name='caip_settings[caip_enable_buttons][titularcorto]' value='off'>
     143                <input type='checkbox' name='caip_settings[caip_enable_buttons][titularcorto]' style="max-width:80px;" <?php if($options['caip_enable_buttons']['titularcorto'] == 'on'){ echo 'checked';} ?> />
     144            </td>
     145            <td>
     146                <div class="cibelesAi_button">
     147                    <a href="#" title="<?php esc_html_e('Generación titular corto','cibeles-ai'); ?>">
     148                        <?php  esc_html_e('Titular corto','cibeles-ai'); ?>
     149                        <i class="fa fa-superpowers"></i>
     150                    </a>
     151                </div>
     152                <div class="descriptionOptions"><?php esc_html_e('Generación titular corto','cibeles-ai'); ?></div>
     153            </td>
     154        </tr>
     155        <tr>
     156            <td>
     157                <input type='hidden' name='caip_settings[caip_enable_buttons][clickbait]' value='off'>
     158                <input type='checkbox' name='caip_settings[caip_enable_buttons][clickbait]' style="max-width:80px;" <?php if($options['caip_enable_buttons']['clickbait'] == 'on'){ echo 'checked';} ?> />
     159            </td>
     160            <td>
     161                <div class="cibelesAi_button">
     162                    <a href="#" title="<?php esc_html_e('Generación clickbait','cibeles-ai'); ?>">
     163                        <?php  esc_html_e('Clickbait','cibeles-ai'); ?>
     164                        <i class="fa fa-superpowers"></i>
     165                    </a>
     166                </div>
     167                <div class="descriptionOptions"><?php esc_html_e('Generación clickbait','cibeles-ai'); ?></div>
     168            </td>
     169        </tr>
     170        <tr><td><br /></td><td></td></tr>
     171        <tr>
     172            <td>
     173                <input type='hidden' name='caip_settings[caip_enable_buttons][tags]' value='off'>
     174                <input type='checkbox' name='caip_settings[caip_enable_buttons][tags]' style="max-width:80px;" <?php if($options['caip_enable_buttons']['tags'] == 'on'){ echo 'checked';} ?> />
     175            </td>
     176            <td>
     177                <div class="cibelesAi_button">
     178                    <a href="#" title="<?php esc_html_e('Generación tags con asistente','cibeles-ai'); ?>">
     179                        <?php  esc_html_e('Tags','cibeles-ai'); ?>
     180                        <i class="fa fa-superpowers"></i>
     181                    </a>
     182                </div>
     183                <div class="descriptionOptions"><?php esc_html_e('Generación tags con asistente','cibeles-ai'); ?></div>
     184            </td>
     185        </tr>
     186        <tr>
     187            <td>
     188                <input type='hidden' name='caip_settings[caip_enable_buttons][autotags]' value='off'>
     189                <input type='checkbox' name='caip_settings[caip_enable_buttons][autotags]' style="max-width:80px;" <?php if($options['caip_enable_buttons']['autotags'] == 'on'){ echo 'checked';} ?> />
     190            </td>
     191            <td>
     192                <div class="cibelesAi_button">
     193                    <a href="#" title="<?php esc_html_e('Generación tags automática','cibeles-ai'); ?>">
     194                        <?php  esc_html_e('Autotags','cibeles-ai'); ?>
     195                        <i class="fa fa-superpowers"></i>
     196                    </a>
     197                </div>
     198                <div class="descriptionOptions"><?php esc_html_e('Generación tags automática','cibeles-ai'); ?></div>
     199            </td>
     200        </tr>
     201        <tr><td><br /></td><td></td></tr>
     202        <tr>
     203            <td>
     204                <input type='hidden' name='caip_settings[caip_enable_buttons][resumen]' value='off'>
     205                <input type='checkbox' name='caip_settings[caip_enable_buttons][resumen]' style="max-width:80px;" <?php if($options['caip_enable_buttons']['resumen'] == 'on'){ echo 'checked';} ?> />
     206            </td>
     207            <td>
     208                <div class="cibelesAi_button">
     209                    <a href="#" title="<?php esc_html_e('Generación resumen','cibeles-ai'); ?>">
     210                        <?php  esc_html_e('Resumen','cibeles-ai'); ?>
     211                        <i class="fa fa-superpowers"></i>
     212                    </a>
     213                </div>
     214                <div class="descriptionOptions"><?php esc_html_e('Generación resumen','cibeles-ai'); ?></div>
     215            </td>
     216        </tr>
     217        <tr>
     218            <td>
     219                <input type='hidden' name='caip_settings[caip_enable_buttons][autoexcerpt]' value='off'>
     220                <input type='checkbox' name='caip_settings[caip_enable_buttons][autoexcerpt]' style="max-width:80px;" <?php if($options['caip_enable_buttons']['autoexcerpt'] == 'on'){ echo 'checked';} ?> />
     221            </td>
     222            <td>
     223                <div class="cibelesAi_button">
     224                    <a href="#"  title="<?php esc_html_e('Generación extracto automático','cibeles-ai'); ?>">
     225                        <?php  esc_html_e('Autoexcerpt','cibeles-ai'); ?>
     226                        <i class="fa fa-superpowers"></i>
     227                    </a>
     228                </div>
     229                <div class="descriptionOptions"><?php esc_html_e('Generación extracto automático','cibeles-ai'); ?></div>
     230            </td>
     231        </tr>
     232        <tr>
     233            <td>
     234                <input type='hidden' name='caip_settings[caip_enable_buttons][introduccion]' value='off'>
     235                <input type='checkbox' name='caip_settings[caip_enable_buttons][introduccion]' style="max-width:80px;" <?php if($options['caip_enable_buttons']['introduccion'] == 'on'){ echo 'checked';} ?> />
     236            </td>
     237            <td>
     238                <div class="cibelesAi_button">
     239                    <a href="#" title="<?php esc_html_e('Generación introducción','cibeles-ai'); ?>">
     240                        <?php  esc_html_e('Introducción','cibeles-ai'); ?>
     241                        <i class="fa fa-superpowers"></i>
     242                    </a>
     243                </div>
     244                <div class="descriptionOptions"><?php esc_html_e('Generación introducción','cibeles-ai'); ?></div>
     245            </td>
     246        </tr>
     247        <tr>
     248            <td>
     249                <input type='hidden' name='caip_settings[caip_enable_buttons][conclusion]' value='off'>
     250                <input type='checkbox' name='caip_settings[caip_enable_buttons][conclusion]' style="max-width:80px;" <?php if($options['caip_enable_buttons']['conclusion'] == 'on'){ echo 'checked';} ?> />
     251            </td>
     252            <td>
     253                <div class="cibelesAi_button">
     254                    <a href="#" title="<?php esc_html_e('Generación conclusión','cibeles-ai'); ?>">
     255                        <?php  esc_html_e('Conclusión','cibeles-ai'); ?>
     256                        <i class="fa fa-superpowers"></i>
     257                    </a>
     258                </div>
     259                <div class="descriptionOptions"><?php esc_html_e('Generación conclusión','cibeles-ai'); ?></div>
     260            </td>
     261        </tr>
     262        <tr>
     263            <td>
     264                <input type='hidden' name='caip_settings[caip_enable_buttons][refrito]' value='off'>
     265                <input type='checkbox' name='caip_settings[caip_enable_buttons][refrito]' style="max-width:80px;" <?php if($options['caip_enable_buttons']['refrito'] == 'on'){ echo 'checked';} ?> />
     266            </td>
     267            <td>
     268                <div class="cibelesAi_button">
     269                    <a href="#" title="<?php esc_html_e('Generación refrito, reescribe el texto','cibeles-ai'); ?>">
     270                        <?php esc_html_e('Refrito','cibeles-ai'); ?>
     271                        <i class="fa fa-superpowers"></i>
     272                    </a>
     273                </div>
     274                <div class="descriptionOptions"><?php esc_html_e('Generación refrito, reescribe el texto','cibeles-ai'); ?></div>
     275            </td>
     276        </tr>
     277        <tr>
     278            <td>
     279                <input type='hidden' name='caip_settings[caip_enable_buttons][corrector]' value='off'>
     280                <input type='checkbox' name='caip_settings[caip_enable_buttons][corrector]' style="max-width:80px;" <?php if($options['caip_enable_buttons']['corrector'] == 'on'){ echo 'checked';} ?> />
     281            </td>
     282            <td>
     283                <div class="cibelesAi_button">
     284                    <a href="#" title="<?php esc_html_e('Corrección de ortografía, sintaxis y semántica','cibeles-ai'); ?>">
     285                        <?php esc_html_e('Corrector','cibeles-ai'); ?>
     286                        <i class="fa fa-superpowers"></i>
     287                    </a>
     288                </div>
     289                <div class="descriptionOptions"><?php esc_html_e('Corrección de ortografía, sintaxis y semántica','cibeles-ai'); ?></div>
     290            </td>
     291        </tr>
     292        <tr>
     293            <td>
     294                <input type='hidden' name='caip_settings[caip_enable_buttons][youtube]' value='off'>
     295                <input type='checkbox' name='caip_settings[caip_enable_buttons][youtube]' style="max-width:80px;" <?php if($options['caip_enable_buttons']['youtube'] == 'on'){ echo 'checked';} ?> />
     296            </td>
     297            <td>
     298                <div class="cibelesAi_button">
     299                    <a href="#" title="<?php esc_html_e('Creación de una noticia a partir de un video de Youtube','cibeles-ai'); ?>">
     300                        <?php esc_html_e('Youtube','cibeles-ai'); ?>
     301                        <i class="fa fa-superpowers"></i>
     302                    </a>
     303                </div>
     304                <div class="descriptionOptions"><?php esc_html_e('Creación de una noticia a partir de un video de Youtube','cibeles-ai'); ?></div>
     305            </td>
     306        </tr>
     307        <tr>
     308            <td>
     309                <input type='hidden' name='caip_settings[caip_enable_buttons][cifras]' value='off'>
     310                <input type='checkbox' name='caip_settings[caip_enable_buttons][cifras]' style="max-width:80px;" <?php if($options['caip_enable_buttons']['cifras'] == 'on'){ echo 'checked';} ?> />
     311            </td>
     312            <td>
     313                <div class="cibelesAi_button">
     314                    <a href="#" title="<?php esc_html_e('Creación de una tabla con las cifras del contenido','cibeles-ai'); ?>">
     315                        <?php esc_html_e('Cifras','cibeles-ai'); ?>
     316                        <i class="fa fa-superpowers"></i>
     317                    </a>
     318                </div>
     319                <div class="descriptionOptions"><?php esc_html_e('Creación de una tabla con las cifras del contenido','cibeles-ai'); ?></div>
     320            </td>
     321        </tr>
     322        <tr>
     323            <td>
     324                <input type='hidden' name='caip_settings[caip_enable_buttons][cronologia]' value='off'>
     325                <input type='checkbox' name='caip_settings[caip_enable_buttons][cronologia]' style="max-width:80px;" <?php if($options['caip_enable_buttons']['cronologia'] == 'on'){ echo 'checked';} ?> />
     326            </td>
     327            <td>
     328                <div class="cibelesAi_button">
     329                    <a href="#" title="<?php esc_html_e('Creación de un texto con encabezados con la cronologia del contenido','cibeles-ai'); ?>">
     330                        <?php esc_html_e('Cronología','cibeles-ai'); ?>
     331                        <i class="fa fa-superpowers"></i>
     332                    </a>
     333                </div>
     334                <div class="descriptionOptions"><?php esc_html_e('Creación de un texto con encabezados con la cronologia del contenido','cibeles-ai'); ?></div>
     335            </td>
     336        </tr>
     337        <tr>
     338            <td>
     339                <input type='hidden' name='caip_settings[caip_enable_buttons][faq]' value='off'>
     340                <input type='checkbox' name='caip_settings[caip_enable_buttons][faq]' style="max-width:80px;" <?php if($options['caip_enable_buttons']['faq'] == 'on'){ echo 'checked';} ?> />
     341            </td>
     342            <td>
     343                <div class="cibelesAi_button">
     344                    <a href="#" title="<?php esc_html_e('Creación de una tabla con la FAQ del contenido','cibeles-ai'); ?>">
     345                        <?php esc_html_e('FAQ','cibeles-ai'); ?>
     346                        <i class="fa fa-superpowers"></i>
     347                    </a>
     348                </div>
     349                <div class="descriptionOptions"><?php esc_html_e('Creación de una tabla con la FAQ del contenido','cibeles-ai'); ?></div>
     350            </td>
     351        </tr>
     352    </table>
     353
    98354    <?php
    99 
    100355}
    101356
  • cibeles-ai/trunk/options_buttons_default.php

    r2920103 r3036333  
    3636    $options['caip_enable_buttons']['youtube'] = 'on';
    3737}
     38
     39
     40
     41
     42
     43
     44
     45
     46
  • cibeles-ai/trunk/readme.txt

    r3036331 r3036333  
    11=== CIBELES AI ===
    22Contributors: borjaabad, soportecibeles
    3 Tags: artificial intelligence, journalists, ai integrated in wordpress, autotags, autoexcerpt, summary, headings, titles
     3Tags: artificial intelligence, journalists, ai integrated in wordpress, autotags, autoexcerpt, summary, headings, titles
    44Requires at least: 4.9
    5 Tested up to: 6.2
     5Tested up to: 6.2
    66Requires PHP: 5.6
    7 Stable tag: 1.1.2
     7Stable tag: 1.
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    1313== Description ==
    1414
    15 AWRITING ASSISTANT WITHIN THE NEWS
     15AWRITING ASSISTANT WITHIN THE NEWS
    1616Cibeles' new writing assistant allows the incorporation of artificial intelligence (AI) as a simple and useful work tool for journalists, in the creation of content.
    1717Currently, the writing assistant is active for the following options:
     
    2323Tags
    2424Autotags
     25
     26
     27
     28
     29
     30
     31
     32
    2533
    2634> <strong>CIBELES AI Premium Support</strong><br>
     
    7583== Changelog ==
    7684
     85
     86
     87
     88
     89
     90
     91
     92
     93
     94
     95
     96
     97
     98
     99
     100
     101
     102
     103
     104
     105
     106
     107
     108
     109
     110
     111
     112
     113
     114
     115
     116
     117
     118
     119
     120
     121
    77122= 1.0.0 =
    78 * Initial commit
    79 = 1.0.1 =
    80 * Handle WP error
    81 * Update SVG icon.svg
    82 = 1.1 =
    83 * Rewrite of post content (ideal for press releases, and avoid duplicate content from Google).
    84 = 1.1.1 =
    85 * Fix some bugs.
    86 = 1.1.2 =
    87 * Add browsers compatibility
     123Commit inicial.
  • cibeles-ai/trunk/views/buttons.php

    r3036331 r3036333  
    11<?php
    22if (!defined('ABSPATH')) exit;
     3
     4
     5
    36?>
    47<!-- TITLEDIV -->
    58<div id="div_group_button_titlediv" style="display:none">
    6    
    7         <div id="div_button_titular" class="cibelesAi_button">
    8             <a href="#TB_inline?&height=300&width=400&inlineId=titular" class="thickbox" title="<?php esc_html_e('Generación titular','cibeles-ai'); ?>">
    9                 <?php  esc_html_e('Titular','cibeles-ai'); ?>
    10                 <i class="fa fa-superpowers"></i>
    11             </a>
    12         </div>
    13        
    14         <div id="div_button_titularcorto" class="cibelesAi_button">
    15             <a href="#TB_inline?&width=200&height=550&inlineId=titularcorto" class="thickbox" title="<?php esc_html_e('Generación titular corto','cibeles-ai'); ?>">
    16                 <?php  esc_html_e('Titular corto','cibeles-ai'); ?>
    17                 <i class="fa fa-superpowers"></i>
    18             </a>
    19         </div>
    20        
    21         <div id="div_button_clickbait" class="cibelesAi_button">
    22             <a href="#TB_inline?&width=200&height=550&inlineId=clickbait" class="thickbox"  title="<?php esc_html_e('Generación clickbait','cibeles-ai'); ?>">
    23                 <?php  esc_html_e('Clickbait','cibeles-ai'); ?>
    24                 <i class="fa fa-superpowers"></i>
    25             </a>
    26         </div>
     9        <?php if($options['caip_enable_buttons']['titular'] == 'on'){ ?>
     10            <div id="div_button_titular" class="cibelesAi_button">
     11                <a href="#TB_inline?&height=300&width=400&inlineId=titular" class="thickbox" title="<?php esc_html_e('Generación titular','cibeles-ai'); ?>">
     12                    <?php  esc_html_e('Titular','cibeles-ai'); ?>
     13                    <i class="fa fa-superpowers"></i>
     14                </a>
     15            </div>
     16        <?php } ?>
     17        <?php if($options['caip_enable_buttons']['titularcorto'] == 'on'){ ?>
     18            <div id="div_button_titularcorto" class="cibelesAi_button">
     19                <a href="#TB_inline?&width=200&height=550&inlineId=titularcorto" class="thickbox" title="<?php esc_html_e('Generación titular corto','cibeles-ai'); ?>">
     20                    <?php  esc_html_e('Titular corto','cibeles-ai'); ?>
     21                    <i class="fa fa-superpowers"></i>
     22                </a>
     23            </div>
     24        <?php } ?>
     25        <?php if($options['caip_enable_buttons']['clickbait'] == 'on'){ ?>
     26            <div id="div_button_clickbait" class="cibelesAi_button">
     27                <a href="#TB_inline?&width=200&height=550&inlineId=clickbait" class="thickbox"  title="<?php esc_html_e('Generación clickbait','cibeles-ai'); ?>">
     28                    <?php  esc_html_e('Clickbait','cibeles-ai'); ?>
     29                    <i class="fa fa-superpowers"></i>
     30                </a>
     31            </div>
     32        <?php } ?>
    2733   
    2834</div>
     
    3036<!-- TAGSDIV -->
    3137<div id="div_group_button_tagsdiv" style="display:none">
    32    
    33         <div id="div_button_tags" class="cibelesAi_button">
    34             <a href="#TB_inline?&height=300&width=400&inlineId=tags" class="thickbox" title="<?php esc_html_e('Generación tags','cibeles-ai'); ?>">
    35                 <?php  esc_html_e('Tags','cibeles-ai'); ?>
    36                 <i class="fa fa-superpowers"></i>
    37             </a>
    38         </div>
    39        
    40         <div id="div_button_autotags" class="cibelesAi_button">
    41             <a href="#TB_inline?&height=300&width=400&inlineId=autotags" title="<?php esc_html_e('Generación tags automática','cibeles-ai'); ?>">
    42                 <?php  esc_html_e('Autotags','cibeles-ai'); ?>
    43                 <i class="fa fa-superpowers"></i>
    44             </a>
    45         </div>
    46    
     38        <?php if($options['caip_enable_buttons']['tags'] == 'on'){ ?>
     39            <div id="div_button_tags" class="cibelesAi_button">
     40                <a href="#TB_inline?&height=300&width=400&inlineId=tags" class="thickbox" title="<?php esc_html_e('Generación tags','cibeles-ai'); ?>">
     41                    <?php  esc_html_e('Tags','cibeles-ai'); ?>
     42                    <i class="fa fa-superpowers"></i>
     43                </a>
     44            </div>
     45        <?php } ?>
     46        <?php if($options['caip_enable_buttons']['autotags'] == 'on'){ ?>
     47            <div id="div_button_autotags" class="cibelesAi_button">
     48                <a href="#TB_inline?&height=300&width=400&inlineId=autotags" title="<?php esc_html_e('Generación tags automática','cibeles-ai'); ?>">
     49                    <?php  esc_html_e('Autotags','cibeles-ai'); ?>
     50                    <i class="fa fa-superpowers"></i>
     51                </a>
     52            </div>
     53        <?php } ?>
    4754</div>
    4855
    4956<!-- POSTDIVRICH  -->
    5057<div id="div_group_button_postdiv" style="display:none">
    51         <div id="div_button_resumen" class="cibelesAi_button">
    52             <a href="#TB_inline?&height=300&width=400&inlineId=resumen" class="thickbox" title="<?php esc_html_e('Generación resumen','cibeles-ai'); ?>">
    53                 <?php  esc_html_e('Resumen','cibeles-ai'); ?>
    54                 <i class="fa fa-superpowers"></i>
    55             </a>
    56         </div>
    57         <div id="div_button_autoexcerpt" class="cibelesAi_button">
    58             <a href="#TB_inline?&height=300&width=400&inlineId=autoexcerpt"  title="<?php esc_html_e('Generación excerpt automática','cibeles-ai'); ?>">
    59                 <?php  esc_html_e('Autoexcerpt','cibeles-ai'); ?>
    60                 <i class="fa fa-superpowers"></i>
    61             </a>
    62         </div>
    63         <div id="div_button_refrito" class="cibelesAi_button">
    64             <a href="#" onclick="tb_show('<?php esc_html_e('Generación refrito','cibeles-ai'); ?>', '#TB_inline?&inlineId=refrito&width=full&height=full&max-width=1520');  setTimeout(() => { caip_refrito.refrito_resize_thickbox_fullsize(); }, '50');">
    65                 <?php esc_html_e('Refrito','cibeles-ai'); ?>
    66                 <i class="fa fa-superpowers"></i>
    67             </a>
    68         </div>
     58        <?php if($options['caip_enable_buttons']['resumen'] == 'on'){ ?>
     59            <div id="div_button_resumen" class="cibelesAi_button">
     60                <a href="#TB_inline?&height=300&width=400&inlineId=resumen" class="thickbox" title="<?php esc_html_e('Generación resumen','cibeles-ai'); ?>">
     61                    <?php  esc_html_e('Resumen','cibeles-ai'); ?>
     62                    <i class="fa fa-superpowers"></i>
     63                </a>
     64            </div>
     65        <?php } ?>
     66        <?php if($options['caip_enable_buttons']['autoexcerpt'] == 'on'){ ?>
     67            <div id="div_button_autoexcerpt" class="cibelesAi_button">
     68                <a href="#TB_inline?&height=300&width=400&inlineId=autoexcerpt"  title="<?php esc_html_e('Generación excerpt automática','cibeles-ai'); ?>">
     69                    <?php  esc_html_e('Autoexcerpt','cibeles-ai'); ?>
     70                    <i class="fa fa-superpowers"></i>
     71                </a>
     72            </div>
     73        <?php } ?>
     74        <?php if($options['caip_enable_buttons']['introduccion'] == 'on'){ ?>
     75            <div id="div_button_introduccion" class="cibelesAi_button">
     76                <a href="#TB_inline?&height=300&width=400&inlineId=introduccion" class="thickbox" title="<?php esc_html_e('Generación introducción','cibeles-ai'); ?>">
     77                    <?php  esc_html_e('Introducción','cibeles-ai'); ?>
     78                    <i class="fa fa-superpowers"></i>
     79                </a>
     80            </div>
     81        <?php } ?>
     82        <?php if($options['caip_enable_buttons']['conclusion'] == 'on'){ ?>
     83            <div id="div_button_conclusion" class="cibelesAi_button">
     84                <a href="#TB_inline?&height=300&width=400&inlineId=conclusion" class="thickbox" title="<?php esc_html_e('Generación conclusión','cibeles-ai'); ?>">
     85                    <?php  esc_html_e('Conclusión','cibeles-ai'); ?>
     86                    <i class="fa fa-superpowers"></i>
     87                </a>
     88            </div>
     89        <?php } ?>
     90        <?php if($options['caip_enable_buttons']['refrito'] == 'on'){ ?>
     91            <div id="div_button_refrito" class="cibelesAi_button">
     92                <a href="#" onclick="tb_show('<?php esc_html_e('Generación refrito','cibeles-ai'); ?>', '#TB_inline?&inlineId=refrito&width=full&height=full&max-width=1520');  setTimeout(() => { caip_refrito.resize_thickbox_fullsize(); }, '50');">
     93                    <?php esc_html_e('Refrito','cibeles-ai'); ?>
     94                    <i class="fa fa-superpowers"></i>
     95                </a>
     96            </div>
     97        <?php } ?>
     98        <?php if($options['caip_enable_buttons']['corrector'] == 'on'){ ?>
     99            <div id="div_button_corrector" class="cibelesAi_button">
     100                <a href="#" onclick="tb_show('<?php esc_html_e('Corrección de ortografía, sintaxis y semántica','cibeles-ai'); ?>', '#TB_inline?&inlineId=corrector&width=full&height=full&max-width=1520');  setTimeout(() => { caip_corrector.resize_thickbox_fullsize(); }, '50');">
     101                    <?php esc_html_e('Corrector','cibeles-ai'); ?>
     102                    <i class="fa fa-superpowers"></i>
     103                </a>
     104            </div>
     105        <?php } ?>
     106        <?php if($options['caip_enable_buttons']['youtube'] == 'on'){ ?>
     107            <div id="div_button_youtube" class="cibelesAi_button">
     108                <a href="#TB_inline?&height=300&width=400&inlineId=youtube" class="thickbox" title="<?php esc_html_e('Youtube','cibeles-ai'); ?>">
     109                    <?php  esc_html_e('Youtube','cibeles-ai'); ?>
     110                    <i class="fa fa-superpowers"></i>
     111                </a>
     112            </div>
     113        <?php } ?>
     114        <?php if($options['caip_enable_buttons']['cifras'] == 'on'){ ?>
     115            <div id="div_button_cifras" class="cibelesAi_button">
     116                <a href="#TB_inline?&height=300&width=400&inlineId=cifras" class="thickbox" title="<?php esc_html_e('Cifras','cibeles-ai'); ?>">
     117                    <?php  esc_html_e('Cifras','cibeles-ai'); ?>
     118                    <i class="fa fa-superpowers"></i>
     119                </a>
     120            </div>
     121        <?php } ?>
     122        <?php if($options['caip_enable_buttons']['cronologia'] == 'on'){ ?>
     123            <div id="div_button_cronologia" class="cibelesAi_button">
     124                <a href="#TB_inline?&height=300&width=400&inlineId=cronologia" class="thickbox" title="<?php esc_html_e('Cronología','cibeles-ai'); ?>">
     125                    <?php  esc_html_e('Cronología','cibeles-ai'); ?>
     126                    <i class="fa fa-superpowers"></i>
     127                </a>
     128            </div>
     129        <?php } ?>
     130        <?php if($options['caip_enable_buttons']['faq'] == 'on'){ ?>
     131            <div id="div_button_faq" class="cibelesAi_button">
     132                <a href="#TB_inline?&height=300&width=400&inlineId=faq" class="thickbox" title="<?php esc_html_e('FAQ','cibeles-ai'); ?>">
     133                    <?php  esc_html_e('FAQ','cibeles-ai'); ?>
     134                    <i class="fa fa-superpowers"></i>
     135                </a>
     136            </div>
     137        <?php } ?>
    69138</div>
    70139
    71140<script>
    72141let cibelesAiPlugin = {
    73         api_url :   '<?php echo esc_js($cibelesAiPlugin['api_url']); ?>',
    74         url :       '<?php echo esc_js($cibelesAiPlugin['url']); ?>',
    75         namespace : '<?php echo esc_js($cibelesAiPlugin['namespace']); ?>',
    76         nick :      '<?php echo esc_js($cibelesAiPlugin['nick']); ?>',
     142        api_url :           '<?php echo esc_js($cibelesAiPlugin['api_url']); ?>',
     143        api_url_youtube :   '<?php echo esc_js($cibelesAiPlugin['api_url_youtube']); ?>',
     144        url :               '<?php echo esc_js($cibelesAiPlugin['url']); ?>',
     145        namespace :         '<?php echo esc_js($cibelesAiPlugin['namespace']); ?>',
     146        nick :              '<?php echo esc_js($cibelesAiPlugin['nick']); ?>',
     147        idioma :            '<?php echo esc_js($cibelesAiPlugin['settings']['idioma']); ?>',
     148
    77149};
    78150
  • cibeles-ai/trunk/views/thickbox/tags.php

    r3036331 r3036333  
    33?>
    44<div class="cibelesAiView" id="tags" style="display: none;">
    5     <p><?php esc_html_e('La generación de tags se hace con el contenido de la entrada.','cibeles-ai'); ?></p>
     5    <p><?php ); ?></p>
    66    <p><?php esc_html_e('Elija entre los siguientes tags:','cibeles-ai'); ?></p>
    77    <div class="result tags"></div>
Note: See TracChangeset for help on using the changeset viewer.