Proyectos de Subversion LeadersLinked - Backend

Rev

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