Proyectos de Subversion LeadersLinked - Backend

Rev

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