Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 12079 | Rev 14939 | Ir a la última revisión | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 www 1
<?php
2
$acl            = $this->viewModel()->getRoot()->getVariable('acl');
3
$currentUser    = $this->currentUserHelper();
4
$roleName       = $currentUser->getUserTypeId();
5
 
6
$routeDatatable = $this->url('microlearning/content/slides');
7
 
8
$allowAdd = $acl->isAllowed($roleName, 'microlearning/content/slides/add') ? 1 : 0;
9
$allowEdit = $acl->isAllowed($roleName, 'microlearning/content/slides/edit') ? 1 : 0;
10
$allowDelete = $acl->isAllowed($roleName, 'microlearning/content/slides/delete') ? 1 : 0;
11
 
12
 
13
$this->headLink()->appendStylesheet($this->basePath('plugins/nprogress/nprogress.css'));
14
$this->inlineScript()->appendFile($this->basePath('plugins/nprogress/nprogress.js'));
15
 
16
 
17
$this->inlineScript()->appendFile($this->basePath('plugins/bootbox/bootbox.min.js'));
18
 
19
 
20
 
21
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-fileinput/css/fileinput.min.css'));
12076 nelberth 22
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-fileinput/themes/explorer-fa/theme.css'));
1 www 23
 
24
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/js/plugins/piexif.js'));
25
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/js/plugins/sortable.js'));
26
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/js/fileinput.js'));
27
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/js/locales/es.js'));
12076 nelberth 28
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/themes/fa/theme.js'));
12074 nelberth 29
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/themes/explorer-fa/theme.js'));
12071 nelberth 30
 
1 www 31
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/jquery.validate.js'));
32
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/additional-methods.js'));
33
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/localization/messages_es.js'));
34
 
35
$this->inlineScript()->appendFile($this->basePath('plugins/ckeditor/ckeditor.js'));
36
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-input-number/input-number-format.jquery.js'));
37
 
38
$this->headLink()->appendStylesheet($this->basePath('plugins/datatables-bs4/css/dataTables.bootstrap4.min.css'));
39
$this->headLink()->appendStylesheet($this->basePath('plugins/datatables-responsive/css/responsive.bootstrap4.min.css'));
40
 
41
$this->inlineScript()->appendFile($this->basePath('plugins/datatables/jquery.dataTables.min.js'));
42
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-bs4/js/dataTables.bootstrap4.min.js'));
43
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-responsive/js/dataTables.responsive.min.js'));
44
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-responsive/js/responsive.bootstrap4.min.js'));
45
 
46
 
47
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap4-toggle/css/bootstrap4-toggle.min.css'));
48
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap4-toggle/js/bootstrap4-toggle.min.js'));
49
 
50
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-confirmation/dist/bootstrap-confirmation.js'));
51
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-checkbox/awesome-bootstrap-checkbox.css'));
52
 
12079 nelberth 53
$this->headLink()->appendStylesheet($this->basePath('plugins/nelberth-editor/style.css'));
1 www 54
 
55
 
56
 
57
$this->inlineScript()->captureStart();
58
echo <<<JS
59
 
60
 
61
jQuery( document ).ready(function( $ ) {
62
 
63
        var routeAdd = '';
64
 
65
        $.validator.setDefaults({
66
            debug: true,
67
            highlight: function(element) {
68
                $(element).addClass('is-invalid');
69
            },
70
            unhighlight: function(element) {
71
                $(element).removeClass('is-invalid');
72
            },
73
            errorElement: 'span',
74
            errorClass: 'error invalid-feedback',
75
            errorPlacement: function(error, element) {
6192 nelberth 76
 
1 www 77
            }
78
        });
79
 
80
 
81
        $.fn.showFormErrorValidator = function(fieldname, errors) {
82
            var field = $(fieldname);
83
            if(field) {
84
                $(field).addClass('is-invalid');
85
 
86
 
87
                var error = $('<span id="' + fieldname +'-error" class="error invalid-feedback">' + errors + '</div>');
6622 nelberth 88
                if(element.parent('.btn-file').length) {
1 www 89
                    error.insertAfter(element.parent().parent());
90
                } else if(element.parent('.toggle').length) {
91
                    error.insertAfter(element.parent().parent());
92
                } else {
93
                    error.insertAfter(element.parent());
6622 nelberth 94
                }
1 www 95
            }
96
        };
97
 
98
    var allowEdit   = $allowEdit;
99
        var allowDelete = $allowDelete;
100
 
101
        var gridTable = $('#gridTable').dataTable( {
102
            'processing': true,
103
            'serverSide': true,
104
            'searching': true,
105
            'order': [[ 0, 'asc' ]],
106
            'ordering':  true,
107
            'ordenable' : true,
108
            'responsive': true,
109
            'select' : false,
110
        	'paging': true,
111
            'pagingType': 'simple_numbers',
112
 
113
    		'ajax': {
114
    			'url' : '$routeDatatable',
115
    			'type' : 'get',
116
                'data': function ( d ) {
117
                    d.topic_uuid = $('#form-filter #topic_uuid').val();
118
                    d.capsule_uuid = $('#form-filter #capsule_uuid').val();
119
 
120
                },
121
                'beforeSend': function (request) {
122
                  NProgress.start();
123
                },
124
                'dataFilter': function(response) {
125
                    var response = jQuery.parseJSON( response );
126
 
127
                    var json                = {};
128
                    json.recordsTotal       = 0;
129
                    json.recordsFiltered    = 0;
130
                    json.data               = [];
131
 
132
                    if(response.success) {
133
                        $('#form-capsule-add').attr('action', response.data.link_add );
134
 
135
                        if(response.data.capsules) {
136
                            $('#form-filter #capsule_uuid').empty();
137
                            $.each(response.data.capsules, function(index, value) {
138
                                  $('#form-filter #capsule_uuid').append('<option value="' + index + '">' + value + '</option>')
139
                            });
140
                        }
141
 
142
                        routeAdd = response.data.link_add;
143
                        if(response.data.link_add) {
144
 
145
                            $('button.btn-add').removeAttr('disabled');
146
                        } else {
147
                            $('button.btn-add').attr('disabled', 'disabled');
148
                        }
149
 
150
                        json.recordsTotal       = response.data.total;
151
                        json.recordsFiltered    = response.data.total;
152
                        json.data               = response.data.items;
153
                    } else {
154
                        $.fn.showError(response.data)
155
                    }
156
 
157
                    return JSON.stringify( json );
158
                }
159
    		},
160
            'language' : {
161
                'sProcessing':     'LABEL_DATATABLE_SPROCESSING',
162
                'sLengthMenu':     'LABEL_DATATABLE_SLENGTHMENU',
163
                'sZeroRecords':    'LABEL_DATATABLE_SZERORECORDS',
164
                'sEmptyTable':     'LABEL_DATATABLE_SEMPTYTABLE',
165
                'sInfo':           'LABEL_DATATABLE_SINFO',
166
                'sInfoEmpty':      'LABEL_DATATABLE_SINFOEMPTY',
167
                'sInfoFiltered':   'LABEL_DATATABLE_SINFOFILTERED',
168
                'sInfoPostFix':    '',
169
                'sSearch':         'LABEL_DATATABLE_SSEARCH',
170
                'sUrl':            '',
171
                'sInfoThousands':  ',',
172
                'sLoadingRecords': 'LABEL_DATATABLE_SLOADINGRECORDS',
173
                'oPaginate': {
174
                    'sFirst':    'LABEL_DATATABLE_SFIRST',
175
                    'sLast':     'LABEL_DATATABLE_SLAST',
176
                    'sNext':     'LABEL_DATATABLE_SNEXT',
177
                    'sPrevious': 'LABEL_DATATABLE_SPREVIOUS'
178
                },
179
                'oAria': {
180
                    'sSortAscending':  ': LABEL_DATATABLE_SSORTASCENDING',
181
                    'sSortDescending': ':LABEL_DATATABLE_SSORTDESCENDING'
182
                },
183
            },
184
            'drawCallback': function( settings ) {
185
                NProgress.done();
186
                $('button.btn-delete').confirmation({
187
                    rootSelector: 'button.btn-delete',
188
                    title : 'LABEL_ARE_YOU_SURE',
189
                    singleton : true,
190
                    btnOkLabel: 'LABEL_YES',
191
                    btnCancelLabel: 'LABEL_NO',
192
                    onConfirm: function(value) {
193
                        action = $(this).data('href');
194
                        NProgress.start();
195
                        $.ajax({
196
                            'dataType'  : 'json',
197
                            'accept'    : 'application/json',
198
                            'method'    : 'post',
199
                            'url'       :  action,
200
                        }).done(function(response) {
201
                            if(response['success']) {
202
                                $.fn.showSuccess(response['data']);
203
                                gridTable.api().ajax.reload(null, false);
204
                            } else {
205
                                $.fn.showError(response['data']);
206
                            }
207
                        }).fail(function( jqXHR, textStatus, errorThrown) {
208
                            $.fn.showError(textStatus);
209
                        }).always(function() {
210
                            NProgress.done();
211
                        });
212
                    },
213
                });
214
            },
215
            'aoColumns': [
216
                { 'mDataProp': 'name' },
217
                { 'mDataProp': 'details' },
218
                { 'mDataProp': 'media' },
219
                { 'mDataProp': 'actions' },
220
    	    ],
221
            'columnDefs': [
222
                {
223
                    'targets': 0,
224
                    'className' : 'text-vertical-middle',
225
                },
226
                {
227
                    'targets': -3,
228
                    'orderable': false,
229
                    'render' : function ( data, type, row ) {
230
                        var s = '';
231
                        s += 'LABEL_TYPE: ' + data['type']  + '<br/>';
232
                        return s;
233
                    }
234
                },
235
                {
236
                    'targets': -2,
237
                    'orderable': false,
238
                    'render' : function ( data, type, row ) {
239
                        s = '';
240
                        if( data['image'] )  {
241
                            s = s + '&nbsp; <img class="btn-view-image"" data-href="' + data['image'] + '" data-toggle="tooltip" src="'+data['image']+'" title="LABEL_VIEW" style="width: 40px; object-fit: cover; height: 40px;" /> ';
242
                        }
243
 
244
                        if( data['audio'] )  {
245
                            s = s + '&nbsp;<button class="btn btn-play-audio" data-href="' + data['audio'] + '" data-toggle="tooltip" title="LABEL_PLAY_AUDIO"><i class="fa fa-play"></i></button> <br>';
246
                        }
247
 
248
                        if( data['video'] )  {
249
                            s = s + '&nbsp;<button class="btn btn-play-video" data-href="' + data['video'] + '" data-toggle="tooltip" title="LABEL_PLAY_VIDEO"><i class="fa fa-video-camera"></i></button> <br>';
250
                        }
251
 
252
 
253
                        if( data['document'] )  {
254
                            s = s + '&nbsp;<button class="btn btn-view-document" data-href="' + data['document'] + '" data-toggle="tooltip" title="LABEL_VIEW_DOCUMENT"><i class="fa fa-file"></i></button> <br>';
255
                        }
256
 
257
                        if( data['text'] )  {
258
                            s = s + '&nbsp;<button class="btn btn-view-text" data-href="' + data['text'] + '" data-toggle="tooltip" title="LABEL_VIEW_TEXT"><i class="fa fa-text-width"></i></button> <br>';
259
                        }
260
 
261
                        return s;
262
                    }
263
                },
264
 
265
 
266
                {
267
                    'targets': -1,
268
                    'orderable': false,
269
                    'render' : function ( data, type, row ) {
270
                        s = '';
271
 
272
                        if(allowEdit && data['link_edit']  ) {
273
                            s = s + '<button class="btn btn-info btn-sm btn-edit" data-href="' + data['link_edit']+ '" data-toggle="tooltip" title="LABEL_EDIT"><i class="fa fa-pencil"></i> Editar </button>&nbsp;';
274
                        }
275
                        if(allowDelete && data['link_delete']  ) {
276
                            s = s + '<button class="btn btn-danger btn-sm btn-delete" data-href="' + data['link_delete']+ '" data-toggle="tooltip" title="LABEL_DELETE"><i class="fa fa-trash"></i> Eliminar</button>&nbsp;';
277
                        }
278
                        return s;
279
                    }
280
                }
281
              ],
282
        });
6591 nelberth 283
        var seleccionarCampo;
1 www 284
    var validatorTextAdd  = $('#form-slide-text-add').validate({
285
        debug: true,
286
        onclick: false,
287
        onkeyup: false,
288
        ignore: [],
289
        rules: {
290
            'name': {
291
                required: true,
292
                maxlength: 128,
293
            },
294
            'description': {
295
                updateCkeditor:function() {
296
                        CKEDITOR.instances.description_add.updateElement();
297
                },
298
                required: true
299
            },
300
           'background': {
301
                required: true,
302
            },
303
            'order' : {
304
                required: true,
305
                digits: true,
306
                min: 1,
307
                max: 250
308
            }
309
        },
310
        submitHandler: function(form)
311
        {
312
 
313
            var formdata = false;
314
            if (window.FormData){
315
                formdata = new FormData(form); //form[0]);
316
            }
317
 
7060 nelberth 318
 
319
				$('.info_noticia').prop('disabled', true);
6591 nelberth 320
            NProgress.start();
1 www 321
            $.ajax({
322
                'dataType'  : 'json',
323
                'accept'    : 'application/json',
324
                'method'    : 'post',
325
                'url'       :  routeAdd,
326
                'data'      :  formdata,
327
                'processData': false,
328
                'contentType': false,
329
            }).done(function(response) {
330
                if(response['success']) {
331
                    $.fn.showSuccess(response['data']);
6591 nelberth 332
                    $('body, html').animate({scrollTop: '0px'}, 300);
333
					$('#content1').css('display','block');
334
                    $('.contenido').html('');
335
            		seleccionarCampo.css('display','none');
1 www 336
 
337
                    gridTable.api().ajax.reload(null, false);
338
                } else {
339
                    validatorTextAdd.resetForm();
340
                    if(jQuery.type(response['data']) == 'string') {
341
                        $.fn.showError(response['data']);
342
                    } else  {
343
                        $.each(response['data'], function( fieldname, errors ) {
344
                            $.fn.showFormErrorValidator('#form-slide-text-add #' + fieldname, errors);
345
                        });
346
                    }
347
                }
348
            }).fail(function( jqXHR, textStatus, errorThrown) {
349
                $.fn.showError(textStatus);
350
            }).always(function() {
351
                NProgress.done();
7060 nelberth 352
 
353
				$('.info_noticia').prop('disabled', false);
1 www 354
            });
355
            return false;
356
        },
357
        invalidHandler: function(form, validator) {
358
 
359
        }
360
    });
361
 
362
    var validatorTextEdit = $('#form-slide-text-edit').validate({
363
        debug: true,
364
        onclick: false,
365
        onkeyup: false,
366
        ignore: [],
367
        rules: {
368
            'name': {
369
                required: true,
370
                maxlength: 128,
371
            },
372
            'description': {
373
                updateCkeditor:function() {
374
                        CKEDITOR.instances.description_edit.updateElement();
375
                },
376
                required: true
377
            },
378
           'background': {
6598 nelberth 379
                required: true,
1 www 380
            },
381
            'order' : {
382
                required: true,
383
                digits: true,
384
                min: 1,
385
                max: 250
386
            }
387
        },
388
        submitHandler: function(form)
389
        {
390
            var formdata = false;
391
            if (window.FormData){
392
                formdata = new FormData(form); //form[0]);
393
            }
394
 
7060 nelberth 395
 
396
				$('.info_noticia').prop('disabled', true);
6595 nelberth 397
            NProgress.start();
1 www 398
            $.ajax({
399
                'dataType'  : 'json',
400
                'accept'    : 'application/json',
401
                'method'    : 'post',
402
                'url'       :  $('#form-slide-text-edit').attr('action'),
403
                'data'      :  formdata,
404
                'processData': false,
405
                'contentType': false,
406
            }).done(function(response) {
407
                if(response['success']) {
408
                    $.fn.showSuccess(response['data']);
409
 
6595 nelberth 410
                    $('body, html').animate({scrollTop: '0px'}, 300);
411
					$('#content1').css('display','block');
412
                    $('.contenido').html('');
413
            		seleccionarCampo.css('display','none');
414
 
1 www 415
                    gridTable.api().ajax.reload(null, false);
416
                } else {
417
                    validatorTextEdit.resetForm();
418
                    if(jQuery.type(response['data']) == 'string') {
419
                        $.fn.showError(response['data']);
420
                    } else  {
421
                        $.each(response['data'], function( fieldname, errors ) {
422
                            $.fn.showFormErrorValidator('#form-slide-text-edit #' + fieldname, errors);
423
                        });
424
                    }
425
                }
426
            }).fail(function( jqXHR, textStatus, errorThrown) {
427
                $.fn.showError(textStatus);
428
            }).always(function() {
429
                NProgress.done();
7060 nelberth 430
 
431
				$('.info_noticia').prop('disabled', false);
1 www 432
            });
433
            return false;
434
        },
435
        invalidHandler: function(form, validator) {
436
 
437
        }
438
    });
439
 
440
    var validatorImageAdd  = $('#form-slide-image-add').validate({
441
        debug: true,
442
        onclick: false,
443
        onkeyup: false,
444
        ignore: [],
445
        rules: {
446
            'name': {
447
                required: true,
448
                maxlength: 128,
449
            },
450
           'file': {
451
                required: true,
452
            },
453
            'order' : {
454
                required: true,
455
                digits: true,
456
                min: 1,
457
                max: 250
458
            }
459
        },
460
        submitHandler: function(form)
461
        {
462
            var formdata = false;
463
            if (window.FormData){
464
                formdata = new FormData(form); //form[0]);
465
            }
466
 
7060 nelberth 467
 
468
				$('.info_noticia').prop('disabled', true);
6499 nelberth 469
            NProgress.start();
1 www 470
            $.ajax({
471
                'dataType'  : 'json',
472
                'accept'    : 'application/json',
473
                'method'    : 'post',
474
                'url'       :  routeAdd,
475
                'data'      :  formdata,
476
                'processData': false,
477
                'contentType': false,
478
            }).done(function(response) {
6192 nelberth 479
                console.log(response)
1 www 480
                if(response['success']) {
481
                    $.fn.showSuccess(response['data']);
6499 nelberth 482
                    $('body, html').animate({scrollTop: '0px'}, 300);
483
					$('#content1').css('display','block');
6576 nelberth 484
                    $('.contenido').html('');
6591 nelberth 485
 
486
            		seleccionarCampo.css('display','none');
1 www 487
 
488
                    gridTable.api().ajax.reload(null, false);
489
                } else {
490
                    validatorImageAdd.resetForm();
491
                    if(jQuery.type(response['data']) == 'string') {
492
                        $.fn.showError(response['data']);
493
                    } else  {
494
                        $.each(response['data'], function( fieldname, errors ) {
495
                            $.fn.showFormErrorValidator('#form-slide-image-add #' + fieldname, errors);
496
                        });
497
                    }
498
                }
499
            }).fail(function( jqXHR, textStatus, errorThrown) {
500
                $.fn.showError(textStatus);
501
            }).always(function() {
502
                NProgress.done();
7060 nelberth 503
 
504
				$('.info_noticia').prop('disabled', false);
1 www 505
            });
506
            return false;
507
        },
508
        invalidHandler: function(form, validator) {
509
 
510
        }
511
    });
512
 
513
    var validatorImageEdit = $('#form-slide-image-edit').validate({
514
        debug: true,
515
        onclick: false,
516
        onkeyup: false,
517
        ignore: [],
518
        rules: {
519
            'name': {
520
                required: true,
521
                maxlength: 128,
522
            },
523
            'file': {
6500 nelberth 524
                required: true,
1 www 525
            },
526
            'order' : {
527
                required: true,
528
                digits: true,
529
                min: 1,
530
                max: 250
531
            }
532
        },
533
        submitHandler: function(form)
534
        {
535
            var formdata = false;
536
            if (window.FormData){
537
                formdata = new FormData(form); //form[0]);
538
            }
7060 nelberth 539
 
540
				$('.info_noticia').prop('disabled', true);
6500 nelberth 541
            NProgress.start();
1 www 542
            $.ajax({
543
                'dataType'  : 'json',
544
                'accept'    : 'application/json',
545
                'method'    : 'post',
546
                'url'       :  $('#form-slide-image-edit').attr('action'),
547
                'data'      :  formdata,
548
                'processData': false,
549
                'contentType': false,
550
            }).done(function(response) {
551
                if(response['success']) {
552
                    $.fn.showSuccess(response['data']);
553
 
6500 nelberth 554
                    $('body, html').animate({scrollTop: '0px'}, 300);
555
					$('#content1').css('display','block');
6576 nelberth 556
                    $('.contenido').html('');
6591 nelberth 557
 
558
            		seleccionarCampo.css('display','none');
1 www 559
 
560
                    gridTable.api().ajax.reload(null, false);
561
                } else {
562
                    validatorImageEdit.resetForm();
563
                    if(jQuery.type(response['data']) == 'string') {
564
                        $.fn.showError(response['data']);
565
                    } else  {
566
                        $.each(response['data'], function( fieldname, errors ) {
567
                            $.fn.showFormErrorValidator('#form-slide-image-edit #' + fieldname, errors);
568
                        });
569
                    }
570
                }
571
            }).fail(function( jqXHR, textStatus, errorThrown) {
572
                $.fn.showError(textStatus);
573
            }).always(function() {
574
                NProgress.done();
7060 nelberth 575
 
576
				$('.info_noticia').prop('disabled', false);
1 www 577
            });
578
            return false;
579
        },
580
        invalidHandler: function(form, validator) {
581
 
582
        }
583
    });
584
 
585
    var validatorVideoAdd  = $('#form-slide-video-add').validate({
586
        debug: true,
587
        onclick: false,
588
        onkeyup: false,
589
        ignore: [],
590
        rules: {
591
            'name': {
592
                required: true,
593
                maxlength: 128,
594
            },
595
           'file': {
596
                required: true,
597
                extension: 'webm,mp4,webm',
598
                accept: 'video/webm,video/mpeg,video/mp4'
599
            },
600
            'background': {
6620 nelberth 601
                required: true,
1 www 602
            },
603
            'order' : {
604
                required: true,
605
                digits: true,
606
                min: 1,
607
                max: 250
608
            }
609
        },
610
        submitHandler: function(form)
611
        {
612
            var formdata = false;
613
            if (window.FormData){
614
                formdata = new FormData(form); //form[0]);
615
            }
616
 
7060 nelberth 617
 
618
			$('.info_noticia').prop('disabled', true);
6620 nelberth 619
            NProgress.start();
1 www 620
            $.ajax({
621
                'dataType'  : 'json',
622
                'accept'    : 'application/json',
623
                'method'    : 'post',
624
                'url'       :  routeAdd,
625
                'data'      :  formdata,
626
                'processData': false,
627
                'contentType': false,
628
            }).done(function(response) {
629
                if(response['success']) {
630
                    $.fn.showSuccess(response['data']);
6620 nelberth 631
 
632
                    $('body, html').animate({scrollTop: '0px'}, 300);
633
					$('#content1').css('display','block');
634
                    $('.contenido').html('');
635
            		seleccionarCampo.css('display','none');
1 www 636
                    gridTable.api().ajax.reload(null, false);
637
                } else {
638
                    validatorVideoAdd.resetForm();
639
                    if(jQuery.type(response['data']) == 'string') {
640
                        $.fn.showError(response['data']);
641
                    } else  {
642
                        $.each(response['data'], function( fieldname, errors ) {
643
                            $.fn.showFormErrorValidator('#form-slide-video-add #' + fieldname, errors);
644
                        });
645
                    }
646
                }
647
            }).fail(function( jqXHR, textStatus, errorThrown) {
648
                $.fn.showError(textStatus);
649
            }).always(function() {
650
                NProgress.done();
7060 nelberth 651
				$('.info_noticia').prop('disabled', false);
1 www 652
            });
653
            return false;
654
        },
655
        invalidHandler: function(form, validator) {
656
 
657
        }
658
    });
659
 
660
    var validatorVideoEdit = $('#form-slide-video-edit').validate({
661
        debug: true,
662
        onclick: false,
663
        onkeyup: false,
664
        ignore: [],
665
        rules: {
666
            'name': {
667
                required: true,
668
                maxlength: 128,
669
            },
670
            'file': {
671
                required: false,
672
                extension: 'webm,mp4,webm',
673
                accept: 'video/webm,video/mpeg,video/mp4'
674
            },
675
            'background': {
6649 nelberth 676
                required: true
1 www 677
            },
678
            'order' : {
679
                required: true,
680
                digits: true,
681
                min: 1,
682
                max: 250
683
            }
684
        },
685
        submitHandler: function(form)
686
        {
687
            var formdata = false;
688
            if (window.FormData){
689
                formdata = new FormData(form); //form[0]);
690
            }
691
 
7060 nelberth 692
 
693
			$('.info_noticia').prop('disabled', true);
6650 nelberth 694
            NProgress.start();
1 www 695
            $.ajax({
696
                'dataType'  : 'json',
697
                'accept'    : 'application/json',
698
                'method'    : 'post',
699
                'url'       :  $('#form-slide-video-edit').attr('action'),
700
                'data'      :  formdata,
701
                'processData': false,
702
                'contentType': false,
703
            }).done(function(response) {
704
                if(response['success']) {
705
                    $.fn.showSuccess(response['data']);
706
 
6649 nelberth 707
                    $('body, html').animate({scrollTop: '0px'}, 300);
708
					$('#content1').css('display','block');
709
                    $('.contenido').html('');
710
            		seleccionarCampo.css('display','none');
6643 nelberth 711
 
1 www 712
                    gridTable.api().ajax.reload(null, false);
713
                } else {
714
                    validatorVideoEdit.resetForm();
715
                    if(jQuery.type(response['data']) == 'string') {
716
                        $.fn.showError(response['data']);
717
                    } else  {
718
                        $.each(response['data'], function( fieldname, errors ) {
719
                            $.fn.showFormErrorValidator('#form-slide-video-edit #' + fieldname, errors);
720
                        });
721
                    }
722
                }
723
            }).fail(function( jqXHR, textStatus, errorThrown) {
724
                $.fn.showError(textStatus);
725
            }).always(function() {
7060 nelberth 726
				$('.info_noticia').prop('disabled', false);
1 www 727
                NProgress.done();
728
            });
729
            return false;
730
        },
731
        invalidHandler: function(form, validator) {
732
 
733
        }
734
    });
735
 
736
 
737
    var validatorDocumentAdd  = $('#form-slide-document-add').validate({
738
        debug: true,
739
        onclick: false,
740
        onkeyup: false,
741
        ignore: [],
742
        rules: {
743
            'name': {
744
                required: true,
745
                maxlength: 128,
746
            },
747
           'file': {
748
                required: true,
749
                extension: 'pdf',
750
                accept: 'application/pdf'
751
            },
752
           'background': {
753
                required: true,
754
            },
755
            'order' : {
756
                required: true,
757
                digits: true,
758
                min: 1,
759
                max: 250
760
            }
761
        },
762
        submitHandler: function(form)
763
        {
764
            var formdata = false;
765
            if (window.FormData){
766
                formdata = new FormData(form); //form[0]);
767
            }
768
 
7060 nelberth 769
 
770
			$('.info_noticia').prop('disabled', true);
6650 nelberth 771
            NProgress.start();
1 www 772
            $.ajax({
773
                'dataType'  : 'json',
774
                'accept'    : 'application/json',
775
                'method'    : 'post',
776
                'url'       :  routeAdd,
777
                'data'      :  formdata,
778
                'processData': false,
779
                'contentType': false,
780
            }).done(function(response) {
781
                if(response['success']) {
782
                    $.fn.showSuccess(response['data']);
783
 
6649 nelberth 784
                    $('body, html').animate({scrollTop: '0px'}, 300);
785
					$('#content1').css('display','block');
786
                    $('.contenido').html('');
787
            		seleccionarCampo.css('display','none');
1 www 788
 
789
                    gridTable.api().ajax.reload(null, false);
790
                } else {
791
                    validatorDocumentAdd.resetForm();
792
                    if(jQuery.type(response['data']) == 'string') {
793
                        $.fn.showError(response['data']);
794
                    } else  {
795
                        $.each(response['data'], function( fieldname, errors ) {
796
                            $.fn.showFormErrorValidator('#form-slide-document-add #' + fieldname, errors);
797
                        });
798
                    }
799
                }
800
            }).fail(function( jqXHR, textStatus, errorThrown) {
801
                $.fn.showError(textStatus);
802
            }).always(function() {
7060 nelberth 803
				$('.info_noticia').prop('disabled', false);
1 www 804
                NProgress.done();
805
            });
806
            return false;
807
        },
808
        invalidHandler: function(form, validator) {
809
 
810
        }
811
    });
812
 
813
    var validatorDocumentEdit = $('#form-slide-document-edit').validate({
814
        debug: true,
815
        onclick: false,
816
        onkeyup: false,
817
        ignore: [],
818
        rules: {
819
            'name': {
820
                required: true,
821
                maxlength: 128,
822
            },
823
           'file': {
6667 nelberth 824
                required: false,
1 www 825
                extension: 'pdf',
826
                accept: 'application/pdf'
827
            },
828
           'background': {
829
                required: true,
830
            },
831
            'order' : {
832
                required: true,
833
                digits: true,
834
                min: 1,
835
                max: 250
836
            }
837
        },
838
        submitHandler: function(form)
839
        {
840
            var formdata = false;
841
            if (window.FormData){
842
                formdata = new FormData(form); //form[0]);
843
            }
844
 
7060 nelberth 845
 
846
			$('.info_noticia').prop('disabled', true);
6650 nelberth 847
            NProgress.start();
1 www 848
            $.ajax({
849
                'dataType'  : 'json',
850
                'accept'    : 'application/json',
851
                'method'    : 'post',
852
                'url'       :  $('#form-slide-document-edit').attr('action'),
853
                'data'      :  formdata,
854
                'processData': false,
855
                'contentType': false,
856
            }).done(function(response) {
857
                if(response['success']) {
858
                    $.fn.showSuccess(response['data']);
859
 
6649 nelberth 860
                    $('body, html').animate({scrollTop: '0px'}, 300);
861
					$('#content1').css('display','block');
862
                    $('.contenido').html('');
863
            		seleccionarCampo.css('display','none');
1 www 864
 
865
                    gridTable.api().ajax.reload(null, false);
866
                } else {
867
                    validatorDocumentEdit.resetForm();
868
                    if(jQuery.type(response['data']) == 'string') {
869
                        $.fn.showError(response['data']);
870
                    } else  {
871
                        $.each(response['data'], function( fieldname, errors ) {
872
                            $.fn.showFormErrorValidator('#form-slide-document-edit #' + fieldname, errors);
873
                        });
874
                    }
875
                }
876
            }).fail(function( jqXHR, textStatus, errorThrown) {
877
                $.fn.showError(textStatus);
878
            }).always(function() {
7060 nelberth 879
				$('.info_noticia').prop('disabled', false);
1 www 880
                NProgress.done();
881
            });
882
            return false;
883
        },
884
        invalidHandler: function(form, validator) {
885
 
886
        }
887
    });
888
 
889
    var validatorAudioAdd  = $('#form-slide-audio-add').validate({
890
        debug: true,
891
        onclick: false,
892
        onkeyup: false,
893
        ignore: [],
894
        rules: {
895
            'name': {
896
                required: true,
897
                maxlength: 128,
898
            },
899
           'file': {
900
                required: true,
901
                extension: 'wav|mp3',
902
                accept: 'audio/wav, audio/mpeg'
903
            },
904
 
905
           'background': {
6649 nelberth 906
                required: true
1 www 907
            },
908
            'order' : {
909
                required: true,
910
                digits: true,
911
                min: 1,
912
                max: 250
913
            }
914
        },
915
        submitHandler: function(form)
916
        {
917
            var formdata = false;
918
            if (window.FormData){
919
                formdata = new FormData(form); //form[0]);
920
            }
921
 
7060 nelberth 922
 
923
			$('.info_noticia').prop('disabled', true);
6650 nelberth 924
            NProgress.start();
1 www 925
            $.ajax({
926
                'dataType'  : 'json',
927
                'accept'    : 'application/json',
928
                'method'    : 'post',
929
                'url'       :  routeAdd,
930
                'data'      :  formdata,
931
                'processData': false,
932
                'contentType': false,
933
            }).done(function(response) {
934
                if(response['success']) {
935
                    $.fn.showSuccess(response['data']);
936
 
6649 nelberth 937
                    $('body, html').animate({scrollTop: '0px'}, 300);
938
					$('#content1').css('display','block');
939
                    $('.contenido').html('');
940
            		seleccionarCampo.css('display','none');
1 www 941
 
942
                    gridTable.api().ajax.reload(null, false);
943
                } else {
944
                    validatorAudioAdd.resetForm();
945
                    if(jQuery.type(response['data']) == 'string') {
946
                        $.fn.showError(response['data']);
947
                    } else  {
948
                        $.each(response['data'], function( fieldname, errors ) {
949
                            $.fn.showFormErrorValidator('#form-slide-audio-add #' + fieldname, errors);
950
                        });
951
                    }
952
                }
953
            }).fail(function( jqXHR, textStatus, errorThrown) {
954
                $.fn.showError(textStatus);
955
            }).always(function() {
956
                NProgress.done();
7060 nelberth 957
 
958
				$('.info_noticia').prop('disabled', false);
1 www 959
            });
960
            return false;
961
        },
962
        invalidHandler: function(form, validator) {
963
 
964
        }
965
    });
966
 
967
    var validatorAudioEdit = $('#form-slide-audio-edit').validate({
968
        debug: true,
969
        onclick: false,
970
        onkeyup: false,
971
        ignore: [],
972
        rules: {
973
            'name': {
974
                required: true,
975
                maxlength: 128,
976
            },
977
           'file': {
6667 nelberth 978
                required: false,
1 www 979
                extension: 'wav|mp3',
980
                accept: 'audio/wav, audio/mpeg'
981
            },
982
 
983
           'background': {
984
                required: true,
985
            },
986
            'order' : {
987
                required: true,
988
                digits: true,
989
                min: 1,
990
                max: 250
991
            }
992
        },
993
        submitHandler: function(form)
994
        {
995
            var formdata = false;
996
            if (window.FormData){
997
                formdata = new FormData(form); //form[0]);
998
            }
999
 
7060 nelberth 1000
 
1001
				$('.info_noticia').prop('disabled', true);
6650 nelberth 1002
            NProgress.start();
1 www 1003
            $.ajax({
1004
                'dataType'  : 'json',
1005
                'accept'    : 'application/json',
1006
                'method'    : 'post',
1007
                'url'       :  $('#form-slide-audio-edit').attr('action'),
1008
                'data'      :  formdata,
1009
                'processData': false,
1010
                'contentType': false,
1011
            }).done(function(response) {
1012
                if(response['success']) {
1013
                    $.fn.showSuccess(response['data']);
1014
 
6649 nelberth 1015
                    $('body, html').animate({scrollTop: '0px'}, 300);
1016
					$('#content1').css('display','block');
1017
                    $('.contenido').html('');
1018
            		seleccionarCampo.css('display','none');
1 www 1019
 
1020
                    gridTable.api().ajax.reload(null, false);
1021
                } else {
1022
                    validatorAudioEdit.resetForm();
1023
                    if(jQuery.type(response['data']) == 'string') {
1024
                        $.fn.showError(response['data']);
1025
                    } else  {
1026
                        $.each(response['data'], function( fieldname, errors ) {
1027
                            $.fn.showFormErrorValidator('#form-slide-audio-edit #' + fieldname, errors);
1028
                        });
1029
                    }
1030
                }
1031
            }).fail(function( jqXHR, textStatus, errorThrown) {
1032
                $.fn.showError(textStatus);
1033
            }).always(function() {
7060 nelberth 1034
				$('.info_noticia').prop('disabled', false);
1 www 1035
                NProgress.done();
1036
            });
1037
            return false;
1038
        },
1039
        invalidHandler: function(form, validator) {
1040
 
1041
        }
1042
    });
1043
 
1044
    var validatorQuizzAdd  = $('#form-slide-quizz-add').validate({
1045
        debug: true,
1046
        onclick: false,
1047
        onkeyup: false,
1048
        ignore: [],
1049
        rules: {
1050
            'name': {
1051
                required: true,
1052
                maxlength: 128,
1053
            },
1054
           'file': {
1055
                required: true,
1056
                extension: 'wav|mp3',
1057
                accept: 'quizz/wav, quizz/mpeg'
1058
            },
6667 nelberth 1059
            'background': {
1060
                required: true,
1061
            },
1 www 1062
            'quiz_id': {
1063
                required: true,
1064
            },
1065
            'order' : {
1066
                required: true,
1067
                digits: true,
1068
                min: 1,
1069
                max: 250
1070
            }
1071
        },
1072
        submitHandler: function(form)
1073
        {
1074
 
7060 nelberth 1075
 
1076
				$('.info_noticia').prop('disabled', true);
6650 nelberth 1077
            NProgress.start();
1 www 1078
            var formdata = false;
1079
            if (window.FormData){
1080
                formdata = new FormData(form); //form[0]);
1081
            }
1082
 
1083
            $.ajax({
1084
                'dataType'  : 'json',
1085
                'accept'    : 'application/json',
1086
                'method'    : 'post',
1087
                'url'       :  routeAdd,
1088
                'data'      :  formdata,
1089
                'processData': false,
1090
                'contentType': false,
1091
            }).done(function(response) {
1092
                if(response['success']) {
1093
                    $.fn.showSuccess(response['data']);
1094
 
6649 nelberth 1095
                    $('body, html').animate({scrollTop: '0px'}, 300);
1096
					$('#content1').css('display','block');
1097
                    $('.contenido').html('');
1098
            		seleccionarCampo.css('display','none');
1 www 1099
 
1100
                    gridTable.api().ajax.reload(null, false);
1101
                } else {
1102
                    validatorQuizzAdd.resetForm();
1103
                    if(jQuery.type(response['data']) == 'string') {
1104
                        $.fn.showError(response['data']);
1105
                    } else  {
1106
                        $.each(response['data'], function( fieldname, errors ) {
1107
                            $.fn.showFormErrorValidator('#form-slide-quizz-add #' + fieldname, errors);
1108
                        });
1109
                    }
1110
                }
1111
            }).fail(function( jqXHR, textStatus, errorThrown) {
1112
                $.fn.showError(textStatus);
1113
            }).always(function() {
1114
                NProgress.done();
7060 nelberth 1115
 
1116
				$('.info_noticia').prop('disabled', true);
1 www 1117
            });
1118
            return false;
1119
        },
1120
        invalidHandler: function(form, validator) {
1121
 
1122
        }
1123
    });
1124
 
1125
    var validatorQuizzEdit = $('#form-slide-quizz-edit').validate({
1126
        debug: true,
1127
        onclick: false,
1128
        onkeyup: false,
1129
        ignore: [],
1130
        rules: {
1131
            'name': {
1132
                required: true,
1133
                maxlength: 128,
1134
            },
1135
           'background': {
6649 nelberth 1136
                required: true,
1 www 1137
            },
1138
            'quiz_id': {
1139
                required: true,
1140
            },
1141
            'order' : {
1142
                required: true,
1143
                digits: true,
1144
                min: 1,
1145
                max: 250
1146
            }
1147
        },
1148
        submitHandler: function(form)
1149
        {
1150
 
7060 nelberth 1151
            $('.info_noticia').prop('disabled', true);
6650 nelberth 1152
            NProgress.start();
1 www 1153
            var formdata = false;
1154
            if (window.FormData){
1155
                formdata = new FormData(form); //form[0]);
1156
            }
1157
            $.ajax({
1158
                'dataType'  : 'json',
1159
                'accept'    : 'application/json',
1160
                'method'    : 'post',
6673 nelberth 1161
                'url'       :  $('#form-slide-quizz-edit').attr('action'),
1 www 1162
                'data'      :  formdata,
1163
                'processData': false,
1164
                'contentType': false,
1165
            }).done(function(response) {
1166
                if(response['success']) {
1167
                    $.fn.showSuccess(response['data']);
1168
 
6649 nelberth 1169
                    $('body, html').animate({scrollTop: '0px'}, 300);
1170
					$('#content1').css('display','block');
1171
                    $('.contenido').html('');
1172
            		seleccionarCampo.css('display','none');
1 www 1173
 
1174
                    gridTable.api().ajax.reload(null, false);
1175
                } else {
1176
                    validatorQuizzEdit.resetForm();
1177
                    if(jQuery.type(response['data']) == 'string') {
1178
                        $.fn.showError(response['data']);
1179
                    } else  {
1180
                        $.each(response['data'], function( fieldname, errors ) {
1181
                            $.fn.showFormErrorValidator('#form-slide-quizz-edit #' + fieldname, errors);
1182
                        });
1183
                    }
1184
                }
1185
            }).fail(function( jqXHR, textStatus, errorThrown) {
1186
                $.fn.showError(textStatus);
1187
            }).always(function() {
1188
                NProgress.done();
7060 nelberth 1189
 
1190
				$('.info_noticia').prop('disabled', false);
1 www 1191
            });
1192
            return false;
1193
        },
1194
        invalidHandler: function(form, validator) {
1195
 
1196
        }
1197
    });
6591 nelberth 1198
 
1 www 1199
    $('body').on('click', 'button.btn-edit', function(e) {
1200
        e.preventDefault();
6651 nelberth 1201
        NProgress.start();
1 www 1202
        var url = $(this).data('href');
1203
        $.ajax({
1204
            'dataType'  : 'json',
1205
            'accept'    : 'application/json',
1206
            'method'    : 'get',
1207
            'url'       :  url,
1208
        }).done(function(response) {
1209
            if(response['success']) {
1210
 
1211
                if(response['data']['type'] == 'text') {
1212
                    $('#form-slide-text-edit').attr('action',url);
1213
                    $('#form-slide-text-edit #name').val(response['data']['name']);
1214
                    $('#form-slide-text-edit #order').val(response['data']['order']);
1215
 
1216
                    CKEDITOR.instances.description_edit.setData(response['data']['description']);
1217
                    validatorTextEdit.resetForm();
1218
 
1219
 
6595 nelberth 1220
                    $('body, html').animate({scrollTop: '0px'}, 300);
1221
					$('#content1').css('display','none');
6601 nelberth 1222
                    seleccionarCampo= $('#company-microlearning-slide-text-edit-box');
1223
                    seleccionarCampo.css('display','block')
6595 nelberth 1224
		            iniciarEditor(seleccionarCampo,response['data']['background'])
1225
 
1 www 1226
                }
1227
                if(response['data']['type'] == 'image') {
6510 nelberth 1228
                    console.log(response['data']['file'])
1 www 1229
                    $('#form-slide-image-edit').attr('action',url);
1230
                    $('#form-slide-image-edit #name').val(response['data']['name']);
1231
                    $('#form-slide-image-edit #order').val(response['data']['order']);
1232
                    validatorImageEdit.resetForm();
1233
 
6501 nelberth 1234
                    $('body, html').animate({scrollTop: '0px'}, 300);
1235
					$('#content1').css('display','none');
6586 nelberth 1236
                    seleccionarCampo=  $('#company-microlearning-slide-image-edit-box ');
6601 nelberth 1237
                    seleccionarCampo.css('display','block')
6568 nelberth 1238
		            iniciarEditor(seleccionarCampo,response['data']['file'])
1 www 1239
 
1240
                }
1241
                if(response['data']['type'] == 'video') {
1242
                    $('#form-slide-video-edit').attr('action',url);
1243
                    $('#form-slide-video-edit #name').val(response['data']['name']);
1244
                    $('#form-slide-video-edit #order').val(response['data']['order']);
1245
                    $('#form-slide-video-edit #file').fileinput('reset');
1246
                    $('#form-slide-video-edit #file').val('');
1247
                    validatorVideoEdit.resetForm();
1248
 
6613 nelberth 1249
 
1250
 
1251
                    $('body, html').animate({scrollTop: '0px'}, 300);
1252
					$('#content1').css('display','none');
1253
                    seleccionarCampo= $('#company-microlearning-slide-video-edit-box');
1254
                    seleccionarCampo.css('display','block')
1255
		            iniciarEditor(seleccionarCampo,response['data']['background'])
1 www 1256
 
1257
                }
1258
                if(response['data']['type'] == 'document') {
1259
                    $('#form-slide-document-edit').attr('action',url);
1260
                    $('#form-slide-document-edit #name').val(response['data']['name']);
1261
                    $('#form-slide-document-edit #order').val(response['data']['order']);
1262
                    $('#form-slide-document-edit #file').fileinput('reset');
1263
                    $('#form-slide-document-edit #file').val('');
1264
                    validatorDocumentEdit.resetForm();
1265
 
6613 nelberth 1266
                    $('body, html').animate({scrollTop: '0px'}, 300);
1267
					$('#content1').css('display','none');
1268
                    seleccionarCampo= $('#company-microlearning-slide-document-edit-box');
1269
                    seleccionarCampo.css('display','block')
1270
		            iniciarEditor(seleccionarCampo,response['data']['background'])
1 www 1271
 
1272
                }
1273
                if(response['data']['type'] == 'audio') {
1274
                    $('#form-slide-audio-edit').attr('action',url);
1275
                    $('#form-slide-audio-edit #name').val(response['data']['name']);
1276
                    $('#form-slide-audio-edit #order').val(response['data']['order']);
1277
                    $('#form-slide-audio-edit #file').fileinput('reset');
1278
                    $('#form-slide-audio-edit #file').val('');
1279
                    validatorAudioEdit.resetForm();
1280
 
6613 nelberth 1281
                    $('body, html').animate({scrollTop: '0px'}, 300);
1282
					$('#content1').css('display','none');
1283
                    seleccionarCampo= $('#company-microlearning-slide-audio-edit-box');
1284
                    seleccionarCampo.css('display','block')
1285
		            iniciarEditor(seleccionarCampo,response['data']['background'])
1 www 1286
 
6613 nelberth 1287
 
1 www 1288
                }
1289
                if(response['data']['type'] == 'quiz') {
1290
                    $('#form-slide-quizz-edit').attr('action',url);
1291
                    $('#form-slide-quizz-edit #name').val(response['data']['name']);
1292
                    $('#form-slide-quizz-edit #order').val(response['data']['order']);
1293
                    $('#form-slide-quizz-edit #quiz_id').val(response['data']['quiz_id']);
1294
                    validatorQuizzEdit.resetForm();
1295
 
6613 nelberth 1296
                    $('body, html').animate({scrollTop: '0px'}, 300);
1297
					$('#content1').css('display','none');
1298
                    seleccionarCampo= $('#company-microlearning-slide-quizz-edit-box');
1299
                    seleccionarCampo.css('display','block')
1300
		            iniciarEditor(seleccionarCampo,response['data']['background'])
1 www 1301
 
1302
                }
1303
 
1304
            } else {
1305
                validatorTextEdit.resetForm();
1306
                if(jQuery.type(response['data']) == 'string') {
1307
                    $.fn.showError(response['data']);
1308
                } else  {
1309
                    $.each(response['data'], function( fieldname, errors ) {
1310
                        $.fn.showFormErrorValidator('#form-slide-image-edit #' + fieldname, errors);
1311
                    });
1312
                }
1313
            }
1314
        }).fail(function( jqXHR, textStatus, errorThrown) {
1315
            $.fn.showError(textStatus);
1316
        }).always(function() {
1317
            NProgress.done();
1318
        });
1319
    });
6503 nelberth 1320
	$('body').on('click', '#ir_atras', function(e) {
1321
            e.preventDefault();
1322
            $('body, html').animate({scrollTop: '0px'}, 300);
6504 nelberth 1323
			$('#content1').css('display','block');
6592 nelberth 1324
            seleccionarCampo.css('display','none');
6575 nelberth 1325
            $('.contenido').html('');
6503 nelberth 1326
            return false;
1327
        });
1 www 1328
    $(".btn-cover-close").on("click", function(e){
1329
        e.preventDefault();
1330
 
1331
 
1332
        $('#company-microlearning-slide-text-add-box').modal('hide');
1333
        $('#company-microlearning-slide-text-edit-box').modal('hide');
1334
        $('#company-microlearning-slide-image-add-box').modal('hide');
1335
        $('#company-microlearning-slide-image-edit-box').modal('hide');
1336
        $('#company-microlearning-slide-video-add-box').modal('hide');
1337
        $('#company-microlearning-slide-video-edit-box').modal('hide');
1338
        $('#company-microlearning-slide-document-add-box').modal('hide');
1339
        $('#company-microlearning-slide-document-edit-box').modal('hide');
1340
        $('#company-microlearning-slide-audio-add-box').modal('hide');
1341
        $('#company-microlearning-slide-audio-edit-box').modal('hide');
1342
        $('#company-microlearning-slide-quizz-add-box').modal('hide');
1343
        $('#company-microlearning-slide-quizz-edit-box').modal('hide');
1344
        $('#company-microlearning-play-video-box').modal('hide');
1345
        $('#company-microlearning-play-audio-box').modal('hide');
1346
        $('#company-microlearning-add-capsule-type-box').modal('hide');
1347
 
1348
 
1349
 
1350
         document.getElementById('microlearning-play-video').pause();
1351
         document.getElementById('microlearning-play-audio').pause();
1352
 
1353
        return false;
1354
    });
1355
 
1356
    $('body').on('click', 'button.btn-add-quizz', function(e) {
1357
        e.preventDefault();
1358
        $('#company-microlearning-add-capsule-type-box').modal('hide');
1359
 
1360
 
1361
        $('#form-slide-quizz-add #name').val('');
1362
        $('#form-slide-quizz-add #order').val('1');
1363
        $('#form-slide-quizz-add #quiz_id').val('');
1364
        CKEDITOR.instances.description_add.setData('');
1365
        validatorQuizzAdd.resetForm();
1366
 
1367
 
6616 nelberth 1368
        $('body, html').animate({scrollTop: '0px'}, 300);
1369
		$('#content1').css('display','none');
1370
        seleccionarCampo= $('#company-microlearning-slide-quizz-add-box');
1371
        seleccionarCampo.css('display','block')
1372
		iniciarEditor(seleccionarCampo)
1 www 1373
 
1374
        return false;
1375
    });
1376
 
1377
    $('body').on('click', 'button.btn-add-text', function(e) {
1378
        e.preventDefault();
1379
 
1380
        $('#company-microlearning-add-capsule-type-box').modal('hide');
1381
 
1382
        $('#form-slide-text-add #name').val('');
1383
        $('#form-slide-text-add #order').val('1');
1384
        CKEDITOR.instances.description_add.setData('');
1385
        validatorTextAdd.resetForm();
1386
 
6616 nelberth 1387
        $('body, html').animate({scrollTop: '0px'}, 300);
1388
		$('#content1').css('display','none');
6590 nelberth 1389
        seleccionarCampo =  $('#company-microlearning-slide-text-add-box');
6616 nelberth 1390
        seleccionarCampo.css('display','block')
6556 nelberth 1391
		iniciarEditor(seleccionarCampo)
1 www 1392
        return false;
1393
    });
1394
 
1395
 
1396
    $('body').on('click', 'button.btn-add-image', function(e) {
1397
        e.preventDefault();
1398
 
1399
        $('#company-microlearning-add-capsule-type-box').modal('hide');
1400
        $('#form-slide-image-add #name').val('');
1401
        $('#form-slide-image-add #order').val('1');
6112 nelberth 1402
 
1 www 1403
        validatorImageAdd.resetForm();
1404
 
6616 nelberth 1405
        $('body, html').animate({scrollTop: '0px'}, 300);
1406
		$('#content1').css('display','none');
1407
        seleccionarCampo =  $('#company-microlearning-slide-image-add-box');
1408
        seleccionarCampo.css('display','block')
6565 nelberth 1409
		iniciarEditor(seleccionarCampo)
6122 nelberth 1410
 
1 www 1411
        return false;
1412
    });
1413
 
1414
    $('body').on('click', 'button.btn-add-video', function(e) {
1415
        e.preventDefault();
1416
 
1417
        $('#company-microlearning-add-capsule-type-box').modal('hide');
1418
        $('#form-slide-video-add #name').val('');
1419
        $('#form-slide-video-add #order').val('1');
1420
        $('#form-slide-video-add #file').fileinput('reset');
1421
        $('#form-slide-video-add #file').val('');
1422
        $('#form-slide-video-add #file').fileinput('reset');
1423
        $('#form-slide-video-add #file').val('');
1424
        validatorVideoAdd.resetForm();
1425
 
6616 nelberth 1426
 
1427
        $('body, html').animate({scrollTop: '0px'}, 300);
1428
		$('#content1').css('display','none');
1429
        seleccionarCampo =  $('#company-microlearning-slide-video-add-box');
1430
        seleccionarCampo.css('display','block')
1431
		iniciarEditor(seleccionarCampo)
1 www 1432
 
1433
        return false;
1434
    });
1435
 
1436
    $('body').on('click', 'button.btn-add-document', function(e) {
1437
        e.preventDefault();
1438
 
1439
 
1440
        $('#company-microlearning-add-capsule-type-box').modal('hide');
1441
        $('#form-slide-document-add #name').val('');
1442
        $('#form-slide-document-add #order').val('1');
1443
        $('#form-slide-document-add #file').fileinput('reset');
1444
        $('#form-slide-document-add #file').val('');
1445
        validatorDocumentAdd.resetForm();
1446
 
6616 nelberth 1447
        $('body, html').animate({scrollTop: '0px'}, 300);
1448
		$('#content1').css('display','none');
1449
        seleccionarCampo =  $('#company-microlearning-slide-document-add-box');
1450
        seleccionarCampo.css('display','block')
1451
		iniciarEditor(seleccionarCampo)
1 www 1452
 
1453
        return false;
1454
    });
1455
 
1456
    $('body').on('click', 'button.btn-add-audio', function(e) {
1457
        e.preventDefault();
1458
 
1459
        $('#company-microlearning-add-capsule-type-box').modal('hide');
1460
        $('#form-slide-audio-add #name').val('');
1461
        $('#form-slide-audio-add #order').val('1');
1462
        $('#form-slide-audio-add #file').fileinput('reset');
1463
        $('#form-slide-audio-add #file').val('');
1464
        validatorAudioAdd.resetForm();
1465
 
6616 nelberth 1466
        $('body, html').animate({scrollTop: '0px'}, 300);
1467
		$('#content1').css('display','none');
1468
        seleccionarCampo =  $('#company-microlearning-slide-audio-add-box');
1469
        seleccionarCampo.css('display','block')
1470
		iniciarEditor(seleccionarCampo)
1 www 1471
 
1472
        return false;
1473
    });
1474
 
1475
    $('#company-microlearning-slide-text-add-box, #company-microlearning-slide-text-edit-box').on("hide.bs.modal", function() {
1476
 
1477
    })
1478
 
1479
    $('#company-microlearning-slide-image-add-box, #company-microlearning-slide-image-edit-box').on("hide.bs.modal", function() {
1480
 
1481
    })
1482
 
1483
    $('#company-microlearning-slide-video-add-box, #company-microlearning-slide-video-edit-box').on("hide.bs.modal", function() {
1484
 
1485
    })
1486
 
1487
    $('#company-microlearning-slide-document-add-box, #company-microlearning-slide-document-edit-box').on("hide.bs.modal", function() {
1488
 
1489
    })
1490
 
1491
    $('#company-microlearning-slide-quizz-add-box, #company-microlearning-slide-quizz-edit-box').on("hide.bs.modal", function() {
1492
 
1493
    })
1494
 
1495
    $('#company-microlearning-play-video-box, #company-microlearning-play-audio-box').on("hide.bs.modal", function() {
1496
 
1497
 
1498
        document.getElementById('microlearning-play-video').pause();
1499
        document.getElementById('microlearning-play-audio').pause();
1500
    })
1501
 
1502
 
1503
    $('#form-slide-text-add #order').inputNumberFormat({decimal: 0});
1504
 
6591 nelberth 1505
 
1 www 1506
 
1507
    $('#form-slide-text-edit #order').inputNumberFormat({decimal: 0});
1508
 
1509
 
6591 nelberth 1510
 
1 www 1511
    $('#form-slide-image-add #order').inputNumberFormat({decimal: 0});
1512
 
6522 nelberth 1513
 
1 www 1514
 
1515
    $('#form-slide-image-edit #order').inputNumberFormat({decimal: 0});
1516
 
6522 nelberth 1517
 
1 www 1518
 
1519
    $('#form-slide-video-add #order').inputNumberFormat({decimal: 0});
1520
 
1521
    $('#form-slide-video-add #file').fileinput({
12077 nelberth 1522
        theme: 'fa',
1 www 1523
        language: 'es',
1524
        showUpload: false,
1525
        dropZoneEnabled: false,
1526
        maxFileCount: 1,
1527
        allowedFileExtensions: ['mp4', 'mpeg','webm'],
1528
        msgPlaceholder: 'Video de extensión mp4, mpeg, webm',
1529
    });
1530
 
1531
 
6591 nelberth 1532
 
1 www 1533
    $('#form-slide-video-edit #order').inputNumberFormat({decimal: 0});
1534
 
1535
    $('#form-slide-video-edit #file').fileinput({
12077 nelberth 1536
        theme: 'fa',
1 www 1537
        language: 'es',
1538
        showUpload: false,
1539
        dropZoneEnabled: false,
1540
        maxFileCount: 1,
1541
        allowedFileExtensions: ['mp4', 'mpeg','webm'],
1542
        msgPlaceholder: 'Video de extensión mp4, mpeg, webm',
1543
    });
1544
 
1545
 
6591 nelberth 1546
 
1 www 1547
 
1548
 
1549
    $('#form-slide-document-add #order').inputNumberFormat({decimal: 0});
1550
 
1551
    $('#form-slide-document-add #file').fileinput({
12077 nelberth 1552
        theme: 'fa',
1 www 1553
        language: 'es',
1554
        showUpload: false,
1555
        dropZoneEnabled: false,
1556
        maxFileCount: 1,
1557
        allowedFileExtensions: ['pdf'],
1558
        msgPlaceholder: 'Documentos de extensión pdf',
1559
    });
1560
 
1561
 
1562
 
6591 nelberth 1563
 
1 www 1564
    $('#form-slide-document-edit #order').inputNumberFormat({decimal: 0});
1565
 
1566
    $('#form-slide-document-edit #file').fileinput({
12077 nelberth 1567
        theme: 'fa',
1 www 1568
        language: 'es',
1569
        showUpload: false,
1570
        dropZoneEnabled: false,
1571
        maxFileCount: 1,
1572
        allowedFileExtensions: ['pdf'],
1573
        msgPlaceholder: 'Documentos de extensión pdf',
1574
    });
1575
 
1576
 
1577
 
6591 nelberth 1578
 
1 www 1579
    $('#form-slide-audio-add #order').inputNumberFormat({decimal: 0});
1580
 
1581
    $('#form-slide-audio-add #file').fileinput({
12077 nelberth 1582
        theme: 'fa',
1 www 1583
        language: 'es',
1584
        showUpload: false,
1585
        dropZoneEnabled: false,
1586
        maxFileCount: 1,
1587
        allowedFileExtensions: ['wav', 'mp3'],
1588
        msgPlaceholder: 'Audios de extensión wav y mp3',
1589
    });
1590
 
1591
 
1592
 
6591 nelberth 1593
 
1 www 1594
    $('#form-slide-audio-edit #order').inputNumberFormat({decimal: 0});
1595
 
1596
    $('#form-slide-audio-edit #file').fileinput({
12077 nelberth 1597
        theme: 'fa',
1 www 1598
        language: 'es',
1599
        showUpload: false,
1600
        dropZoneEnabled: false,
1601
        maxFileCount: 1,
1602
        allowedFileExtensions: ['wav', 'mp3'],
1603
        msgPlaceholder: 'Audios de extensión wav y mp3',
1604
    });
1605
 
1606
 
1607
 
6591 nelberth 1608
 
1 www 1609
    $('#form-slide-quizz-add #order').inputNumberFormat({decimal: 0});
1610
 
1611
 
1612
 
6591 nelberth 1613
 
1 www 1614
    $('#form-slide-quizz-edit #order').inputNumberFormat({decimal: 0});
1615
 
6591 nelberth 1616
 
1 www 1617
 
1618
 
1619
 
1620
 
1621
 
1622
 
1623
 
8290 stevensc 1624
    CKEDITOR.replace('description_add', {
1625
        toolbar: [
1626
                    { name: 'editing', items: ['Scayt'] },
1627
                    { name: 'links', items: ['Link', 'Unlink'] },
1628
                    { name: 'paragraph', items: ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote'] },
1629
                    { name: 'basicstyles', items: ['Bold', 'Italic', 'Strike', 'RemoveFormat'] },
1630
                    '/',
1631
                    { name: 'insert', items: ['Image', 'Table', 'HorizontalRule', 'SpecialChar'] },
1632
                    { name: 'styles', items: ['Styles', 'Format'] },
1633
                    { name: 'tools', items: ['Maximize'] }
1634
                ],
1635
                removePlugins: 'elementspath,Anchor',
1636
                heigth: 100
1637
    });
1638
    CKEDITOR.replace('description_edit',{
1639
        toolbar: [
1640
                    { name: 'editing', items: ['Scayt'] },
1641
                    { name: 'links', items: ['Link', 'Unlink'] },
1642
                    { name: 'paragraph', items: ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote'] },
1643
                    { name: 'basicstyles', items: ['Bold', 'Italic', 'Strike', 'RemoveFormat'] },
1644
                    '/',
1645
                    { name: 'insert', items: ['Image', 'Table', 'HorizontalRule', 'SpecialChar'] },
1646
                    { name: 'styles', items: ['Styles', 'Format'] },
1647
                    { name: 'tools', items: ['Maximize'] }
1648
                ],
1649
                removePlugins: 'elementspath,Anchor',
1650
                heigth: 100
1651
    });
1 www 1652
 
1653
 
1654
   $('body').on('click', '.btn-view-image', function(e) {
1655
        e.preventDefault();
1656
 
1657
        $('#company-microlearning-view-image-box').modal('show');
1658
 
1659
        $('#image-view').attr('src', $(this).data('href'));
1660
 
1661
        return false;
1662
    });
1663
 
1664
 
1665
    $('body').on('click', '.btn-play-video', function(e) {
1666
        e.preventDefault();
1667
 
1668
        $('#microlearning-play-video').attr('src', $(this).data('href'));
1669
        $('#company-microlearning-play-video-box').modal('show');
1670
 
1671
        return false;
1672
    });
1673
 
1674
    $('body').on('click', '.btn-play-audio', function(e) {
1675
        e.preventDefault();
1676
 
1677
 
1678
        $('#microlearning-play-audio').attr('src', $(this).data('href'));
1679
        $('#company-microlearning-play-audio-box').modal('show');
1680
 
1681
        return false;
1682
    });
1683
 
1684
    $('body').on('click', '.btn-view-document', function(e) {
1685
        e.preventDefault();
1686
 
1687
 
1688
        $('#document-view').attr('src', $(this).data('href'));
1689
        $('#company-microlearning-view-document-box').modal('show');
1690
 
1691
        return false;
1692
    });
1693
 
1694
    $('body').on('click', '.btn-view-text', function(e) {
1695
        e.preventDefault();
1696
 
1697
        var url = $(this).data('href');
1698
        $.ajax({
1699
            'dataType'  : 'json',
1700
            'accept'    : 'application/json',
1701
            'method'    : 'get',
1702
            'url'       :  url,
1703
        }).done(function(response) {
1704
            if(response['success']) {
1705
                $('#document-text').html( response['data']  );
1706
            }
1707
 
1708
        }).fail(function( jqXHR, textStatus, errorThrown) {
1709
            $.fn.showError(textStatus);
1710
        }).always(function() {
1711
            NProgress.done();
1712
        });
1713
 
1714
 
1715
        $('#company-microlearning-view-text-box').modal('show');
1716
 
1717
        return false;
1718
    });
1719
 
1720
 
1721
 
1722
    $('#form-filter #topic_uuid').change(function(e) {
1723
        e.preventDefault();
1724
 
1725
        $('#form-filter #capsule_uuid').empty();
1726
        gridTable.api().ajax.reload(null, false);
1727
    })
1728
 
1729
 
1730
    $('#form-filter #capsule_uuid').change(function(e) {
1731
        e.preventDefault();
1732
 
1733
        gridTable.api().ajax.reload(null, false);
1734
    })
1735
 
1736
    $('button.btn-add').click(function(e) {
1737
        e.preventDefault()
1738
 
1739
        $('#company-microlearning-add-capsule-type-box').modal('show');
1740
 
1741
    } );
1742
 
1743
 
1744
 
1745
    $('body').on('click', 'button.btn-refresh', function(e) {
1746
        e.preventDefault();
1747
        gridTable.api().ajax.reload(null, false);
1748
    });
1749
 
6113 nelberth 1750
    	/*Script del editor (Aqui comienza el cielo y la tierra) */
1751
		var imagenServidorNoticia;
1752
		var scroll_altura,viente;
1753
		var nombre_user = $(".perfil_u_nombre").text();
1754
		var primer_nombre = nombre_user.split(" ")[0];
11028 nelberth 1755
		var nuevoHtmlImagen='<div class="articulo_noticia animated fadeIn"> <div class="pasos"> <div class="titulo_pasos animated fadeInDown delay-04 fast">LABEL_STEP_1</div><div class="paso_opcion"> <div class="responsing_cut"> <div class="icon_cut"><span class="fa fa-scissors"></span></div><div class="contenido_cut"> <div class="animated fadeInRight delay-04 fast"> <div> <div class="titulo_cut"> <div>LABEL_CUT</div><div class="fa fa-times" id="cerrar_cut_modal"></div></div><div class="opcion_editor recortar10"> <div class="recortar_texto">LABEL_CUT</div><div id="blockCelda"><span class="fa fa-unlock"></span></div></div></div></div></div></div><div class="responsing_text"> <div class="icon_text"><span class="fa fa-text-width"></span></div><div class="contenido_text"> <div class="animated fadeInRight delay-04 fast"> <div class="texto"> <div class="titulo_text"> <div>LABEL_TEXT</div><div class="fa fa-times" id="cerrar_text_modal"></div></div><div class="fonts mb-20"><select name="fuentes" id="selectFuente" class="select-custom mr-2"><option value="arial" selected>LABEL_FONT_ARIAL</option><option value="calibri">LABEL_FONT_CALIBRI</option><option value="forte">LABEL_FONT_FORTE</option><option value="impact">LABEL_FONT_IMPACT</option><option value="jokerman">LABEL_FONT_JOKERMAN</option><option value="mv boli">LABEL_FONT_MV_BOLI</option><option value="times new roman">LABEL_FONT_TIMES_NEW_ROMAN</option><option value="verdana">LABEL_FONT_VERDANA</option><option value="vivaldi">LABEL_FONT_VIVALDI</option></select><input type="number" class="" data-tooltip="Tamaño de la letra" name="" id="font-size" max="500" min="1" step="1" value="48"/></div><div class="fonts mb-20"> <div class="font" id="negritas" data-tooltip="Negritas"><i class="fa fa-bold" aria-hidden="true"></i></div><div class="font" id="italic" data-tooltip="Letra Cursiva"><i class="fa fa-italic" aria-hidden="true"></i></div><div class="color_letra font"><label>A</label><input type="color" class="" data-tooltip="Color de la letra" name="" id="color" value="#ffffff"/></div><div class="font fa" data-tooltip="Sombra de la letra" id="shadow">S</div><div class="font" id="rectangulo" data-tooltip="Fondo de la letra"> <div class="rectangulo">F</div></div></div><div class="color_fondo_cuadro mb-20 flex-column" style="display:none"> <div class="w-100 d-flex justify-content-between border-bottom"><label for="colorrect" class="font-weight-normal d-flex align-items-center" style="margin:0 !important">LABEL_COLOR_BACKGROUND: </label><input type="color" name="" id="colorrect" value="#000000" style="width:30px" data-tooltip="Color del fondo" class="mr-2"/></div><div class="d-flex flex-column"><label for="opacidad" class="font-weight-normal mt-2">LABEL_BACKGROUND_TRANSPARENCY</label><input type="range" id="opacidad" max="100" min="1" step="1" value="100" ></div></div><input id="texto_input" type="text" name="texto" placeholder="LABEL_ADD_TEXT_HERE"/> </div></div></div></div><div class="responsing_filtros"> <div class="icon_filter"><span class="fa fa-eyedropper"></span></div><div class="contenido_filter"> <div class="titulo_filtro mb-20"> <div>LABEL_FILTERS</div><div class="fa fa-times" id="cerrar_filter_modal"></div></div><div class="fonts mb-20"> <select name="filtros" id="selectFiltro" class="select-custom"><option class="opcion_editor" value="normal">LABEL_FILTER_NORMAL</option><option class="opcion_editor" value=".5,1.3,1.31,1.33,1.38">LABEL_FILTER_NIGHT</option><option class="opcion_editor" value=".7,1.1,1.64,1.66,1.50">LABEL_FILTER_SAINT_ANA</option><option class="opcion_editor" value=".75,1,1.66,1.60,1.51">LABEL_FILTER_CREAM</option><option class="opcion_editor" value=".7,1.2,1.49,1.49,1.6">LABEL_FILTER_MAGIC</option><option class="opcion_editor" value=".7,1.2,1.60,1.66,1.58">LABEL_FILTER_RELIEF</option><option class="opcion_editor" value=".9,.9,1.45,1.54,1.54">LABEL_FILTER_LIGHT</option><option class="opcion_editor" value="1,1.5,1,1,1">LABEL_FILTER_SATURATION</option><option class="opcion_editor" value=".9,1.3,1,1,1">LABEL_FILTER_RETOUCH</option><option class="opcion_editor" value=".8,1,1.6,1.45,1.49">LABEL_FILTER_ORANGE</option><option class="opcion_editor" value=".8,.75,1.60,1.66,1.58">LABEL_FILTER_WIND</option><option class="opcion_editor" value=".8,.9,1.66,1.43,1.28">LABEL_FILTER_DESERT</option><option class="opcion_editor" value=".85,.75,1.47,1.66,1.54">LABEL_FILTER_FOREST</option><option class="opcion_editor" value=".8,.8,1.71,1.64,1.58">LABEL_FILTER_TOWN</option><option class="opcion_editor" value=".8,1.2,1.24,.99,1">LABEL_FILTER_PINK</option><option class="opcion_editor" value=".9,1.1,1.33,1.19,.91">LABEL_FILTER_HISTORY</option><option class="opcion_editor" value="1,1,gris">LABEL_FILTER_GRAY</option><option class="opcion_editor" value=".8,1.5,gris">LABEL_FILTER_OLD_PICTURE</option><option class="opcion_editor" value=".9,1.2,26,-12,0,2">LABEL_FILTER_CHARMING</option><option class="opcion_editor" value="1.1,1.4,40,12,-6,2">LABEL_FILTER_EMOTION</option><option class="opcion_editor" value=".9,1.32,56,47,17,2">LABEL_FILTER_BEIGE</option><option class="opcion_editor" value=".87,1.19,55,37,23,2">LABEL_FILTER_FINE</option><option class="opcion_editor" value="1.2,.9,67,13,-23,2">LABEL_FILTER_LORD</option><option class="opcion_editor" value="1.2,1.2,35,7,18,2">LABEL_FILTER_70S</option><option class="opcion_editor" value=".92,1.23,-11,11,11,2">LABEL_FILTER_TREE</option><option class="opcion_editor" value=" 1,1.4,-3,-1,-12,2">LABEL_FILTER_SUMMER</option><option class="opcion_editor" value=".85,1.26,-15,2,-1,2">LABEL_FILTER_COLD_WEATHER</option><option class="opcion_editor" value="1,1.4,5,12,1,2">LABEL_FILTER_ANGELS</option><option class="opcion_editor" value=".9,1.2,43,-17,-55,2">LABEL_FILTER_HOT</option><option class="opcion_editor" value="1,1.29,29,26,17,2">LABEL_FILTER_FALL</option><option class="opcion_editor" value=".85,1.3,43,25,-11,2">LABEL_FILTER_MARCH</option><option class="opcion_editor" value=".8,1.25,31,41,12,2">LABEL_FILTER_PEAR</option><option class="opcion_editor" value="1,1.36,4,5,1,2">LABEL_FILTER_COMMON</option><option class="opcion_editor" value=".9,1.3,37,-25,1,2">LABEL_FILTER_GOLD</option><option class="opcion_editor" value="1.1,1.3,-47,-42,-30,2">LABEL_FILTER_GOTHIC</option><option class="opcion_editor" value="1,1.4,-5,42,11,2">LABEL_FILTER_FORESTRY</option><option class="opcion_editor" value=".9,1.2,-5,-7,4,2">LABEL_FILTER_MOON</option><option class="opcion_editor" value="1.1,1.3,-1,-1,26,2">LABEL_FILTER_PARTY</option> </select> </div></div></div><div class="volver"><span class="icon-undo"></span>LABEL_START_OVER</div><div class="paso_1 paso animated bounceInDown delay-04 fast">1</div><div class="paso_2 a1 animated bounceInDown delay-06 fast">2</div><div class="paso_2 b1 animated bounceInDown delay-08 fast">3</div></div></div><div class="editor_imagenes"> <div class="fondo_oscuro"></div><div class="editor_imagenes2 "> <div> <div class="canvas_imagen"> <div class="canvas recortar"> <div class="canvas_subir d-flex flex-column" id="imagen_noticia"><div>LABEL_DRAG_IMAGE_HERE_OR </div><label class="font-weight-normal mt-2" style="font-size:0.6em"for="imagen_noticia_file"> LABEL_UPLOAD_FILE_IMAGE <div class="ml-2 btn btn-primary btn-sm">LABEL_SELECT_IMAGE</div></label> <input style="display:none" type="file" id="imagen_noticia_file" accept="image/x-png,image/jpeg"></div></div></div><div class="botones_dimenciones"> <div class="scale"> <div class="dimenciones"> <div id="ancho">1240px</div><div>x</div><div id="alto">720px</div></div><div class="porciento"> <div id="menos_scale"><span class="icon-minus fa fa-minus"></span></div><div class="ps"> <ul class="cantidades_scale"> <li data-scale="2" class="as">200%</li><li data-scale="1" class="as">100%</li><li data-scale="0.75" class="as">75%</li><li data-scale="0.5" class="as">50%</li><li data-scale="0.25" class="as">25%</li></ul> <div id="porciento_scale">50%</div></div><div id="mas_scale"><span class="icon-plus fa fa-plus"></span></div></div></div><div class="botones"><button class="boton_normal" id="ir_atras">LABEL_GO_BACK</button><button class="boton_normal" id="boton_recortar">LABEL_DATATABLE_SNEXT</button></div></div></div><div class="modificar animated fadeInRight delay-04 fast escalar"> <div> <div class="titulo_recortar"><span class="icon-ungroup fa fa-scissors mb-20"></span>LABEL_CUT</div><div class="opcion_editor recortar10"> <div class="recortar_texto">LABEL_CUT</div><div id="blockCelda"><span class="fa fa-unlock"></span></div></div></div><div class="texto"> <div class="mb-20"> <div class="titulo_texto "><span class="icon-plus fa fa-text-width"></span>LABEL_TEXT</div></div><div class="fonts mb-20"> <select name="fuentes" id="selectFuente" class="select-custom mr-2"> <option value="arial" selected>LABEL_FONT_ARIAL</option> <option value="calibri">LABEL_FONT_CALIBRI</option> <option value="forte">LABEL_FONT_FORTE</option> <option value="impact">LABEL_FONT_IMPACT</option> <option value="jokerman">LABEL_FONT_JOKERMAN</option> <option value="mv boli">LABEL_FONT_MV_BOLI</option> <option value="times new roman">LABEL_FONT_TIMES_NEW_ROMAN</option> <option value="verdana">LABEL_FONT_VERDANA</option> <option value="vivaldi">LABEL_FONT_VIVALDI</option> </select> <input type="number" class="" data-tooltip="Tamaño de la letra" name="" id="font-size" max="500" min="1" step="1" value="48"/> </div><div class="fonts mb-20"> <div class="font" id="negritas" data-tooltip="Negritas"><i class="fa fa-bold" aria-hidden="true"></i></div><div class="font" id="italic" data-tooltip="Letra Cursiva"><i class="fa fa-italic" aria-hidden="true"></i></div><div class="color_letra font"><label>A</label><input type="color" class="" data-tooltip="Color de la letra" name="" id="color" value="#ffffff"/></div><div class="font fa" data-tooltip="Sombra de la letra" id="shadow">S</div><div class="font" id="rectangulo" data-tooltip="Fondo de la letra"> <div class="rectangulo">F</div></div></div><div class="color_fondo_cuadro mb-20 flex-column" style="display:none"> <div class="w-100 d-flex justify-content-between border-bottom"><label for="colorrect" class="font-weight-normal d-flex align-items-center" style="margin:0 !important">LABEL_COLOR_BACKGROUND: </label><input type="color" name="" id="colorrect" value="#000000" style="width:30px" data-tooltip="Color del fondo" class="mr-2"/></div><div class="d-flex flex-column"><label for="opacidad" class="font-weight-normal mt-2">LABEL_BACKGROUND_TRANSPARENCY</label><input type="range" id="opacidad" max="100" min="1" step="1" value="100" ></div></div><input id="texto_input" type="text" name="texto" placeholder="LABEL_ADD_TEXT_HERE"/> <div class="mb-20"> <div class="titulo_filtro"><span class="icon-eyedropper fa fa-eyedropper"></span>LABEL_FILTERS</div></div><div class="fonts mb-20"> <select name="filtros" id="selectFiltro" class="select-custom selectFiltro"><option class="opcion_editor" value="normal" >LABEL_FILTER_NORMAL</option><option class="opcion_editor" value=".5,1.3,1.31,1.33,1.38">LABEL_FILTER_NIGHT</option><option class="opcion_editor" value=".7,1.1,1.64,1.66,1.50">LABEL_FILTER_SAINT_ANA</option><option class="opcion_editor" value=".75,1,1.66,1.60,1.51">LABEL_FILTER_CREAM</option><option class="opcion_editor" value=".7,1.2,1.49,1.49,1.6">LABEL_FILTER_MAGIC</option><option class="opcion_editor" value=".7,1.2,1.60,1.66,1.58">LABEL_FILTER_RELIEF</option><option class="opcion_editor" value=".9,.9,1.45,1.54,1.54">LABEL_FILTER_LIGHT</option><option class="opcion_editor" value="1,1.5,1,1,1">LABEL_FILTER_SATURATION</option><option class="opcion_editor" value=".9,1.3,1,1,1">LABEL_FILTER_RETOUCH</option><option class="opcion_editor" value=".8,1,1.6,1.45,1.49">LABEL_FILTER_ORANGE</option><option class="opcion_editor" value=".8,.75,1.60,1.66,1.58">LABEL_FILTER_WIND</option><option class="opcion_editor" value=".8,.9,1.66,1.43,1.28">LABEL_FILTER_DESERT</option><option class="opcion_editor" value=".85,.75,1.47,1.66,1.54">LABEL_FILTER_FOREST</option><option class="opcion_editor" value=".8,.8,1.71,1.64,1.58">LABEL_FILTER_TOWN</option><option class="opcion_editor" value=".8,1.2,1.24,.99,1">LABEL_FILTER_PINK</option><option class="opcion_editor" value=".9,1.1,1.33,1.19,.91">LABEL_FILTER_HISTORY</option><option class="opcion_editor" value="1,1,gris">LABEL_FILTER_GRAY</option><option class="opcion_editor" value=".8,1.5,gris">LABEL_FILTER_OLD_PICTURE</option><option class="opcion_editor" value=".9,1.2,26,-12,0,2">LABEL_FILTER_CHARMING</option><option class="opcion_editor" value="1.1,1.4,40,12,-6,2">LABEL_FILTER_EMOTION</option><option class="opcion_editor" value=".9,1.32,56,47,17,2">LABEL_FILTER_BEIGE</option><option class="opcion_editor" value=".87,1.19,55,37,23,2">LABEL_FILTER_FINE</option><option class="opcion_editor" value="1.2,.9,67,13,-23,2">LABEL_FILTER_LORD</option><option class="opcion_editor" value="1.2,1.2,35,7,18,2">LABEL_FILTER_70S</option><option class="opcion_editor" value=".92,1.23,-11,11,11,2">LABEL_FILTER_TREE</option><option class="opcion_editor" value=" 1,1.4,-3,-1,-12,2">LABEL_FILTER_SUMMER</option><option class="opcion_editor" value=".85,1.26,-15,2,-1,2">LABEL_FILTER_COLD_WEATHER</option><option class="opcion_editor" value="1,1.4,5,12,1,2">LABEL_FILTER_ANGELS</option><option class="opcion_editor" value=".9,1.2,43,-17,-55,2">LABEL_FILTER_HOT</option><option class="opcion_editor" value="1,1.29,29,26,17,2">LABEL_FILTER_FALL</option><option class="opcion_editor" value=".85,1.3,43,25,-11,2">LABEL_FILTER_MARCH</option><option class="opcion_editor" value=".8,1.25,31,41,12,2">LABEL_FILTER_PEAR</option><option class="opcion_editor" value="1,1.36,4,5,1,2">LABEL_FILTER_COMMON</option><option class="opcion_editor" value=".9,1.3,37,-25,1,2">LABEL_FILTER_GOLD</option><option class="opcion_editor" value="1.1,1.3,-47,-42,-30,2">LABEL_FILTER_GOTHIC</option><option class="opcion_editor" value="1,1.4,-5,42,11,2">LABEL_FILTER_FORESTRY</option><option class="opcion_editor" value=".9,1.2,-5,-7,4,2">LABEL_FILTER_MOON</option><option class="opcion_editor" value="1.1,1.3,-1,-1,26,2">LABEL_FILTER_PARTY</option> </select> </div></div></div></div></div></div><dav class="fixed_noticia"></dav><dav class="cuadro_noticias animated bounceInUp delay-04" id="cuadro_noticias"> <dav class="relative"> <div class="titulo_topico">LABEL_TITLE_TOPIC</div><canvas class="imagen_noticias" id="imagen_noticias" width="320" height="480"></canvas> </dav> <div class="progreso d-flex align-items-center justify-content-between"><progress value="0" max="100"></progress><span class="ml-2">0.0%</span></div></dav>'
6113 nelberth 1756
 
1757
		$(document).on("click", ".info_noticia", function(e){
1758
			imagenServidorNoticia = elemento.toDataURL("image/jpeg", 1.0);
6523 nelberth 1759
			$('.background').val(imagenServidorNoticia.split(',')[1]);
1760
            $('.imageType .file').val(imagenServidorNoticia.split(',')[1]);
6113 nelberth 1761
			$(".c1").addClass("paso");
1762
 
1763
 
1764
		})
6582 nelberth 1765
 
6556 nelberth 1766
		function iniciarEditor(campo, image=''){
6113 nelberth 1767
		 cortar=false;
1768
		recorte_listo=false;
1769
		texto="";
1770
		seis=true;
1771
		color="#ffffff";
1772
		texto_listo=false,siete=false;
1773
		uno=true;
1774
		size=48;
11038 nelberth 1775
        blockCelda=false;
6113 nelberth 1776
		cinco=true;
1777
		xf=320,yf =480;
1778
		negritas=false, bold="";
1779
		shadow = true, nueve=true;
1780
		italic=false, ita="";
1781
		rectangulo=false, diez=false;
1782
     	fontfamily="Arial";
1783
     	r=0,g=0,b=0,a=1;
1784
		window.clearInterval(editorNoticia);
1785
		setTimeout(function(){
1786
			scroll_altura=$(".articulo_noticia").offset().top-110;
1787
			anchoFondoOscuro = $(".articulo_noticia").width();
1788
			altoFondoOscuro = $(".editor_imagenes").height();
1789
			$(".fondo_oscuro").css("width",""+anchoFondoOscuro+"px");
1790
			$(".fondo_oscuro").css("height",""+altoFondoOscuro+"px");
1791
 
6556 nelberth 1792
		},navegacion(nuevoHtmlImagen,campo,image));
6113 nelberth 1793
 
1794
		}
8589 nelberth 1795
        var edit;
6113 nelberth 1796
		$(document).on("click", ".volver", function(){
1797
		var nombre_user = $(".perfil_u_nombre").text();
1798
		var primer_nombre = nombre_user.split(" ")[0];
1799
		 cortar=false;
11038 nelberth 1800
         blockCelda=false;
6113 nelberth 1801
		cinco=true;
1802
		recorte_listo=false;
1803
		texto="";
1804
		seis=true;
1805
		color="#ffffff";
1806
		texto_listo=false,siete=false;
1807
		uno=true;
1808
		size=48;
8589 nelberth 1809
        edit=false;
6113 nelberth 1810
		xf=320,yf =480;
1811
		negritas=false, bold="";
1812
		shadow = true, nueve=true;
1813
		italic=false, ita="";
1814
		rectangulo=false, diez=false;
1815
     	fontfamily="Arial";
1816
     	r=0,g=0,b=0,a=1;
1817
		 var imagenServidorNoticia;
6585 nelberth 1818
         console.log(seleccionarCampo)
6113 nelberth 1819
		window.clearInterval(editorNoticia);
1820
		setTimeout(function(){
1821
			scroll_altura=$(".articulo_noticia").offset().top-110;
1822
			anchoFondoOscuro = $(".articulo_noticia").width();
1823
			altoFondoOscuro = $(".editor_imagenes").height();
1824
			$(".fondo_oscuro").css("width",""+anchoFondoOscuro+"px");
1825
			$(".fondo_oscuro").css("height",""+altoFondoOscuro+"px");
1826
 
6584 nelberth 1827
		},navegacion(nuevoHtmlImagen,seleccionarCampo));
6113 nelberth 1828
 
1829
		})
8589 nelberth 1830
 
6574 nelberth 1831
		function navegacion(nuevoHtmlImagen,campo,image='',reload=true){
6581 nelberth 1832
                selectorElementoName=campo.find('#name')
6577 nelberth 1833
 
1834
                selectorElementoEditor=campo.find('#contenido');
8586 nelberth 1835
				edit=true;
6574 nelberth 1836
				if(image!=''){
8586 nelberth 1837
                    edit=false;
6113 nelberth 1838
					const getBase64FromUrl = async (url) => {
1839
						const data = await fetch(url);
1840
						const blob = await data.blob();
1841
						return new Promise((resolve) => {
1842
							const reader = new FileReader();
1843
							reader.readAsDataURL(blob);
1844
							reader.onloadend = function() {
1845
							const base64data = reader.result;
1846
							resolve(base64data);
1847
							}
1848
						});
1849
					}
1850
 
1851
					getBase64FromUrl(image).then(function(e){
6581 nelberth 1852
						selectorElementoName.trigger('change');
6113 nelberth 1853
						$(".volver").css("display","block")
1854
						$(".a1").addClass("paso");
1855
						$(".titulo_pasos").html("LABEL_STEP_2");
1856
						setTimeout(function(){
1857
							recorte_listo=true;
1858
							$(".fondo_oscuro").css("display","none");
1859
							$("#boton_recortar").removeClass("recortar").text("LABEL_SEND").addClass("info_noticia").attr('type','submit');
1860
							$(".recortar10").removeClass("recortar");
1861
							$(".canvas").removeClass("recortar");
1862
							$(".b1").addClass("paso");
1863
							$(".titulo_pasos").html("LABEL_STEP_3");
1864
							if(texto!=""){
1865
								seis=true;
1866
								siete=true;
1867
							}
1868
							cinco=true;
1869
							dos=true;
1870
							cuatro=true;
1871
							actualizar();
1872
 
1873
						},editorNoticia(e));
1874
 
1875
 
1876
					})
1877
 
1878
					setTimeout(function(){
1879
						$(".canvas_subir").html('<span class="icon-plus fa fa-spinner"></span> Cargando...')
6581 nelberth 1880
						selectorElementoName.trigger('change');
6577 nelberth 1881
					},selectorElementoEditor.html(nuevoHtmlImagen));
6113 nelberth 1882
				}else{
1883
					setTimeout(function(){
6581 nelberth 1884
					    selectorElementoName.trigger('change');
6577 nelberth 1885
					},selectorElementoEditor.html(nuevoHtmlImagen));
6113 nelberth 1886
				}
6574 nelberth 1887
 
6113 nelberth 1888
		}
1889
 
1890
		$(window).on("scroll", function(){
1891
			console.log(scroll_altura)
1892
		if($(window).scrollTop()>scroll_altura){
1893
			$("#cuadro_noticias").addClass("fixed");
1894
		}else{
1895
			$("#cuadro_noticias").removeClass("fixed");
1896
		}
1897
	})
11261 nelberth 1898
	$(window).resize(function() {
1899
		anchoFondoOscuro = $(".articulo_noticia").width();
1900
		altoFondoOscuro = $(".editor_imagenes").height();
1901
		$(".fondo_oscuro").css("width",""+anchoFondoOscuro+"px");
1902
		$(".fondo_oscuro").css("height",""+altoFondoOscuro+"px");
1903
		setTimeout(function(){
1904
			anchoFondoOscuro = $(".articulo_noticia").width();
1905
			altoFondoOscuro = $(".editor_imagenes").height();
1906
			$(".fondo_oscuro").css("width",""+anchoFondoOscuro+"px");
1907
			$(".fondo_oscuro").css("height",""+altoFondoOscuro+"px");
1908
		},300)
1909
 
1910
	});
6113 nelberth 1911
	$(document).on("dragover", "#imagen_noticia", function(e){
1912
		e.preventDefault();
1913
		e.stopPropagation();
1914
		$(this).css({"background":"rgba(0,0,0,.2)"})
1915
	})
1916
	$(document).on("drop", "#imagen_noticia", function(e){
1917
		e.preventDefault();
1918
		e.stopPropagation();
1919
		$(this).css("background", "none");
1920
		var archivo = e.originalEvent.dataTransfer.files;
1921
		var img=archivo[0];
1922
		if(img.type =="image/jpeg"||img.type =="image/png"){
1923
			$(".modificar").removeClass("animated");
1924
			var render = new FileReader();
1925
			render.readAsDataURL(img);
1926
			render.onload = function(e){
8354 nelberth 1927
				imagen2=new Image();
1928
				imagen2.src=e.target.result;
1929
 
1930
				$(imagen2).ready(function(e){
11031 nelberth 1931
					if(imagen2.width<320||imagen2.height<480){
8360 nelberth 1932
						$.fn.showError('LABEL_MINIMUM_IMAGE_SIZE');
8354 nelberth 1933
					}else{
1934
						$(".volver").css("display","block")
1935
						$(".a1").addClass("paso");
1936
						$(".titulo_pasos").html("LABEL_STEP_2");
1937
						editorNoticia(imagen2.src)
1938
					}
1939
				})
1940
			}
1941
		}else{
8360 nelberth 1942
			$.fn.showError('LABEL_SUPPORTED_FORMATS');
6113 nelberth 1943
		}
1944
	})
11031 nelberth 1945
    $(document).on("change", "#imagen_noticia_file", function(e){
1946
		file = $(this)[0].files[0];
1947
		e.preventDefault();
1948
		$(this).css("background", "none");
1949
		var archivo = file;
1950
		var img=file;
1951
		if(img.type =="image/jpeg"||img.type =="image/png"){
1952
			$(".modificar").removeClass("animated");
1953
			var render = new FileReader();
1954
			render.readAsDataURL(img);
1955
			render.onload = function(e){
1956
				imagen2=new Image();
1957
				imagen2.src=e.target.result;
1958
 
1959
				$(imagen2).ready(function(e){
1960
					if(imagen2.width<320||imagen2.height<480){
1961
						$.fn.showError('LABEL_MINIMUM_IMAGE_SIZE');
1962
					}else{
1963
						$(".volver").css("display","block")
1964
						$(".a1").addClass("paso");
1965
						$(".titulo_pasos").html("LABEL_STEP_2");
1966
						editorNoticia(imagen2.src)
1967
					}
1968
				})
1969
			}
1970
		}else{
1971
			$.fn.showError('LABEL_SUPPORTED_FORMATS');
1972
		}
1973
	})
6113 nelberth 1974
	$(document).on("dragover", "body", function(e){
1975
		e.preventDefault();
1976
		e.stopPropagation();
1977
	})
1978
	$(document).on("drop", "body", function(e){
1979
		e.preventDefault();
1980
		e.stopPropagation();
1981
	})
1982
 
1983
	var canvas='<div class="editorNoticia"><canvas id="editorNoticia">LABEL_NOT_SUPPORTED</canvas></div>';
1984
	$(document).on("mouseover", ".editorNoticia", function(){
12344 nelberth 1985
        const getScrollBarWidth = () => window.innerWidth - document.documentElement.getBoundingClientRect().width
1986
		let anchoScroll= getScrollBarWidth()+"px";
6113 nelberth 1987
		$("body").css({"overflow": "hidden"});
12344 nelberth 1988
		$(".cuadro_noticias, .fixed_noticia,.tituloEditor,.grid-padre,.subpanel").css("margin-right",anchoScroll )
1989
		$(".barra,.footer").css("padding-right",anchoScroll)
6113 nelberth 1990
 
12344 nelberth 1991
 
6113 nelberth 1992
 
1993
	})
1994
	$(document).on("mouseover", "#editorNoticia", function(){
1995
		if(recorte_listo){
1996
			ocho=true;
1997
		}
1998
	})
1999
	$(document).on("mouseout", "#editorNoticia", function(){
2000
		if(recorte_listo){
2001
			ocho=false;
2002
			actualizar2()
2003
		}
2004
	})
2005
	$(document).on("mouseout", ".editorNoticia",function(){
2006
		$("body").css({"overflow": "auto"})
2007
		$(".cuadro_noticias, .fixed_noticia,.tituloEditor,.grid-padre").css("margin-right", "0px")
2008
		$(".barra,.footer").css("padding-right","0px")
2009
 
2010
	})
2011
	$(document).on('mousewheel', ".editorNoticia",function(e){
2012
		var ruedita = e.originalEvent.wheelDelta
2013
		if(ruedita>0){
2014
			scale = scale+(scale/10);
2015
			$("#porciento_scale").html((scale*100).toFixed(2)+"%")
2016
		}else{
2017
			scale = scale-(scale/10);
2018
			$("#porciento_scale").html((scale*100).toFixed(2)+"%")
2019
		}
2020
		$("#editorNoticia").css({"transform": "scale("+scale+")"});
2021
	})
2022
	$(document).on("click", ".as", function(e){
2023
		e.preventDefault();
2024
		 scale = $(this).data("scale");
2025
		 $("#porciento_scale").html((scale*100).toFixed(2)+"%")
2026
		 $("#editorNoticia").css({"transform": "scale("+scale+")"});
2027
 
2028
	})
2029
	$(document).on("click", ".ps", function(e){
2030
		e.preventDefault();
2031
		$(".cantidades_scale").slideToggle(200).css("display", "block");
2032
	})
2033
	$(document).on("click", "#cerrar_filter_modal, .icon_filter", function(e){
2034
		e.preventDefault();
2035
		if(recorte_listo){
2036
		$(".contenido_filter").slideToggle(200).css("display", "block");
2037
		}
2038
	})
2039
	$(document).on("click", "#cerrar_text_modal, .icon_text", function(e){
2040
		e.preventDefault();
2041
		if(recorte_listo){
2042
			$(".contenido_text").slideToggle(200).css("display", "block");
2043
		}
2044
	})
2045
 
2046
	$(document).on("click", "#cerrar_cut_modal, .icon_cut", function(e){
2047
		e.preventDefault();
2048
		if(cortar){
2049
			$(".contenido_cut").slideToggle(200).css("display", "block");
2050
		}
2051
 
2052
	})
2053
	$(document).on("click", "#menos_scale", function(e){
2054
		e.preventDefault();
2055
		scale = scale-(scale/10);
2056
		 $("#porciento_scale").html((scale*100).toFixed(2)+"%")
2057
		 $("#editorNoticia").css({"transform": "scale("+scale+")"});
2058
	})
2059
 
2060
	$(document).on("click", "#mas_scale", function(e){
2061
		e.preventDefault();
2062
		scale = scale+(scale/10);
2063
		 $("#porciento_scale").html((scale*100).toFixed(2)+"%")
2064
		 $("#editorNoticia").css({"transform": "scale("+scale+")"});
2065
	})
11045 nelberth 2066
	$(document).on('change', '#selectFiltro', function(e){
2067
 
2068
		data=$(this).val()
2069
		if(data=="normal"){
2070
			filter();
2071
		}else{
2072
			data=data.split(',');
2073
			if(data[2]=='gris'){
2074
				filtergris(data[0],data[1]);
2075
			}else{
2076
				filter(Number(data[0]),Number(data[1]),Number(data[2]),Number(data[3]),Number(data[4]),Number(data[5]));
2077
			}
2078
		}
6113 nelberth 2079
	})
2080
	var texto_listo=false,siete=false;
2081
	var texto;
2082
	$(document).on("keyup", "#texto_input", function(e){
2083
		e.preventDefault();
2084
		texto = $(this).val();
2085
		if(texto_actualizar){
2086
			siete=true;
2087
		}
2088
		if(texto!=""){
2089
			texto_actualizar=true;
2090
			actualizar2();
2091
		}else{
2092
			actualizar2();
2093
		}
2094
 
2095
	})
2096
	var color="#ffffff";
11041 nelberth 2097
	$(document).on("change input", "#color", function(){
6113 nelberth 2098
    	color=$(this).val();
2099
    	seis=true;
2100
    	actualizar2();
2101
    })
11040 nelberth 2102
    $(document).on("keypress", "#font-size, #texto_input", function(e){
2103
    	if(e.which == 13){
2104
      		return false;
2105
    	}
2106
  	});
6113 nelberth 2107
    var size=48;
2108
    $(document).on("keyup change", "#font-size", function(){
2109
    	size=$(this).val();
2110
    	size = parseInt(size);
2111
    	seis=true;
2112
    	siete=true;
2113
    	actualizar2();
2114
    })
2115
    var negritas=false, bold="";
2116
    $(document).on("click", "#negritas", function(e){
2117
    	e.preventDefault();
2118
    	if(!negritas){
2119
    		bold="bold";
2120
    		$(this).addClass("fa");
2121
    		seis=true;
2122
    		siete=true;
2123
    		actualizar2();
2124
    		negritas=true;
2125
    	}else{
2126
    		bold="";
2127
    		$(this).removeClass("fa");
2128
    		seis=true;
2129
    		siete=true;
2130
    		actualizar2();
2131
    		negritas=false;
2132
    	}
2133
    })
2134
    var italic=false, ita="";
2135
     $(document).on("click", "#italic", function(e){
2136
    	e.preventDefault();
2137
    	if(!italic){
2138
    		ita="italic";
2139
    		$(this).addClass("fa");
2140
    		seis=true;
2141
    		siete=true;
2142
    		actualizar2();
2143
    		italic=true;
2144
    	}else{
2145
    		ita="";
2146
    		$(this).removeClass("fa");
2147
    		seis=true;
2148
    		siete=true;
2149
    		actualizar2();
2150
    		italic=false;
2151
    	}
2152
    })
11039 nelberth 2153
    var fontfamily="Arial";
2154
     $(document).on("change", "#selectFuente", function(e){
6113 nelberth 2155
    	e.preventDefault();
11039 nelberth 2156
    	fontfamily= $(this).val();
6113 nelberth 2157
    	seis=true;
2158
    	siete=true;
2159
    	actualizar2();
2160
 
2161
    })
2162
     var shadow = true, nueve=true;
2163
     $(document).on("click","#shadow", function(e){
2164
     	e.preventDefault();
2165
     	if(shadow){
2166
     		$(this).removeClass("fa");
2167
     		seis=true;
2168
     		nueve=false;
2169
     		actualizar2();
2170
     		shadow=false;
2171
     	}else{
2172
     		$(this).addClass("fa");
2173
     		seis=true;
2174
     		nueve=true;
2175
     		actualizar2();
2176
     		shadow=true;
2177
     	}
2178
 
2179
     })
2180
     var rectangulo=false, diez=false, colorrect="#000000";
2181
     $(document).on("click", "#rectangulo", function(e){
2182
     	e.preventDefault();
2183
     	if(!rectangulo){
2184
     		$(this).addClass("fa");
11042 nelberth 2185
			$('.color_fondo_cuadro').css('display','flex')
6113 nelberth 2186
     		diez=true;
2187
     		actualizar2();
2188
     		rectangulo=true;
2189
     	}else{
2190
     		$(this).removeClass("fa");
11042 nelberth 2191
			 $('.color_fondo_cuadro').css('display','none')
6113 nelberth 2192
     		diez=false;
2193
     		actualizar2();
2194
     		rectangulo=false;
2195
     	}
2196
 
2197
     })
2198
     var r=0,g=0,b=0;
11043 nelberth 2199
     $(document).on("change input", "#colorrect", function(){
6113 nelberth 2200
    	colorrect=$(this).val();
11043 nelberth 2201
    	r=parseInt(colorrect.slice(1,3),16);
2202
    	g=parseInt(colorrect.slice(3,5),16);
2203
    	b=parseInt(colorrect.slice(5,7),16);
6113 nelberth 2204
    	seis=true;
2205
    	actualizar2();
2206
    })
2207
    var a=1;
2208
 
11044 nelberth 2209
    $(document).on("mousemove change ", "#opacidad", function(){
6113 nelberth 2210
    	a=$(this).val();
2211
    	a=a/100;
2212
    	seis=true;
2213
    	actualizar2();
2214
    })
2215
	var imaNoti = new Image();
2216
	function filter(brillo=1, contraste=1, rojo=1, verde=1, azul=1, valor=1){
2217
		cuatro=false;
2218
		restaurar(brillo, contraste);
2219
		datos=imagenOriginal.data;
2220
		if(valor==2){
2221
			for (var i =  0; i <datos.length; i+=4) {
2222
				datos[i]=datos[i]+rojo;
2223
				datos[i+1]=datos[i+1]+verde;
2224
				datos[i+2]=datos[i+2]+azul;
2225
			}
2226
		}else{
2227
			for (var i =  0; i <datos.length; i+=4) {
2228
				datos[i]=datos[i]*rojo;
2229
				datos[i+1]=datos[i+1]*verde;
2230
				datos[i+2]=datos[i+2]*azul
2231
			}
2232
		}
2233
		editor.putImageData(imagenOriginal,0,0)
2234
		var imagenNoticia = elemento.toDataURL("image/jpeg", 1.0);
2235
	    imaNoti.src = imagenNoticia;
2236
		actualizar2();
2237
	}
2238
	function filtergris(brillo=1, contraste=1){
2239
		cuatro=false;
2240
		restaurar(brillo, contraste);
2241
		datos=imagenOriginal.data;
2242
		var auxiliar;
2243
		for (var i =  0; i <datos.length; i+=4) {
8356 nelberth 2244
			auxiliar = 0.34 * datos[i] + 0.5 *datos[i+1] + 0.1/6 * datos[i+2];
6113 nelberth 2245
			datos[i]=auxiliar;
2246
			datos[i+1]=auxiliar;
2247
			datos[i+2]=auxiliar;
2248
		}
2249
 
2250
		editor.putImageData(imagenOriginal,0,0)
2251
		var imagenNoticia = elemento.toDataURL("image/jpeg", 1.0);
2252
	    imaNoti.src = imagenNoticia;
2253
		actualizar2();
2254
	}
2255
	function restaurar(brillo = 1, contraste=1){
2256
		editor.filter = "none"
2257
		editor.filter = 'contrast('+contraste+') brightness('+brillo+') saturate(1) sepia(0)';
2258
		editor.fillStyle="rgba(255,255,255,1)"
2259
		editor.fillRect(0,0,ancho,alto);
2260
		editor.fillStyle=""+color+"";
2261
		var pxf=0,pyf=0;
2262
			if(xf>=(yf/recorte)){
2263
				pxf=xf/ancho;
2264
				pyf=yf/pxf;
2265
				py=(alto/2)-(pyf/2);
2266
				editor.drawImage(imagen,x,y,xf,yf,0,py,ancho,pyf);
2267
			}else{
2268
				pyf=yf/alto;
2269
				pxf=xf/pyf;
2270
				px=(ancho/2)-(pxf/2);
2271
				editor.drawImage(imagen,x,y,xf,yf,px,0,pxf,alto);
2272
			}
2273
		imagenOriginal = editor.getImageData(0,0,ancho,alto)
2274
	}
2275
	var ocho=false;
2276
	function actualizar2(){
2277
		if(recorte_listo){
2278
		if(cuatro){
2279
			imagenOriginal = editor.getImageData(0,0,ancho,alto)
2280
			var imagenNoticia = elemento.toDataURL("image/jpeg", 1.0);
2281
	    	imaNoti.src = imagenNoticia;
2282
	    	cuatro=false;
2283
		}
2284
		editor.filter = "none"
2285
		$(imaNoti).ready(function(e){
2286
			noticia.drawImage(imaNoti,0,0,320,480);
2287
			editor.drawImage(imaNoti,0,0,ancho,alto)
2288
			if(texto_actualizar){
2289
				if(texto!=""){
2290
					if(seis){
2291
						ancho_imaNoti = imaNoti.width;
2292
 
2293
						scale_noticia = -(((ancho_imaNoti-320)/ancho_imaNoti)-1);
2294
						editor.fillStyle=""+color+"";
2295
						editor.strokeStyle="rgb(255,255,255)";
2296
						if(nueve){
2297
							editor.shadowColor="rgba(0,0,0,.5)";
2298
							editor.shadowOffsetX=6;
2299
							editor.shadowOffsetY=6;
2300
							editor.shadowBlur=6;
2301
							noticia.shadowColor="rgba(0,0,0,.5)";
2302
							noticia.shadowOffsetX=6*scale_noticia;
2303
							noticia.shadowOffsetY=6*scale_noticia;
2304
							noticia.shadowBlur=6*scale_noticia;
2305
						}else{
2306
							editor.shadowColor="rgba(0,0,0,0)";
2307
							noticia.shadowColor="rgba(0,0,0,0)";
2308
						}
2309
						editor.font=""+ita+" "+bold+" "+size+"px "+fontfamily+"";
2310
						editor.textAlign="start";
2311
						editor.textBaseline="top";
2312
 
2313
						var sizeNoticia = size*scale_noticia;
2314
						noticia.fillStyle=""+color+"";
2315
						noticia.font=""+ita+" "+bold+" "+sizeNoticia+"px "+fontfamily+"";
2316
						noticia.textAlign="start";
2317
						noticia.textBaseline="top";
2318
						seis=false;
2319
					}
2320
					if(siete){
2321
						dimencionesTexto = editor.measureText(texto);
2322
						txf=dimencionesTexto.width+20;
2323
						tyf= (20+size);
2324
						siete=false;
2325
					}
2326
					if(cinco){
2327
						dimencionesTexto = editor.measureText(texto);
2328
						if(xf>=(yf/recorte)){
2329
							tx=(xf/2)-(dimencionesTexto.width/2);
2330
							ty=(xf*recorte/2)-(size/2);
2331
						}else{
2332
							tx=(yf/recorte/2)-(dimencionesTexto.width/2);
2333
							ty=(yf/2)-(size/2);
2334
						}
2335
 
2336
						txf=dimencionesTexto.width+20;
2337
						tyf= size+20;
2338
						cinco=false;
2339
					}
2340
					if(diez){
2341
						editor.fillStyle="rgba("+r+","+g+","+b+","+a+")";
2342
						noticia.fillStyle="rgba("+r+","+g+","+b+","+a+")";
2343
						editor.fillRect(tx-10,ty-10,txf,tyf);
2344
						noticia.fillRect(((tx-10)*scale_noticia),((ty-10)*scale_noticia),txf*scale_noticia,tyf*scale_noticia);
2345
						editor.fillStyle=""+color+"";
2346
						noticia.fillStyle=""+color+"";
2347
 
2348
					}
2349
					editor.fillText(texto,tx,ty);
2350
					noticia.fillText(texto,(tx*scale_noticia),ty*scale_noticia);
2351
					if(ocho){
2352
						editor.strokeRect(tx-10,ty-10,txf,tyf)
2353
						editor.arc(tx+txf,ty+tyf,10,0,Math.PI*2,false);
2354
						editor.fill();
2355
						editor.beginPath();
2356
					}
2357
					texto_listo=true;
2358
				}
2359
			}
2360
		})
2361
 
2362
	}
2363
	}
2364
	function actualizar(){
2365
			$(imagen).ready(function(e){
2366
				if(uno){
2367
					ancho=imagen.width, alto = imagen.height;
2368
					elemento.width = ancho;
2369
					elemento.height = alto;
2370
					$(".scale").css("display","flex");
2371
					if(ancho<=alto){
2372
					 scale = -(((alto-450)/alto)-1);
8357 nelberth 2373
 
2374
 
6113 nelberth 2375
					}else{
2376
					 scale = -(((ancho-500)/ancho)-1);
8357 nelberth 2377
 
6113 nelberth 2378
					}
11033 nelberth 2379
                    scale=scale*0.80;
8579 nelberth 2380
					if(edit){
2381
						if((ancho*recorte)<=alto){
2382
							xf=ancho*.70;
2383
							yf=xf*recorte;
2384
						}else{
2385
							yf=alto*.70;
2386
							xf=yf/recorte;
2387
						}
8357 nelberth 2388
					}
2389
					cuadro_dimencion=Math.round(12/scale);
2390
 
2391
					if(xf<50||yf<50){
2392
						xf=50;
2393
						yf=xf*recorte;
2394
					}
2395
					mitadX=ancho/2;
2396
					mitadY=alto/2;
2397
					x=mitadX-xf/2;
2398
					y=mitadY-yf/2;
2399
 
6113 nelberth 2400
					$("#porciento_scale").html((scale*100).toFixed(2)+"%")
2401
					$("#ancho").html(ancho+"px");
2402
					$("#alto").html(alto+"px");
2403
					uno=false;
2404
				}
2405
				if(dos){
2406
 
2407
					if(xf>=(yf/recorte)){
2408
						alto=xf*recorte;
2409
						ancho=xf;
2410
					}else{
2411
						ancho=yf/recorte;
2412
						alto=yf;
2413
 
2414
					}
2415
					elemento.width = ancho;
2416
					elemento.height = alto;
2417
					if(xf<=yf){
2418
					 scale = -(((yf-450)/yf)-1);
2419
 
2420
					}else{
2421
					 scale = -(((xf-500)/xf)-1);
2422
					}
2423
 
2424
					$("#porciento_scale").html((scale*100).toFixed(2)+"%")
2425
					$("#ancho").html(Math.round(xf)+"px");
2426
					$("#alto").html(Math.round(yf)+"px");
2427
					dos=false;
2428
				}
2429
 
2430
					var pxf=0,pyf=0;
2431
					noticia.fillStyle="rgba(255,255,255,1)"
2432
					noticia.fillRect(0,0,320,480);
2433
				if(xf>=(yf/recorte)){
2434
					pxf=xf/320;
2435
					pyf=yf/pxf;
2436
					py=(480/2)-(pyf/2);
2437
					noticia.drawImage(imagen,x,y,xf,yf,0,py,320,pyf);
2438
				}else{
2439
					pyf=yf/480;
2440
					pxf=xf/pyf;
2441
					px=(320/2)-(pxf/2);
2442
					noticia.drawImage(imagen,x,y,xf,yf,px,0,pxf,480);
2443
				}
2444
 
2445
				$("#editorNoticia").css({"transform": "scale("+scale+")"});
2446
				if(!recorte_listo){
2447
					editor.drawImage(imagen,0,0,ancho,alto);
2448
					editor.fillStyle="rgba(0,0,0,.2)"
2449
					editor.fillRect(0,0,ancho,alto);
8358 nelberth 2450
					editor.fillStyle="rgba(255,255,255,.2)"
6113 nelberth 2451
					editor.fillRect(x,y,xf,yf);
8358 nelberth 2452
					editor.fillStyle="rgba(255,255,255,0.8)"
8356 nelberth 2453
					editor.fillRect(x,y,cuadro_dimencion,cuadro_dimencion);
2454
					editor.fillRect((x+xf)-cuadro_dimencion,y,cuadro_dimencion,cuadro_dimencion);
2455
					editor.fillRect(x,y+yf-cuadro_dimencion,cuadro_dimencion,cuadro_dimencion);
2456
					editor.fillRect(x+xf-cuadro_dimencion,yf+y-cuadro_dimencion,cuadro_dimencion,cuadro_dimencion);
6113 nelberth 2457
					esta=true;
2458
				}else{
2459
					var pxf=0,pyf=0;
2460
 
2461
					editor.fillStyle="rgba(255,255,255,1)"
2462
					editor.fillRect(0,0,ancho,alto);
2463
					if(xf>=(yf/recorte)){
2464
						pxf=xf/ancho;
2465
						pyf=yf/pxf;
2466
						py=(alto/2)-(pyf/2);
2467
						editor.drawImage(imagen,x,y,xf,yf,0,py,ancho,pyf);
2468
					}else{
2469
						pyf=yf/alto;
2470
						pxf=xf/pyf;
2471
						px=(ancho/2)-(pxf/2);
2472
						editor.drawImage(imagen,x,y,xf,yf,px,0,pxf,alto);
2473
				}
2474
 
2475
				}
2476
			})
2477
		}
2478
	var imagenOriginal;
2479
	var x,y,xf=320,yf =480, elemento,editor,centro, total,scale,dimencionesTexto,ancho_imaNoti,
2480
	recorte_listo=false,alto,ancho,tx,ty,txf,tyf,cuatro=true,texto_actualizar=false,cinco=true,seis=true,cuatro;
2481
	var  mitadY,mitadX, uno=true,dos=false, recorte=480/320, imagen_noticias, scale_noticia, tres=true,rotar=false, cortar=false;;
8356 nelberth 2482
	var translateX, cuadro_dimencion;
6113 nelberth 2483
 
2484
	$(document).on("click", ".recortar10", function(e){
2485
 
2486
		e.preventDefault();
2487
		recorte_listo=false;
2488
		uno=true;
2489
		$(".fondo_oscuro").css("display","block");
2490
		$("#boton_recortar").addClass("recortar").text("Recortar").removeClass("info_noticia");
2491
		$("#boton_recortar3").addClass("recortar").text("Recortar").removeClass("info_noticia3");
2492
		$(".contenido_text").css("display", "none");
2493
		$(".contenido_filter").css("display", "none");
2494
		$(".recortar10").addClass("recortar");
2495
		$(".canvas").addClass("recortar")
2496
		$(".oa").removeClass("oa");
2497
		$("#normal").addClass("oa");
2498
		$(".b1").removeClass("paso");
2499
		$(".titulo_pasos").html("LABEL_STEP_2");
2500
		window.clearInterval(actualizar2);
2501
		actualizar();
2502
 
2503
	})
2504
 
2505
 
2506
	blockCelda=true;
2507
	$(document).on("click", "#blockCelda", function(e){
2508
		e.preventDefault();
2509
		if(blockCelda){
2510
			$(this).html('<span class="fa fa-unlock"></span>')
2511
 
2512
			blockCelda=false;
2513
		}else{
2514
			$(this).html('<span class="fa fa-lock"></span>')
2515
			blockCelda=true;
2516
		}
2517
		t4=true;
2518
 
2519
	})
2520
	var imagen
2521
	function editorNoticia(img){
2522
		 cortar=true;
2523
		imagen= new Image();
2524
		$(".canvas").html(canvas);
2525
		elemento = document.getElementById("editorNoticia");
2526
		editor = elemento.getContext("2d");
2527
		elemento2 = document.getElementById("imagen_noticias");
2528
		noticia = elemento2.getContext("2d");
2529
 
2530
		$(document).on("click", ".boton_marino.recortar",function(e){
2531
			e.preventDefault();
2532
			recorte_listo=true;
2533
			$(".fondo_oscuro").css("display","none");
2534
			$("#boton_recortar").removeClass("recortar").text("LABEL_SEND").addClass("info_noticia").attr('type','submit');
2535
			$(".recortar10").removeClass("recortar");
2536
			$(".canvas").removeClass("recortar");
2537
			$(".b1").addClass("paso");
2538
			$(".titulo_pasos").html("LABEL_STEP_3");
2539
			if(texto!=""){
2540
				seis=true;
2541
				siete=true;
2542
			}
2543
			cinco=true;
2544
			dos=true;
2545
			cuatro=true;
11253 nelberth 2546
			setTimeout(() => {
2547
				actualizar2();
2548
			}, actualizar());
6113 nelberth 2549
		})
2550
 
2551
		var cli = false, t1= false, t2=false,t3=false,t4=false,tcli=false;
2552
		var mouse =[];
2553
 
2554
 
2555
		function raton(elemento, e){
2556
			return {
2557
				x:((e.pageX - elemento.offsetLeft - ((ancho/2)-((ancho*scale)/2)))/scale),
2558
				y:((e.pageY - elemento.offsetTop - ((alto/2)-((alto*scale)/2)))/scale)
2559
			}
2560
		}
2561
 
2562
		imagen.src=img;
2563
		$(".recortar10").addClass("recortar");
2564
		$("#boton_recortar").removeClass("boton_normal").addClass("recortar boton_marino").text("LABEL_CUT")
2565
		actualizar();
2566
 
2567
		$(elemento).mousemove(function(e){
2568
			mouse = raton(this, e);
2569
			//console.log("raton x: "+mouse.x+ " raton Y: " +mouse.y+ " tx: "+tx+" ty: "+ty+" txf:"+(txf+tx)+" tyf:"+(tyf+ty) )
2570
			if(!recorte_listo){
8356 nelberth 2571
				if(x<mouse.x &&(xf+x)>mouse.x && y<mouse.y && (y+yf)>mouse.y){
2572
					if((xf+x-cuadro_dimencion)<mouse.x &&(xf+x)>mouse.x && (y+yf-cuadro_dimencion)<mouse.y && (y+yf)>mouse.y){
2573
			 			$(elemento).css("cursor","nw-resize");
2574
			 		}else if((xf+x-cuadro_dimencion)<mouse.x &&(xf+x)>mouse.x && y<mouse.y && (y+cuadro_dimencion)>mouse.y){
2575
			 			$(elemento).css("cursor","ne-resize");
2576
			 		}else if(x<mouse.x &&(cuadro_dimencion+x)>mouse.x && y<mouse.y && (y+cuadro_dimencion)>mouse.y){
2577
			 			$(elemento).css("cursor","se-resize");
2578
			 		}else if(x<mouse.x &&(cuadro_dimencion+x)>mouse.x && (y+yf-cuadro_dimencion)<mouse.y &&(y+yf)>mouse.y){
2579
			 			$(elemento).css("cursor","sw-resize");
2580
			 		}else{
2581
						$(elemento).css("cursor","move");
2582
					}
6113 nelberth 2583
			 	}else{
2584
			 		$(elemento).css("cursor","default");
2585
			 	}
2586
			}else if(texto_listo){
2587
				if(tx-10<mouse.x && tx-10+txf>mouse.x && ty-10<mouse.y && ty-10+tyf>mouse.y){
2588
			 		$(elemento).css("cursor","move");
2589
			 	}else if((txf+tx-10)<mouse.x &&(txf+tx-10+20)>mouse.x && (ty-10+tyf)<mouse.y && (ty-10+tyf+20)>mouse.y){
2590
			 		$(elemento).css("cursor","pointer");
2591
			 	}else{
2592
			 		$(elemento).css("cursor","default");
2593
			 	}
2594
			}
2595
			else{
2596
				$(elemento).css("cursor","default");
2597
			}
2598
		})
2599
		$(elemento).mousedown(function(e){
2600
			mouse = raton(this, e);
2601
			if(!recorte_listo){
8356 nelberth 2602
				if(x<mouse.x &&(xf+x)>mouse.x && y<mouse.y && (y+yf)>mouse.y){
2603
 
2604
                     if((xf+x-cuadro_dimencion)<mouse.x &&(xf+x)>mouse.x && (y+yf-cuadro_dimencion)<mouse.y && (y+yf)>mouse.y){
2605
                         t4 = true;
2606
                     }else if((xf+x-cuadro_dimencion)<mouse.x &&(xf+x)>mouse.x && y<mouse.y && (y+cuadro_dimencion)>mouse.y){
2607
                         t3 = true;
2608
                     }else if(x<mouse.x &&(cuadro_dimencion+x)>mouse.x && y<mouse.y && (y+cuadro_dimencion)>mouse.y){
2609
                         t1 = true;
2610
                     }else if(x<mouse.x &&(cuadro_dimencion+x)>mouse.x && (y+yf-cuadro_dimencion)<mouse.y &&(y+yf)>mouse.y){
2611
                         t2 = true;
2612
                     }else{
2613
                         cli = true;
2614
                     }
2615
                  }
6113 nelberth 2616
			}else if(texto_listo){
2617
				if(tx-10<mouse.x && tx-10+txf>mouse.x && ty-10<mouse.y && ty-10+tyf>mouse.y){
2618
			 		tcli=true;
2619
			 	}else if((txf+tx-10)<mouse.x &&(txf+tx-10+20)>mouse.x && (ty-10+tyf)<mouse.y && (ty-10+tyf+20)>mouse.y){
2620
			 		rotar=true;
2621
			 	}
2622
			}
2623
 
2624
		 })
2625
 
11033 nelberth 2626
		 $('.editorNoticia').mousemove(function(e){
6113 nelberth 2627
		 	mouse = raton(this, e);
2628
		 	if(!recorte_listo){
2629
			 	if(cli){
2630
			 		if((mouse.y-(yf/2))>=0&&(mouse.y+(yf/2))<=alto){
2631
				 		y = (mouse.y-(yf/2));
2632
			 		}else{
2633
			 			if((mouse.y-(yf/2))<0){
2634
			 				y=0;
2635
			 			}
2636
			 			if((mouse.y+(yf/2))>alto){
2637
			 				y=alto-yf;
2638
			 			}
2639
			 		}
2640
			 		if((mouse.x-(xf/2))>=0&&(mouse.x+(xf/2))<=ancho){
2641
			 			x = (mouse.x-(xf/2));
2642
			 		}else{
2643
			 			if((mouse.x-(xf/2))<0){
2644
			 				x=0;
2645
			 			}
2646
			 			if((mouse.x+(xf/2))>ancho){
2647
			 				x=(ancho)-xf;
2648
			 			}
2649
			 		}
2650
			 	}
11032 nelberth 2651
                 if(blockCelda){
6113 nelberth 2652
			 	if(t4){
11032 nelberth 2653
					cal1=mouse.y-y;
2654
			 		cal2=cal1/recorte;
2655
					cal3=x+cal2;
2656
					if(cal2>50){
2657
						if(cal3<=ancho&&mouse.y<=alto){
2658
							yf=cal1;
2659
				 			xf=cal2;
2660
						}else if(cal3<=ancho&&mouse.y>alto){
2661
							yf=alto-y;
2662
							xf=yf/recorte
2663
						}else if(cal3>=ancho&&mouse.y<=alto){
2664
							xf=ancho-x;
2665
							yf=xf*recorte;
2666
						}
2667
				 	}
2668
			 	}
2669
			 	if(t3){
2670
					cal1=yf+(y-mouse.y);
2671
			 		cal2=cal1/recorte;
2672
					cal3=x+cal2;
2673
					if(cal2>50){
2674
						if(cal3<=ancho&&mouse.y>=0){
2675
							yf=cal1;
2676
				 			xf=cal2;
2677
							y=mouse.y;
2678
						}else if(cal3<=ancho&&mouse.y<0){
2679
							yf=yf+y;
2680
							xf=yf/recorte
2681
							y=0;
11036 nelberth 2682
						}else if(cal3>=ancho&&mouse.y>=0){
11032 nelberth 2683
							xf=ancho-x;
2684
							y=y+(yf-xf*recorte);
2685
							yf=xf*recorte;
2686
						}
2687
 
2688
				 	}
2689
 
2690
			 	}
2691
			 	if(t2){
2692
 
11244 nelberth 2693
                    cal1=mouse.y-y;
2694
                    cal2=cal1/recorte;
2695
                    cal3=x+(yf-cal1)/recorte;cal2;
2696
                    if(cal2>50){
2697
                        if(cal3>=0&&mouse.y<=alto){
2698
                            x=cal3;
2699
                            yf=cal1;
2700
                            xf=cal2;
2701
                        }else if(cal3>0&&mouse.y>alto){
2702
                            yf=alto-y;
2703
                            x=x+(xf-yf/recorte);
2704
                            xf=yf/recorte
2705
                        }else if(cal3<0&&mouse.y<=alto){
2706
                            xf=xf+x;
2707
                            yf=xf*recorte;
2708
                            x=0;
2709
                        }
2710
                    }
2711
 
2712
                }
2713
                if(t1){
2714
                    cal0=y-mouse.y;
2715
                    cal1=yf+cal0;
2716
                    cal2=cal1/recorte;
2717
                    cal3=x-cal0/recorte;
2718
                    if(cal2>50){
2719
                        if(cal3>=0&&mouse.y>=0){
2720
                            yf=cal1;
2721
                            xf=cal2;
2722
                            x=cal3;
2723
                            y=mouse.y;
2724
                        }else if(cal3>0&&mouse.y<0){
2725
                            yf=yf+y;
2726
                            x=x+(xf-yf/recorte);
2727
                            xf=yf/recorte
2728
                            y=0;
2729
                        }else if(cal3<0&&mouse.y>=0){
2730
                            xf=xf+x;
2731
                            y=y+(yf-xf*recorte);
2732
                            yf=xf*recorte;
2733
                            x=0;
2734
                        }
2735
                    }
2736
 
2737
                }
11032 nelberth 2738
				}else{
2739
				if(t4){
2740
 
2741
					cal1=mouse.y-y;
2742
					cal2=mouse.x-x;
2743
					if(cal1>50){
2744
						yf=mouse.y<=alto?cal1:alto-y;
2745
				 	}
2746
					if(cal2>50){
2747
						xf=mouse.x<=ancho?cal2:ancho-x;
2748
					}
2749
			 	}
2750
 
2751
			 	if(t3){
2752
					cal1=yf-(mouse.y-y);
2753
					cal2=mouse.x-x;
2754
					if(cal1>50){
2755
 
2756
						if(mouse.y>=0){
2757
							yf=cal1;
2758
							y=mouse.y;
2759
						}else{
2760
							yf=yf+y;
2761
							y=0;
2762
						}
2763
				 	}
2764
					if(cal2>50){
2765
						xf=mouse.x<=ancho?cal2:ancho-x;
2766
					}
2767
			 	}
2768
				/* Izquierda abajo */
2769
			 	if(t2){
2770
					cal1=mouse.y-y;
2771
					cal2=xf-(mouse.x-x);
2772
					if(cal1>50){
2773
						yf=yf=mouse.y<=alto?cal1:alto-y;
2774
					}
2775
					if(cal2>50){
2776
						if(mouse.x>=0){
2777
							xf=cal2;
2778
							x=mouse.x;
2779
						}else{
2780
							xf=xf+x;
2781
							x=0;
2782
						}
2783
					}
2784
			 	}
2785
				/* izquierda arriba */
2786
			 	if(t1){
2787
 
2788
					cal1=yf-(mouse.y-y);
2789
					cal2=xf-(mouse.x-x);
2790
					if(cal1>50){
2791
 
2792
						if(mouse.y>=0){
2793
							yf=cal1;
2794
							y=mouse.y;
2795
						}else{
2796
							yf=yf+y;
2797
							y=0;
2798
						}
2799
				 	}
2800
					if(cal2>50){
2801
						if(mouse.x>=0){
2802
							xf=cal2;
2803
							x=mouse.x;
2804
						}else{
2805
							xf=xf+x;
2806
							x=0;
2807
						}
2808
					}
2809
 
2810
			 	}
11035 nelberth 2811
				}
6113 nelberth 2812
 
2813
		 	actualizar();
2814
		 	}else if(texto_listo){
2815
		 		if(tcli){
2816
		 			tx=mouse.x-(txf/2)
2817
		 			ty=mouse.y-(tyf/2)
2818
		 		}else if(rotar){
2819
 
2820
		 		}
2821
 
2822
		 		actualizar2();
2823
		 	}
2824
		 })
11034 nelberth 2825
		 $('body').mouseup(function(e){
6113 nelberth 2826
		 	if(!recorte_listo){
2827
			 	cli=false;
2828
			 	t1=false;
2829
			 	t2=false;
2830
			 	t3=false;
2831
			 	t4=false;
2832
		 	}else if (texto_listo) {
2833
		 		tcli=false;
2834
		 	}
2835
		 })
2836
 
2837
 
2838
	}
2839
	/* Titulo */
2840
 
2841
var titulo_noticia, censor_titulo = true, numero_titulo=0;
2842
	$(document).on("keyup change", "#name", function(e){
2843
	console.log(numero_titulo)
2844
	titulo_noticia = $(this).val();
2845
	titulo_elemento= $(".titulo_topico");
2846
	if(titulo_noticia!=""){
2847
		if(censor_titulo){
2848
			titulo_elemento.html(titulo_noticia);
2849
			if(titulo_elemento.height()>38){
2850
				var titulo_noticia2 = "";
2851
				for(var i =0; i <titulo_noticia.length;i++){
2852
					titulo_noticia2 = titulo_noticia2 + titulo_noticia.split("")[i];
2853
					titulo_elemento.html(titulo_noticia2);
2854
					if(titulo_elemento.height()>38){
2855
						titulo_noticia2 = titulo_noticia2.slice(0,-5) + "...";
2856
						titulo_elemento.html(titulo_noticia2);
2857
						numero_titulo = titulo_noticia2.length;
2858
						censor_titulo=false;
2859
						break;
2860
					}
2861
 
2862
				}
2863
			}else{
2864
				numero_titulo=0;
2865
			}
2866
		}else{
2867
			if(numero_titulo+1>=titulo_noticia.length){
2868
				titulo_elemento.html(titulo_noticia);
2869
				censor_titulo=true;
2870
			}
2871
		}
2872
	}else{
6675 nelberth 2873
		titulo_elemento.html("LABEL_TITLE");
6113 nelberth 2874
		censor_titulo = true;
2875
	}
2876
})
2877
 
1 www 2878
});
2879
JS;
2880
$this->inlineScript()->captureEnd();
2881
?>
2882
 
2883
 
2884
<!-- Content Header (Page header) -->
2885
<section class="content-header">
2886
	<div class="container-fluid">
2887
    	<div class="row mb-2">
2888
        	<div class="col-sm-12">
2889
            	<h1>LABEL_SLIDES</h1>
2890
			</div>
2891
		</div>
2892
	</div><!-- /.container-fluid -->
2893
</section>
2894
 
6122 nelberth 2895
<section class="content" id='content1'>
1 www 2896
	<div class="container-fluid">
2897
    	<div class="row">
2898
        	<div class="col-12">
2899
				<div class="card">
2900
					<div class="card-header">
2901
						<?php
2902
                        $form = $this->form;
2903
            	        $form->setAttributes([
2904
                            'name'    => 'form-filter',
2905
                            'id'      => 'form-filter',
2906
                        ]);
2907
 
2908
                        $form->prepare();
2909
                        echo $this->form()->openTag($form);
2910
                        ?>
2911
                        <div class="row">
2912
                            <div class="col-md-6 col-sm-12">
2913
                                <div class="form-group">
2914
                                    <?php
2915
                                        $element = $form->get('topic_uuid');
2916
 
2917
                                        $element->setOptions(['label' => 'LABEL_TOPIC']);
2918
 
2919
                                        $element->setAttributes(['class' => 'form-control']);
2920
                                        echo $this->formLabel($element);
2921
                                        echo $this->formSelect($element);
2922
                                    ?>
2923
                                </div>
2924
                            </div>
2925
                            <div class="col-md-6 col-sm-12">
2926
                                <div class="form-group">
2927
                                    <?php
2928
                                        $element = $form->get('capsule_uuid');
2929
                                        $element->setOptions(['label' => 'LABEL_CAPSULE']);
2930
                                        $element->setAttributes(['class' => 'form-control']);
2931
                                        echo $this->formLabel($element);
2932
                                        echo $this->formSelect($element);
2933
                                    ?>
2934
                                </div>
2935
                            </div>
2936
                        </div>
2937
						<?php echo $this->form()->closeTag($form); ?>
2938
					</div>
2939
					<div class="card-body">
20 steven 2940
        	    		<table id="gridTable" class="table   table-hover">
1 www 2941
                      		<thead>
2942
        						<tr>
2943
                                	<th>LABEL_NAME</th>
2944
                                  	<th>LABEL_DETAILS</th>
2945
                                  	<th>LABEL_MEDIA</th>
2946
                                  	<th>LABEL_ACTIONS</th>
2947
                                </tr>
2948
                       		</thead>
2949
                         	<tbody>
2950
                         	</tbody>
2951
                    	</table>
2952
                   	</div>
2953
                   	<div class="card-footer clearfix">
2954
                   		<div style="float:right;">
2955
							<button type="button" class="btn btn-info btn-refresh"><i class="fa fa-refresh"></i> LABEL_REFRESH  </button>
2956
							<?php if($allowAdd) : ?>
2957
							<button type="button" class="btn btn-primary btn-add"><i class="fa fa-plus"></i> LABEL_ADD </button>
2958
							<?php endif; ?>
2959
						</div>
2960
                 	</div>
2961
          		</div>
2962
           	</div>
2963
        </div>
2964
 	</div>
2965
</section>
2966
 
2967
 
2968
 
2969
<!-- The Modal -->
6531 nelberth 2970
<div  id="company-microlearning-slide-text-add-box" style='display:none'>
6528 nelberth 2971
 
1 www 2972
    		<?php
2973
    	    $form = $this->formTextAdd;
2974
    	    $form->setAttributes([
2975
    	       'method'    => 'post',
2976
    	       'name'      => 'form-slide-text-add',
2977
    	       'id'        => 'form-slide-text-add'
2978
    	    ]);
2979
    	    $form->prepare();
2980
    	    echo $this->form()->openTag($form);
2981
 
2982
    	    $element = $form->get('type');
2983
    	    echo $this->formHidden($element);
2984
 
2985
    	    ?>
2986
 
6528 nelberth 2987
            <div class="d-flex justify-content-center tituloEditor">
6590 nelberth 2988
              <h4>LABEL_ADD_TEXT_SLIDE</h4>
6528 nelberth 2989
 
2990
             </div>
2991
 
2992
 
2993
            <div class="grid-padre">
2994
				<div class="form-group grid-1-2">
1 www 2995
    				<?php
2996
                        $element = $form->get('name');
2997
                        $element->setAttributes(['class' => 'form-control']);
2998
                        $element->setOptions(['label' => 'LABEL_NAME']);
2999
                        echo $this->formLabel($element);
3000
                        echo $this->formText($element);
3001
                    ?>
3002
				</div>
6528 nelberth 3003
                <div class="form-group grid-1-2">
1 www 3004
                	<?php
3005
                    $element = $form->get('description');
3006
                    $element->setOptions(['label' => 'LABEL_DESCRIPTION']);
6600 nelberth 3007
                    $element->setAttributes(['id' => 'description_add', 'rows' => '2',  'class' => 'form-control']);
1 www 3008
                    echo $this->formLabel($element);
3009
                    echo $this->formTextArea($element);
3010
                    ?>
3011
   				</div>
6528 nelberth 3012
				<div class="form-group grid-1-2">
1 www 3013
    				<?php
3014
                        $element = $form->get('order');
3015
                        $element->setAttributes(['class' => 'form-control']);
3016
                        $element->setOptions(['label' => 'LABEL_ORDER']);
3017
                        echo $this->formLabel($element);
3018
                        echo $this->formText($element);
3019
                    ?>
3020
				</div>
6529 nelberth 3021
                <?php
3022
                    $element = $form->get('background');
3023
					$element->setAttributes([ 'class' => 'background']);
3024
                    echo $this->formHidden($element);
3025
                ?>
6543 nelberth 3026
				<div class="contenido form-group " id="contenido"></div>
6529 nelberth 3027
 
1 www 3028
      		</div>
3029
 
3030
          	<?php echo $this->form()->closeTag($form); ?>
6528 nelberth 3031
 
1 www 3032
</div>
3033
 
3034
 
3035
 
3036
 
3037
<!-- The Modal -->
6596 nelberth 3038
<div id="company-microlearning-slide-text-edit-box" style='display:none'>
6595 nelberth 3039
            <?php
1 www 3040
    	    $form = $this->formTextEdit;
3041
    	    $form->setAttributes([
3042
    	       'method'    => 'post',
3043
    	       'name'      => 'form-slide-text-edit',
3044
    	       'id'        => 'form-slide-text-edit'
3045
    	    ]);
3046
    	    $form->prepare();
3047
    	    echo $this->form()->openTag($form);
3048
 
3049
    	    $element = $form->get('type');
3050
    	    echo $this->formHidden($element);
3051
 
6595 nelberth 3052
    	    ?>
3053
            <div class="d-flex justify-content-center tituloEditor">
3054
              <h4>LABEL_EDIT_TEXT_SLIDE</h4>
1 www 3055
 
6595 nelberth 3056
             </div>
3057
 
3058
 
3059
            <div class="grid-padre">
3060
				<div class="form-group grid-1-2">
1 www 3061
    				<?php
3062
                        $element = $form->get('name');
3063
                        $element->setAttributes(['class' => 'form-control']);
3064
                        $element->setOptions(['label' => 'LABEL_NAME']);
3065
                        echo $this->formLabel($element);
3066
                        echo $this->formText($element);
3067
                    ?>
3068
				</div>
6595 nelberth 3069
                <div class="form-group grid-1-2">
1 www 3070
                	<?php
3071
                    $element = $form->get('description');
3072
                    $element->setOptions(['label' => 'LABEL_DESCRIPTION']);
6600 nelberth 3073
                    $element->setAttributes(['id' => 'description_edit', 'rows' => '2',  'class' => 'form-control']);
1 www 3074
                    echo $this->formLabel($element);
3075
                    echo $this->formTextArea($element);
3076
                    ?>
3077
   				</div>
6595 nelberth 3078
				<div class="form-group grid-1-2">
1 www 3079
    				<?php
3080
                        $element = $form->get('order');
3081
                        $element->setAttributes(['class' => 'form-control']);
3082
                        $element->setOptions(['label' => 'LABEL_ORDER']);
3083
                        echo $this->formLabel($element);
3084
                        echo $this->formText($element);
3085
                    ?>
3086
				</div>
6595 nelberth 3087
                <?php
3088
                    $element = $form->get('background');
3089
					$element->setAttributes([ 'class' => 'background']);
3090
                    echo $this->formHidden($element);
3091
                ?>
3092
				<div class="contenido form-group " id="contenido"></div>
3093
 
1 www 3094
      		</div>
3095
 
3096
          	<?php echo $this->form()->closeTag($form); ?>
6595 nelberth 3097
 
1 www 3098
</div>
3099
 
3100
 
3101
 
3102
<!-- The Modal -->
6523 nelberth 3103
<div class='imageType'  id="company-microlearning-slide-image-add-box" style='display:none' >
1 www 3104
    		<?php
3105
    	    $form = $this->formImageAdd;
3106
    	    $form->setAttributes([
3107
    	       'method'    => 'post',
3108
    	        'name'      => 'form-slide-image-add',
3109
    	        'id'        => 'form-slide-image-add'
3110
    	    ]);
3111
    	    $form->prepare();
3112
    	    echo $this->form()->openTag($form);
3113
 
3114
    	    $element = $form->get('type');
3115
    	    echo $this->formHidden($element);
3116
 
3117
    	    ?>
3118
            <!-- Modal Header -->
6126 nelberth 3119
            <div class="d-flex justify-content-center tituloEditor">
6131 nelberth 3120
              <h4>LABEL_ADD_IMAGE_SLIDE</h4>
1 www 3121
 
6126 nelberth 3122
             </div>
3123
 
1 www 3124
            <!-- Modal body -->
6126 nelberth 3125
            <div class="grid-padre">
6140 nelberth 3126
                 <div class="form-group grid-1-2">
1 www 3127
    				<?php
3128
                        $element = $form->get('name');
3129
                        $element->setAttributes(['class' => 'form-control']);
3130
                        $element->setOptions(['label' => 'LABEL_NAME']);
3131
                        echo $this->formLabel($element);
3132
                        echo $this->formText($element);
3133
                    ?>
3134
				</div>
6142 nelberth 3135
 
6137 nelberth 3136
 
6134 nelberth 3137
                <?php
3138
                    $element = $form->get('file');
3139
					$element->setAttributes([ 'class' => 'file']);
3140
                    echo $this->formHidden($element);
3141
                ?>
6129 nelberth 3142
				<div class="form-group grid-1-2">
1 www 3143
    				<?php
3144
                        $element = $form->get('order');
3145
                        $element->setAttributes(['class' => 'form-control']);
3146
                        $element->setOptions(['label' => 'LABEL_ORDER']);
3147
                        echo $this->formLabel($element);
3148
                        echo $this->formText($element);
3149
                    ?>
3150
				</div>
6544 nelberth 3151
                <div class="contenido form-group " id="contenido"></div>
1 www 3152
      		</div>
3153
 
6125 nelberth 3154
 
1 www 3155
          	<?php echo $this->form()->closeTag($form); ?>
3156
</div>
3157
 
6523 nelberth 3158
<div class='imageType' id="company-microlearning-slide-image-edit-box" style='display:none' >
6505 nelberth 3159
            <?php
3160
    	    $form = $this->formImageEdit;
3161
    	    $form->setAttributes([
3162
    	       'method'    => 'post',
3163
    	       'name'      => 'form-slide-image-edit',
3164
    	       'id'        => 'form-slide-image-edit'
3165
    	    ]);
3166
    	    $form->prepare();
3167
    	    echo $this->form()->openTag($form);
3168
 
3169
    	    $element = $form->get('type');
3170
    	    echo $this->formHidden($element);
3171
 
3172
    	    ?>
3173
            <!-- Modal Header -->
3174
            <div class="d-flex justify-content-center tituloEditor">
3175
              <h4>LABEL_EDIT_IMAGE_SLIDE</h4>
3176
 
3177
             </div>
3178
 
3179
            <!-- Modal body -->
3180
            <div class="grid-padre">
3181
                 <div class="form-group grid-1-2">
3182
    				<?php
3183
                        $element = $form->get('name');
3184
                        $element->setAttributes(['class' => 'form-control']);
3185
                        $element->setOptions(['label' => 'LABEL_NAME']);
3186
                        echo $this->formLabel($element);
3187
                        echo $this->formText($element);
3188
                    ?>
3189
				</div>
3190
 
3191
 
3192
                <?php
3193
                    $element = $form->get('file');
3194
					$element->setAttributes([ 'class' => 'file']);
3195
                    echo $this->formHidden($element);
3196
                ?>
3197
				<div class="form-group grid-1-2">
3198
    				<?php
3199
                        $element = $form->get('order');
3200
                        $element->setAttributes(['class' => 'form-control']);
3201
                        $element->setOptions(['label' => 'LABEL_ORDER']);
3202
                        echo $this->formLabel($element);
3203
                        echo $this->formText($element);
3204
                    ?>
3205
				</div>
6625 nelberth 3206
 
6569 nelberth 3207
                <div class="contenido form-group " id="contenido"></div>
6505 nelberth 3208
      		</div>
1 www 3209
 
6505 nelberth 3210
 
3211
          	<?php echo $this->form()->closeTag($form); ?>
3212
</div>
1 www 3213
 
3214
 
3215
<!-- The Modal -->
6523 nelberth 3216
 
1 www 3217
 
3218
 
3219
 
3220
<!-- The Modal -->
6618 nelberth 3221
<div  id="company-microlearning-slide-video-add-box"  style='display:none'>
3222
 
1 www 3223
    		<?php
3224
    	    $form = $this->formVideoAdd;
3225
    	    $form->setAttributes([
3226
    	       'method'    => 'post',
3227
    	        'name'      => 'form-slide-video-add',
3228
    	        'id'        => 'form-slide-video-add'
3229
    	    ]);
3230
    	    $form->prepare();
3231
    	    echo $this->form()->openTag($form);
3232
 
3233
    	    $element = $form->get('type');
3234
    	    echo $this->formHidden($element);
3235
 
3236
    	    ?>
6618 nelberth 3237
 
3238
              <div class="d-flex justify-content-center tituloEditor">
3239
              <h4>LABEL_ADD_VIDEO_SLIDE</h4>
1 www 3240
 
6618 nelberth 3241
             </div>
3242
            <div class="grid-padre">
3243
				<div class="form-group  grid-1-2">
1 www 3244
    				<?php
3245
                        $element = $form->get('name');
3246
                        $element->setAttributes(['class' => 'form-control']);
3247
                        $element->setOptions(['label' => 'LABEL_NAME']);
3248
                        echo $this->formLabel($element);
3249
                        echo $this->formText($element);
3250
                    ?>
3251
				</div>
6618 nelberth 3252
				<div class="form-group  grid-1-2">
1 www 3253
    				<?php
3254
                        $element = $form->get('order');
3255
                        $element->setAttributes(['class' => 'form-control']);
3256
                        $element->setOptions(['label' => 'LABEL_ORDER']);
3257
                        echo $this->formLabel($element);
3258
                        echo $this->formText($element);
3259
                    ?>
3260
				</div>
6618 nelberth 3261
				<div class="form-group  grid-1-2">
1 www 3262
 
3263
                 		<?php
3264
                        $element = $form->get('file');
3265
                        $element->setAttributes(['class' => 'form-control']);
3266
                        $element->setOptions(['label' => 'LABEL_VIDEO']);
3267
                        $element->setAttributes(['accept' => 'video/webm,video/mpeg,video/mp4']);
3268
                        echo $this->formLabel($element);
3269
                        ?>
3270
                        <div class="file-loading">
3271
                        <?php echo $this->formFile($element);?>
3272
                        </div>
3273
 
3274
          		</div>
6625 nelberth 3275
                  <?php
3276
                    $element = $form->get('background');
3277
					$element->setAttributes([ 'class' => 'background']);
6844 nelberth 3278
                    echo $this->formHidden($element);
6625 nelberth 3279
                ?>
6618 nelberth 3280
          		<div class="contenido form-group " id="contenido"></div>
1 www 3281
      		</div>
3282
 
3283
            <!-- Modal footer -->
6618 nelberth 3284
 
1 www 3285
          	<?php echo $this->form()->closeTag($form); ?>
6618 nelberth 3286
 
1 www 3287
</div>
3288
 
3289
 
3290
 
3291
 
3292
<!-- The Modal -->
6646 nelberth 3293
<div  id="company-microlearning-slide-video-edit-box"  style='display:none'>
6644 nelberth 3294
 
1 www 3295
        	<?php
3296
    	    $form = $this->formVideoEdit;
3297
    	    $form->setAttributes([
3298
    	       'method'    => 'post',
3299
    	       'name'      => 'form-slide-video-edit',
3300
    	       'id'        => 'form-slide-video-edit'
3301
    	    ]);
3302
    	    $form->prepare();
3303
    	    echo $this->form()->openTag($form);
3304
 
3305
    	    $element = $form->get('type');
3306
    	    echo $this->formHidden($element);
3307
 
3308
    	    ?>
3309
 
6654 nelberth 3310
 
3311
              <div class="d-flex justify-content-center tituloEditor">
3312
              <h4>LABEL_EDIT_VIDEO_SLIDE</h4>
1 www 3313
 
6654 nelberth 3314
             </div>
3315
 
6643 nelberth 3316
            <!-- Modal body -->
6644 nelberth 3317
            <div class="grid-padre">
6645 nelberth 3318
				<div class="form-group grid-1-2">
1 www 3319
    				<?php
3320
                        $element = $form->get('name');
3321
                        $element->setAttributes(['class' => 'form-control']);
3322
                        $element->setOptions(['label' => 'LABEL_NAME']);
3323
                        echo $this->formLabel($element);
3324
                        echo $this->formText($element);
3325
                    ?>
3326
				</div>
6645 nelberth 3327
				<div class="form-group grid-1-2">
1 www 3328
    				<?php
3329
                        $element = $form->get('order');
3330
                        $element->setAttributes(['class' => 'form-control']);
3331
                        $element->setOptions(['label' => 'LABEL_ORDER']);
3332
                        echo $this->formLabel($element);
3333
                        echo $this->formText($element);
3334
                    ?>
3335
				</div>
6645 nelberth 3336
				<div class="form-group grid-1-2">
6643 nelberth 3337
 
1 www 3338
                 		<?php
3339
                        $element = $form->get('file');
3340
                        $element->setAttributes(['class' => 'form-control']);
3341
                        $element->setOptions(['label' => 'LABEL_VIDEO']);
3342
                        $element->setAttributes(['accept' => 'video/webm,video/mpeg,video/mp4']);
3343
                        echo $this->formLabel($element);
3344
                        ?>
3345
                        <div class="file-loading">
3346
                        <?php echo $this->formFile($element);?>
3347
                        </div>
6643 nelberth 3348
 
1 www 3349
          		</div>
6645 nelberth 3350
          		<?php
3351
                    $element = $form->get('background');
3352
					$element->setAttributes([ 'class' => 'background']);
3353
                    echo $this->formHidden($element);
3354
                ?>
3355
          		<div class="contenido form-group " id="contenido"></div>
1 www 3356
      		</div>
6643 nelberth 3357
 
6644 nelberth 3358
 
6643 nelberth 3359
          	<?php echo $this->form()->closeTag($form); ?>
6644 nelberth 3360
 
1 www 3361
</div>
3362
 
3363
 
3364
 
3365
 
3366
<!-- The Modal -->
6655 nelberth 3367
<div id="company-microlearning-slide-document-add-box" style='display:none'>
6654 nelberth 3368
 
1 www 3369
    		<?php
3370
    	    $form = $this->formDocumentAdd;
3371
    	    $form->setAttributes([
3372
    	       'method'    => 'post',
3373
    	        'name'      => 'form-slide-document-add',
3374
    	        'id'        => 'form-slide-document-add'
3375
    	    ]);
3376
    	    $form->prepare();
3377
    	    echo $this->form()->openTag($form);
3378
 
3379
    	    $element = $form->get('type');
3380
    	    echo $this->formHidden($element);
3381
 
3382
    	    ?>
6654 nelberth 3383
 
3384
              <div class="d-flex justify-content-center tituloEditor">
3385
              <h4>LABEL_ADD_DOCUMENT_SLIDE</h4>
1 www 3386
 
6654 nelberth 3387
             </div>
1 www 3388
            <!-- Modal body -->
6654 nelberth 3389
            <div class="grid-padre">
3390
				<div class="form-group  grid-1-2">
1 www 3391
    				<?php
3392
                        $element = $form->get('name');
3393
                        $element->setAttributes(['class' => 'form-control']);
3394
                        $element->setOptions(['label' => 'LABEL_NAME']);
3395
                        echo $this->formLabel($element);
3396
                        echo $this->formText($element);
3397
                    ?>
3398
				</div>
6654 nelberth 3399
				<div class="form-group  grid-1-2">
1 www 3400
    				<?php
3401
                        $element = $form->get('order');
3402
                        $element->setAttributes(['class' => 'form-control']);
3403
                        $element->setOptions(['label' => 'LABEL_ORDER']);
3404
                        echo $this->formLabel($element);
3405
                        echo $this->formText($element);
3406
                    ?>
3407
				</div>
6654 nelberth 3408
				<div class="form-group  grid-1-2">
1 www 3409
 
3410
                 		<?php
3411
                        $element = $form->get('file');
3412
                        $element->setAttributes(['class' => 'form-control']);
3413
                        $element->setOptions(['label' => 'LABEL_DOCUMENT']);
3414
                        $element->setAttributes(['accept' => 'application/pdf']);
3415
                        echo $this->formLabel($element);
3416
                        ?>
3417
                        <div class="file-loading">
3418
                        <?php echo $this->formFile($element);?>
3419
                        </div>
3420
 
3421
          		</div>
6654 nelberth 3422
                  <?php
3423
                    $element = $form->get('background');
3424
					$element->setAttributes([ 'class' => 'background']);
3425
                    echo $this->formHidden($element);
3426
                ?>
3427
          		<div class="contenido form-group " id="contenido"></div>
1 www 3428
      		</div>
3429
 
3430
            <!-- Modal footer -->
6654 nelberth 3431
 
1 www 3432
          	<?php echo $this->form()->closeTag($form); ?>
6656 nelberth 3433
 
1 www 3434
</div>
3435
 
3436
 
3437
 
3438
 
3439
<!-- The Modal -->
6655 nelberth 3440
<div id="company-microlearning-slide-document-edit-box" style='display:none'>
6654 nelberth 3441
 
1 www 3442
    		<?php
3443
    	    $form = $this->formDocumentEdit;
3444
    	    $form->setAttributes([
3445
    	       'method'    => 'post',
3446
    	       'name'      => 'form-slide-document-edit',
3447
    	       'id'        => 'form-slide-document-edit'
3448
    	    ]);
3449
    	    $form->prepare();
3450
    	    echo $this->form()->openTag($form);
3451
 
3452
    	    $element = $form->get('type');
3453
    	    echo $this->formHidden($element);
3454
 
3455
    	    ?>
3456
            <!-- Modal Header -->
6654 nelberth 3457
 
3458
              <div class="d-flex justify-content-center tituloEditor">
3459
              <h4>LABEL_EDIT_DOCUMENT_SLIDE</h4>
1 www 3460
 
6654 nelberth 3461
             </div>
1 www 3462
            <!-- Modal body -->
6654 nelberth 3463
            <div class="grid-padre">
3464
				<div class="form-group  grid-1-2">
1 www 3465
    				<?php
3466
                        $element = $form->get('name');
3467
                        $element->setAttributes(['class' => 'form-control']);
3468
                        $element->setOptions(['label' => 'LABEL_NAME']);
3469
                        echo $this->formLabel($element);
3470
                        echo $this->formText($element);
3471
                    ?>
3472
				</div>
6654 nelberth 3473
				<div class="form-group  grid-1-2">
1 www 3474
    				<?php
3475
                        $element = $form->get('order');
3476
                        $element->setAttributes(['class' => 'form-control']);
3477
                        $element->setOptions(['label' => 'LABEL_ORDER']);
3478
                        echo $this->formLabel($element);
3479
                        echo $this->formText($element);
3480
                    ?>
3481
				</div>
6654 nelberth 3482
				<div class="form-group  grid-1-2">
1 www 3483
 
3484
                 		<?php
3485
                        $element = $form->get('file');
3486
                        $element->setAttributes(['class' => 'form-control']);
3487
                        $element->setOptions(['label' => 'LABEL_DOCUMENT']);
3488
                        $element->setAttributes(['accept' => 'application/pdf']);
3489
                        echo $this->formLabel($element);
3490
                        ?>
3491
                        <div class="file-loading">
3492
                        <?php echo $this->formFile($element);?>
3493
                        </div>
3494
 
3495
          		</div>
6654 nelberth 3496
 
3497
          		<?php
3498
                    $element = $form->get('background');
3499
					$element->setAttributes([ 'class' => 'background']);
3500
                    echo $this->formHidden($element);
3501
                ?>
3502
          		<div class="contenido form-group " id="contenido"></div>
1 www 3503
      		</div>
3504
 
3505
            <!-- Modal footer -->
6654 nelberth 3506
 
1 www 3507
          	<?php echo $this->form()->closeTag($form); ?>
6656 nelberth 3508
 
1 www 3509
</div>
3510
 
3511
 
3512
 
3513
<!-- The Modal -->
6655 nelberth 3514
<div  id="company-microlearning-slide-audio-add-box" style='display:none'>
6654 nelberth 3515
 
1 www 3516
    		<?php
3517
    	    $form = $this->formAudioAdd;
3518
    	    $form->setAttributes([
3519
    	       'method'    => 'post',
3520
    	        'name'      => 'form-slide-audio-add',
3521
    	        'id'        => 'form-slide-audio-add'
3522
    	    ]);
3523
    	    $form->prepare();
3524
    	    echo $this->form()->openTag($form);
3525
 
3526
    	    $element = $form->get('type');
3527
    	    echo $this->formHidden($element);
3528
 
3529
    	    ?>
3530
            <!-- Modal Header -->
6654 nelberth 3531
 
3532
              <div class="d-flex justify-content-center tituloEditor">
3533
              <h4>LABEL_ADD_AUDIO_SLIDE</h4>
1 www 3534
 
6654 nelberth 3535
             </div>
3536
 
1 www 3537
            <!-- Modal body -->
6654 nelberth 3538
            <div class="grid-padre">
3539
				<div class="form-group  grid-1-2">
1 www 3540
    				<?php
3541
                        $element = $form->get('name');
3542
                        $element->setAttributes(['class' => 'form-control']);
3543
                        $element->setOptions(['label' => 'LABEL_NAME']);
3544
                        echo $this->formLabel($element);
3545
                        echo $this->formText($element);
3546
                    ?>
3547
				</div>
6654 nelberth 3548
				<div class="form-group  grid-1-2">
1 www 3549
    				<?php
3550
                        $element = $form->get('order');
3551
                        $element->setAttributes(['class' => 'form-control']);
3552
                        $element->setOptions(['label' => 'LABEL_ORDER']);
3553
                        echo $this->formLabel($element);
3554
                        echo $this->formText($element);
3555
                    ?>
3556
				</div>
6658 nelberth 3557
				<div class="form-group  grid-1-2">
1 www 3558
 
3559
                 		<?php
3560
                        $element = $form->get('file');
3561
                        $element->setAttributes(['class' => 'form-control']);
3562
                        $element->setOptions(['label' => 'LABEL_AUDIO']);
3563
                        $element->setAttributes(['accept' => 'audio/x-wav, audio/mpeg']);
3564
                        echo $this->formLabel($element);
3565
                        ?>
3566
                        <div class="file-loading">
3567
                        <?php echo $this->formFile($element);?>
3568
                        </div>
3569
 
3570
          		</div>
6657 nelberth 3571
          		<?php
3572
                    $element = $form->get('background');
3573
					$element->setAttributes([ 'class' => 'background']);
3574
                    echo $this->formHidden($element);
3575
                ?>
3576
          		<div class="contenido form-group " id="contenido"></div>
1 www 3577
      		</div>
3578
 
3579
            <!-- Modal footer -->
6654 nelberth 3580
 
1 www 3581
          	<?php echo $this->form()->closeTag($form); ?>
6656 nelberth 3582
 
1 www 3583
</div>
3584
 
3585
 
3586
 
3587
<!-- The Modal -->
6655 nelberth 3588
<div  id="company-microlearning-slide-audio-edit-box" style='display:none'>
6654 nelberth 3589
 
1 www 3590
        	<?php
3591
    	    $form = $this->formAudioEdit;
3592
    	    $form->setAttributes([
3593
    	       'method'    => 'post',
3594
    	       'name'      => 'form-slide-audio-edit',
3595
    	       'id'        => 'form-slide-audio-edit'
3596
    	    ]);
3597
    	    $form->prepare();
3598
    	    echo $this->form()->openTag($form);
3599
 
3600
    	    $element = $form->get('type');
3601
    	    echo $this->formHidden($element);
3602
 
3603
    	    ?>
3604
 
3605
            <!-- Modal Header -->
6654 nelberth 3606
 
3607
              <div class="d-flex justify-content-center tituloEditor">
3608
              <h4>LABEL_EDIT_AUDIO_SLIDE</h4>
1 www 3609
 
6654 nelberth 3610
             </div>
1 www 3611
            <!-- Modal body -->
6654 nelberth 3612
            <div class="grid-padre">
1 www 3613
				<div class="form-group">
3614
    				<?php
3615
                        $element = $form->get('name');
3616
                        $element->setAttributes(['class' => 'form-control']);
3617
                        $element->setOptions(['label' => 'LABEL_ORDER']);
3618
                        echo $this->formLabel($element);
3619
                        echo $this->formText($element);
3620
                    ?>
3621
				</div>
6654 nelberth 3622
				<div class="form-group  grid-1-2">
1 www 3623
    				<?php
3624
                        $element = $form->get('order');
3625
                        $element->setAttributes(['class' => 'form-control']);
3626
                        $element->setOptions(['label' => 'LABEL_ORDER']);
3627
                        echo $this->formLabel($element);
3628
                        echo $this->formText($element);
3629
                    ?>
3630
				</div>
6658 nelberth 3631
				<div class="form-group  grid-1-2">
1 www 3632
 
3633
                 		<?php
3634
                        $element = $form->get('file');
3635
                        $element->setAttributes(['class' => 'form-control']);
3636
                        $element->setOptions(['label' => 'LABEL_AUDIO']);
3637
                        $element->setAttributes(['accept' => 'audio/x-wav, audio/mpeg']);
3638
                        echo $this->formLabel($element);
3639
                        ?>
3640
                        <div class="file-loading">
3641
                        <?php echo $this->formFile($element);?>
3642
                        </div>
3643
 
3644
          		</div>
6654 nelberth 3645
 
3646
          		<?php
3647
                    $element = $form->get('background');
3648
					$element->setAttributes([ 'class' => 'background']);
3649
                    echo $this->formHidden($element);
3650
                ?>
3651
          		<div class="contenido form-group " id="contenido"></div>
1 www 3652
      		</div>
3653
 
3654
            <!-- Modal footer -->
6654 nelberth 3655
 
1 www 3656
          	<?php echo $this->form()->closeTag($form); ?>
6656 nelberth 3657
 
1 www 3658
</div>
3659
 
3660
 
3661
 
3662
<!-- The Modal -->
6655 nelberth 3663
<div  id="company-microlearning-slide-quizz-add-box" style='display:none'>
6654 nelberth 3664
 
1 www 3665
    		<?php
3666
    	    $form = $this->formQuizzAdd;
3667
    	    $form->setAttributes([
3668
    	       'method'    => 'post',
3669
    	        'name'      => 'form-slide-quizz-add',
3670
    	        'id'        => 'form-slide-quizz-add'
3671
    	    ]);
3672
    	    $form->prepare();
3673
    	    echo $this->form()->openTag($form);
3674
 
3675
    	    $element = $form->get('type');
3676
    	    echo $this->formHidden($element);
3677
 
3678
    	    ?>
3679
            <!-- Modal Header -->
6654 nelberth 3680
 
3681
              <div class="d-flex justify-content-center tituloEditor">
3682
              <h4>LABEL_ADD_QUIZ_SLIDE</h4>
1 www 3683
 
6654 nelberth 3684
             </div>
1 www 3685
            <!-- Modal body -->
6654 nelberth 3686
            <div class="grid-padre">
3687
				<div class="form-group  grid-1-2">
1 www 3688
    				<?php
3689
                        $element = $form->get('name');
3690
                        $element->setAttributes(['class' => 'form-control']);
3691
                        $element->setOptions(['label' => 'LABEL_NAME']);
3692
                        echo $this->formLabel($element);
3693
                        echo $this->formText($element);
3694
                    ?>
3695
				</div>
6654 nelberth 3696
				<div class="form-group  grid-1-2">
1 www 3697
    				<?php
3698
                        $element = $form->get('order');
3699
                        $element->setAttributes(['class' => 'form-control']);
3700
                        $element->setOptions(['label' => 'LABEL_ORDER']);
3701
                        echo $this->formLabel($element);
3702
                        echo $this->formText($element);
3703
                    ?>
3704
				</div>
6657 nelberth 3705
 
6658 nelberth 3706
				<div class="form-group  grid-1-2">
1 www 3707
    				<?php
3708
                        $element = $form->get('quiz_id');
3709
                        $element->setAttributes(['class' => 'form-control']);
3710
                        $element->setOptions(['label' => 'LABEL_QUIZ']);
3711
                        echo $this->formLabel($element);
3712
                        echo $this->formSelect($element);
3713
                    ?>
3714
				</div>
6657 nelberth 3715
                <?php
3716
                    $element = $form->get('background');
3717
					$element->setAttributes([ 'class' => 'background']);
3718
                    echo $this->formHidden($element);
3719
                ?>
3720
          		<div class="contenido form-group " id="contenido"></div>
1 www 3721
      		</div>
3722
 
3723
            <!-- Modal footer -->
6654 nelberth 3724
 
1 www 3725
          	<?php echo $this->form()->closeTag($form); ?>
6656 nelberth 3726
 
1 www 3727
</div>
3728
 
3729
 
3730
 
3731
<!-- The Modal -->
6655 nelberth 3732
<div  id="company-microlearning-slide-quizz-edit-box" style='display:none'>
6654 nelberth 3733
 
1 www 3734
        	<?php
3735
    	    $form = $this->formQuizzEdit;
3736
    	    $form->setAttributes([
3737
    	       'method'    => 'post',
3738
    	       'name'      => 'form-slide-quizz-edit',
3739
    	       'id'        => 'form-slide-quizz-edit'
3740
    	    ]);
3741
    	    $form->prepare();
3742
    	    echo $this->form()->openTag($form);
3743
 
3744
    	    $element = $form->get('type');
3745
    	    echo $this->formHidden($element);
3746
 
3747
    	    ?>
3748
 
3749
            <!-- Modal Header -->
6654 nelberth 3750
 
3751
              <div class="d-flex justify-content-center tituloEditor">
3752
              <h4>LABEL_EDIT_QUIZ_SLIDE</h4>
1 www 3753
 
6654 nelberth 3754
             </div>
1 www 3755
            <!-- Modal body -->
6654 nelberth 3756
            <div class="grid-padre">
3757
				<div class="form-group  grid-1-2">
1 www 3758
    				<?php
3759
                        $element = $form->get('name');
3760
                        $element->setAttributes(['class' => 'form-control']);
3761
                        $element->setOptions(['label' => 'LABEL_NAME']);
3762
                        echo $this->formLabel($element);
3763
                        echo $this->formText($element);
3764
                    ?>
3765
				</div>
6654 nelberth 3766
				<div class="form-group  grid-1-2">
1 www 3767
    				<?php
3768
                        $element = $form->get('order');
3769
                        $element->setAttributes(['class' => 'form-control']);
3770
                        $element->setOptions(['label' => 'LABEL_ORDER']);
3771
                        echo $this->formLabel($element);
3772
                        echo $this->formText($element);
3773
                    ?>
3774
				</div>
6657 nelberth 3775
 
6658 nelberth 3776
				<div class="form-group  grid-1-2">
1 www 3777
    				<?php
3778
                        $element = $form->get('quiz_id');
3779
                        $element->setAttributes(['class' => 'form-control']);
3780
                        $element->setOptions(['label' => 'LABEL_QUIZ']);
3781
                        echo $this->formLabel($element);
3782
                        echo $this->formSelect($element);
3783
                    ?>
3784
				</div>
6657 nelberth 3785
				<?php
3786
                    $element = $form->get('background');
3787
					$element->setAttributes([ 'class' => 'background']);
3788
                    echo $this->formHidden($element);
3789
                ?>
3790
          		<div class="contenido form-group " id="contenido"></div>
1 www 3791
 
3792
      		</div>
3793
 
3794
            <!-- Modal footer -->
6657 nelberth 3795
      		<
1 www 3796
 
3797
          	<?php echo $this->form()->closeTag($form); ?>
6656 nelberth 3798
 
1 www 3799
</div>
3800
 
3801
 
3802
 
3803
<!-- The Modal -->
6652 nelberth 3804
<div class="modal" id="company-microlearning-play-video-box" >
1 www 3805
	<div class="modal-dialog ">
3806
    	<div class="modal-content">
3807
 
3808
            <!-- Modal Header -->
3809
      		<div class="modal-header">
3810
        		<h4 class="modal-title">LABEL_PLAY_VIDEO</h4>
3811
        		<button type="button" class="close" data-dismiss="modal">&times;</button>
3812
      		</div>
3813
 
3814
            <!-- Modal body -->
3815
            <div class="modal-body">
3816
				<video src=""  style="width: 300px; height: auto" controls preload="false" autoplay="false"  poster="" id="microlearning-play-video"></video>
3817
      		</div>
3818
 
3819
            <!-- Modal footer -->
3820
      		<div class="modal-footer">
3821
        		<button type="button" class="btn btn-danger" data-dismiss="modal">Cerrar</button>
3822
          	</div>
3823
         </div>
3824
	</div>
3825
</div>
3826
 
3827
 
3828
 
3829
 
3830
 
3831
<!-- The Modal -->
6652 nelberth 3832
<div class="modal" id="company-microlearning-play-audio-box" >
1 www 3833
	<div class="modal-dialog ">
3834
    	<div class="modal-content">
3835
 
3836
            <!-- Modal Header -->
3837
      		<div class="modal-header">
3838
        		<h4 class="modal-title">LABEL_PLAY_AUDIO</h4>
3839
        		<button type="button" class="close" data-dismiss="modal">&times;</button>
3840
      		</div>
3841
 
3842
            <!-- Modal body -->
3843
            <div class="modal-body">
3844
				<audio src="" controls autoplay="false"  id="microlearning-play-audio" >
3845
                  Your browser does not support the <code>audio</code> element.
3846
                </audio>
3847
      		</div>
3848
 
3849
            <!-- Modal footer -->
3850
      		<div class="modal-footer">
3851
        		<button type="button" class="btn btn-danger" data-dismiss="modal">Cerrar</button>
3852
          	</div>
3853
         </div>
3854
	</div>
3855
</div>
3856
 
3857
 
3858
<!-- The Modal -->
3859
<div class="modal" id="company-microlearning-view-image-box">
3860
	<div class="modal-dialog ">
3861
    	<div class="modal-content">
3862
 
3863
            <!-- Modal Header -->
3864
      		<div class="modal-header">
6108 nelberth 3865
        		<h4 class="modal-title">LABEL_IMAGE</h4>
1 www 3866
        		<button type="button" class="close" data-dismiss="modal">&times;</button>
3867
      		</div>
3868
 
3869
            <!-- Modal body -->
3870
            <div class="modal-body text-center">
3871
				<img src="" class="img img-responsive" style="width: 300px; height: auto" id="image-view" />
3872
      		</div>
3873
 
3874
            <!-- Modal footer -->
3875
      		<div class="modal-footer">
3876
        		<button type="button" class="btn btn-danger" data-dismiss="modal">Cerrar</button>
3877
          	</div>
3878
         </div>
3879
	</div>
3880
</div>
3881
 
3882
 
3883
<!-- The Modal -->
3884
<div class="modal" id="company-microlearning-view-document-box">
3885
	<div class="modal-dialog ">
3886
    	<div class="modal-content">
3887
 
3888
            <!-- Modal Header -->
3889
      		<div class="modal-header">
3890
        		<h4 class="modal-title">LABEL_DOCUMENT</h4>
3891
        		<button type="button" class="close" data-dismiss="modal">&times;</button>
3892
      		</div>
3893
 
3894
            <!-- Modal body -->
3895
            <div class="modal-body text-center">
3896
            	<iframe id="document-view" style="width: 450px; height: 300px; scroll: auto">
3897
 
3898
            	</iframe>
3899
       	</div>
3900
 
3901
            <!-- Modal footer -->
3902
      		<div class="modal-footer">
3903
        		<button type="button" class="btn btn-danger" data-dismiss="modal">Cerrar</button>
3904
          	</div>
3905
         </div>
3906
	</div>
3907
</div>
3908
 
3909
 
3910
<!-- The Modal -->
3911
<div class="modal" id="company-microlearning-view-text-box">
3912
	<div class="modal-dialog modal-xl">
3913
    	<div class="modal-content">
3914
 
3915
            <!-- Modal Header -->
3916
      		<div class="modal-header">
3917
        		<h4 class="modal-title">LABEL_TEXT</h4>
3918
        		<button type="button" class="close" data-dismiss="modal">&times;</button>
3919
      		</div>
3920
 
3921
            <!-- Modal body -->
3922
            <div class="modal-body" >
3923
            	<div id="document-text" style="width: 100%; height: 300px; scroll: auto; overflow: auto;">
3924
 
3925
 
3926
            	</div>
3927
 
3928
       	</div>
3929
 
3930
            <!-- Modal footer -->
3931
      		<div class="modal-footer">
3932
        		<button type="button" class="btn btn-danger" data-dismiss="modal">Cerrar</button>
3933
          	</div>
3934
         </div>
3935
	</div>
3936
</div>
3937
 
3938
 
3939
<!-- The Modal -->
3940
<div class="modal" id="company-microlearning-add-capsule-type-box">
3941
	<div class="modal-dialog ">
3942
    	<div class="modal-content">
3943
 
3944
            <!-- Modal Header -->
3945
      		<div class="modal-header">
12065 nelberth 3946
        		<h5 class="modal-title">LABEL_ADD_CAPSULE_SELECT_TYPE</h5>
1 www 3947
        		<button type="button" class="close" data-dismiss="modal">&times;</button>
3948
      		</div>
3949
 
3950
            <!-- Modal body -->
3951
            <div class="modal-body">
12054 nelberth 3952
                <div class="d-flex w-100 flex-column">
12064 nelberth 3953
                    <div class="row mb-4 mt-4">
12066 nelberth 3954
                        <div class="col-4 d-flex justify-content-center"><button type="button" class="btn btn-primary btn-sm  btn-add-image"><i class="fa fa-picture-o mr-2" aria-hidden="true"></i> Imagen </button></div>
12067 nelberth 3955
                        <div class="col-4 d-flex justify-content-center"><button type="button" class="btn btn-primary btn-sm   btn-add-text"><i class="fa fa-file-text-o mr-2" aria-hidden="true"></i> Texto </button></div>
3956
                        <div class="col-4 d-flex justify-content-center"><button type="button" class="btn btn-primary  btn-sm btn-add-video"><i class="fa fa-video-camera mr-2" aria-hidden="true"></i> Video </button></div>
12057 nelberth 3957
 
3958
 
12053 nelberth 3959
                    </div>
12061 nelberth 3960
                    <div class="row mb-4">
12069 nelberth 3961
                        <div class="col-4 d-flex justify-content-center"><button type="button" class="btn btn-primary btn-sm btn-add-document"><i class="fa fa-file mr-2" aria-hidden="true"></i> Documento </button></div>
12067 nelberth 3962
                        <div class="col-4 d-flex justify-content-center"><button type="button" class="btn btn-primary  btn-sm btn-add-audio"><i class="fa fa-music mr-2" aria-hidden="true"></i> Audio </button></div>
3963
                        <div class="col-4 d-flex justify-content-center"><button type="button" class="btn btn-primary  btn-sm btn-add-quizz"><i class="fa fa-question mr-2" aria-hidden="true"></i> Cuestionario </button></div>
12061 nelberth 3964
 
3965
 
3966
                    </div>
12053 nelberth 3967
                    <div class='d-flex justify-content-between'>
12061 nelberth 3968
 
3969
 
3970
 
12053 nelberth 3971
                    </div>
3972
                </div>
3973
 
3974
 
3975
 
3976
 
1 www 3977
      		</div>
3978
 
3979
            <!-- Modal footer -->
3980
      		<div class="modal-footer">
12068 nelberth 3981
        		<button type="button" class="btn btn-danger btn-sm" data-dismiss="modal">LABEL_CLOSE</button>
1 www 3982
          	</div>
3983
         </div>
3984
	</div>
3985
</div>
3986
 
3987
 
3988
 
3989
 
3990