Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 6625 | Rev 6638 | 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
        validatorVideoAdd.resetForm();
1393
 
6616 nelberth 1394
 
1395
        $('body, html').animate({scrollTop: '0px'}, 300);
1396
		$('#content1').css('display','none');
1397
        seleccionarCampo =  $('#company-microlearning-slide-video-add-box');
1398
        seleccionarCampo.css('display','block')
1399
		iniciarEditor(seleccionarCampo)
1 www 1400
 
1401
        return false;
1402
    });
1403
 
1404
    $('body').on('click', 'button.btn-add-document', function(e) {
1405
        e.preventDefault();
1406
 
1407
 
1408
        $('#company-microlearning-add-capsule-type-box').modal('hide');
1409
        $('#form-slide-document-add #name').val('');
1410
        $('#form-slide-document-add #order').val('1');
1411
        $('#form-slide-document-add #file').fileinput('reset');
1412
        $('#form-slide-document-add #file').val('');
1413
        $('#form-slide-document-add #background').fileinput('reset');
1414
        $('#form-slide-document-add #background').val('');
1415
        validatorDocumentAdd.resetForm();
1416
 
6616 nelberth 1417
        $('body, html').animate({scrollTop: '0px'}, 300);
1418
		$('#content1').css('display','none');
1419
        seleccionarCampo =  $('#company-microlearning-slide-document-add-box');
1420
        seleccionarCampo.css('display','block')
1421
		iniciarEditor(seleccionarCampo)
1 www 1422
 
1423
        return false;
1424
    });
1425
 
1426
    $('body').on('click', 'button.btn-add-audio', function(e) {
1427
        e.preventDefault();
1428
 
1429
        $('#company-microlearning-add-capsule-type-box').modal('hide');
1430
        $('#form-slide-audio-add #name').val('');
1431
        $('#form-slide-audio-add #order').val('1');
1432
        $('#form-slide-audio-add #file').fileinput('reset');
1433
        $('#form-slide-audio-add #file').val('');
1434
        $('#form-slide-audio-add #background').fileinput('reset');
1435
        $('#form-slide-audio-add #background').val('');
1436
        validatorAudioAdd.resetForm();
1437
 
6616 nelberth 1438
        $('body, html').animate({scrollTop: '0px'}, 300);
1439
		$('#content1').css('display','none');
1440
        seleccionarCampo =  $('#company-microlearning-slide-audio-add-box');
1441
        seleccionarCampo.css('display','block')
1442
		iniciarEditor(seleccionarCampo)
1 www 1443
 
1444
        return false;
1445
    });
1446
 
1447
    $('#company-microlearning-slide-text-add-box, #company-microlearning-slide-text-edit-box').on("hide.bs.modal", function() {
1448
 
1449
    })
1450
 
1451
    $('#company-microlearning-slide-image-add-box, #company-microlearning-slide-image-edit-box').on("hide.bs.modal", function() {
1452
 
1453
    })
1454
 
1455
    $('#company-microlearning-slide-video-add-box, #company-microlearning-slide-video-edit-box').on("hide.bs.modal", function() {
1456
 
1457
    })
1458
 
1459
    $('#company-microlearning-slide-document-add-box, #company-microlearning-slide-document-edit-box').on("hide.bs.modal", function() {
1460
 
1461
    })
1462
 
1463
    $('#company-microlearning-slide-quizz-add-box, #company-microlearning-slide-quizz-edit-box').on("hide.bs.modal", function() {
1464
 
1465
    })
1466
 
1467
    $('#company-microlearning-play-video-box, #company-microlearning-play-audio-box').on("hide.bs.modal", function() {
1468
 
1469
 
1470
        document.getElementById('microlearning-play-video').pause();
1471
        document.getElementById('microlearning-play-audio').pause();
1472
    })
1473
 
1474
 
1475
    $('#form-slide-text-add #order').inputNumberFormat({decimal: 0});
1476
 
6591 nelberth 1477
 
1 www 1478
 
1479
    $('#form-slide-text-edit #order').inputNumberFormat({decimal: 0});
1480
 
1481
 
6591 nelberth 1482
 
1 www 1483
    $('#form-slide-image-add #order').inputNumberFormat({decimal: 0});
1484
 
6522 nelberth 1485
 
1 www 1486
 
1487
    $('#form-slide-image-edit #order').inputNumberFormat({decimal: 0});
1488
 
6522 nelberth 1489
 
1 www 1490
 
1491
    $('#form-slide-video-add #order').inputNumberFormat({decimal: 0});
1492
 
1493
    $('#form-slide-video-add #file').fileinput({
1494
        theme: 'fas',
1495
        language: 'es',
1496
        showUpload: false,
1497
        dropZoneEnabled: false,
1498
        maxFileCount: 1,
1499
        allowedFileExtensions: ['mp4', 'mpeg','webm'],
1500
        msgPlaceholder: 'Video de extensión mp4, mpeg, webm',
1501
    });
1502
 
1503
 
6591 nelberth 1504
 
1 www 1505
    $('#form-slide-video-edit #order').inputNumberFormat({decimal: 0});
1506
 
1507
    $('#form-slide-video-edit #file').fileinput({
1508
        theme: 'fas',
1509
        language: 'es',
1510
        showUpload: false,
1511
        dropZoneEnabled: false,
1512
        maxFileCount: 1,
1513
        allowedFileExtensions: ['mp4', 'mpeg','webm'],
1514
        msgPlaceholder: 'Video de extensión mp4, mpeg, webm',
1515
    });
1516
 
1517
 
6591 nelberth 1518
 
1 www 1519
 
1520
 
1521
    $('#form-slide-document-add #order').inputNumberFormat({decimal: 0});
1522
 
1523
    $('#form-slide-document-add #file').fileinput({
1524
        theme: 'fas',
1525
        language: 'es',
1526
        showUpload: false,
1527
        dropZoneEnabled: false,
1528
        maxFileCount: 1,
1529
        allowedFileExtensions: ['pdf'],
1530
        msgPlaceholder: 'Documentos de extensión pdf',
1531
    });
1532
 
1533
 
1534
 
6591 nelberth 1535
 
1 www 1536
    $('#form-slide-document-edit #order').inputNumberFormat({decimal: 0});
1537
 
1538
    $('#form-slide-document-edit #file').fileinput({
1539
        theme: 'fas',
1540
        language: 'es',
1541
        showUpload: false,
1542
        dropZoneEnabled: false,
1543
        maxFileCount: 1,
1544
        allowedFileExtensions: ['pdf'],
1545
        msgPlaceholder: 'Documentos de extensión pdf',
1546
    });
1547
 
1548
 
1549
 
6591 nelberth 1550
 
1 www 1551
    $('#form-slide-audio-add #order').inputNumberFormat({decimal: 0});
1552
 
1553
    $('#form-slide-audio-add #file').fileinput({
1554
        theme: 'fas',
1555
        language: 'es',
1556
        showUpload: false,
1557
        dropZoneEnabled: false,
1558
        maxFileCount: 1,
1559
        allowedFileExtensions: ['wav', 'mp3'],
1560
        msgPlaceholder: 'Audios de extensión wav y mp3',
1561
    });
1562
 
1563
 
1564
 
6591 nelberth 1565
 
1 www 1566
    $('#form-slide-audio-edit #order').inputNumberFormat({decimal: 0});
1567
 
1568
    $('#form-slide-audio-edit #file').fileinput({
1569
        theme: 'fas',
1570
        language: 'es',
1571
        showUpload: false,
1572
        dropZoneEnabled: false,
1573
        maxFileCount: 1,
1574
        allowedFileExtensions: ['wav', 'mp3'],
1575
        msgPlaceholder: 'Audios de extensión wav y mp3',
1576
    });
1577
 
1578
 
1579
 
6591 nelberth 1580
 
1 www 1581
    $('#form-slide-quizz-add #order').inputNumberFormat({decimal: 0});
1582
 
1583
 
1584
 
6591 nelberth 1585
 
1 www 1586
    $('#form-slide-quizz-edit #order').inputNumberFormat({decimal: 0});
1587
 
6591 nelberth 1588
 
1 www 1589
 
1590
 
1591
 
1592
 
1593
 
1594
 
1595
 
1596
    CKEDITOR.replace('description_add');
1597
    CKEDITOR.replace('description_edit');
1598
 
1599
 
1600
   $('body').on('click', '.btn-view-image', function(e) {
1601
        e.preventDefault();
1602
 
1603
        $('#company-microlearning-view-image-box').modal('show');
1604
 
1605
        $('#image-view').attr('src', $(this).data('href'));
1606
 
1607
        return false;
1608
    });
1609
 
1610
 
1611
    $('body').on('click', '.btn-play-video', function(e) {
1612
        e.preventDefault();
1613
 
1614
        $('#microlearning-play-video').attr('src', $(this).data('href'));
1615
        $('#company-microlearning-play-video-box').modal('show');
1616
 
1617
        return false;
1618
    });
1619
 
1620
    $('body').on('click', '.btn-play-audio', function(e) {
1621
        e.preventDefault();
1622
 
1623
 
1624
        $('#microlearning-play-audio').attr('src', $(this).data('href'));
1625
        $('#company-microlearning-play-audio-box').modal('show');
1626
 
1627
        return false;
1628
    });
1629
 
1630
    $('body').on('click', '.btn-view-document', function(e) {
1631
        e.preventDefault();
1632
 
1633
 
1634
        $('#document-view').attr('src', $(this).data('href'));
1635
        $('#company-microlearning-view-document-box').modal('show');
1636
 
1637
        return false;
1638
    });
1639
 
1640
    $('body').on('click', '.btn-view-text', function(e) {
1641
        e.preventDefault();
1642
 
1643
        var url = $(this).data('href');
1644
        $.ajax({
1645
            'dataType'  : 'json',
1646
            'accept'    : 'application/json',
1647
            'method'    : 'get',
1648
            'url'       :  url,
1649
        }).done(function(response) {
1650
            if(response['success']) {
1651
                $('#document-text').html( response['data']  );
1652
            }
1653
 
1654
        }).fail(function( jqXHR, textStatus, errorThrown) {
1655
            $.fn.showError(textStatus);
1656
        }).always(function() {
1657
            NProgress.done();
1658
        });
1659
 
1660
 
1661
        $('#company-microlearning-view-text-box').modal('show');
1662
 
1663
        return false;
1664
    });
1665
 
1666
 
1667
 
1668
    $('#form-filter #topic_uuid').change(function(e) {
1669
        e.preventDefault();
1670
 
1671
        $('#form-filter #capsule_uuid').empty();
1672
        gridTable.api().ajax.reload(null, false);
1673
    })
1674
 
1675
 
1676
    $('#form-filter #capsule_uuid').change(function(e) {
1677
        e.preventDefault();
1678
 
1679
        gridTable.api().ajax.reload(null, false);
1680
    })
1681
 
1682
    $('button.btn-add').click(function(e) {
1683
        e.preventDefault()
1684
 
1685
        $('#company-microlearning-add-capsule-type-box').modal('show');
1686
 
1687
    } );
1688
 
1689
 
1690
 
1691
    $('body').on('click', 'button.btn-refresh', function(e) {
1692
        e.preventDefault();
1693
        gridTable.api().ajax.reload(null, false);
1694
    });
1695
 
6113 nelberth 1696
    	/*Script del editor (Aqui comienza el cielo y la tierra) */
1697
		var imagenServidorNoticia;
1698
		var scroll_altura,viente;
1699
		var nombre_user = $(".perfil_u_nombre").text();
1700
		var primer_nombre = nombre_user.split(" ")[0];
6543 nelberth 1701
		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 1702
 
1703
		$(document).on("click", ".info_noticia", function(e){
1704
			imagenServidorNoticia = elemento.toDataURL("image/jpeg", 1.0);
1705
			console.log(imagenServidorNoticia.split(','))
6523 nelberth 1706
			$('.background').val(imagenServidorNoticia.split(',')[1]);
1707
            $('.imageType .file').val(imagenServidorNoticia.split(',')[1]);
6113 nelberth 1708
			console.log($('.file').val())
1709
			$(".c1").addClass("paso");
1710
 
1711
 
1712
		})
6582 nelberth 1713
 
6556 nelberth 1714
		function iniciarEditor(campo, image=''){
6113 nelberth 1715
		 cortar=false;
1716
		recorte_listo=false;
1717
		texto="";
1718
		seis=true;
1719
		color="#ffffff";
1720
		texto_listo=false,siete=false;
1721
		uno=true;
1722
		size=48;
1723
		cinco=true;
1724
		xf=320,yf =480;
1725
		negritas=false, bold="";
1726
		shadow = true, nueve=true;
1727
		italic=false, ita="";
1728
		rectangulo=false, diez=false;
1729
     	fontfamily="Arial";
1730
     	r=0,g=0,b=0,a=1;
1731
		window.clearInterval(editorNoticia);
1732
		setTimeout(function(){
1733
			scroll_altura=$(".articulo_noticia").offset().top-110;
1734
			anchoFondoOscuro = $(".articulo_noticia").width();
1735
			altoFondoOscuro = $(".editor_imagenes").height();
1736
			$(".fondo_oscuro").css("width",""+anchoFondoOscuro+"px");
1737
			$(".fondo_oscuro").css("height",""+altoFondoOscuro+"px");
1738
 
6556 nelberth 1739
		},navegacion(nuevoHtmlImagen,campo,image));
6113 nelberth 1740
 
1741
		}
1742
 
1743
		$(document).on("click", ".volver", function(){
1744
		var nombre_user = $(".perfil_u_nombre").text();
1745
		var primer_nombre = nombre_user.split(" ")[0];
1746
		 cortar=false;
1747
		cinco=true;
1748
		recorte_listo=false;
1749
		texto="";
1750
		seis=true;
1751
		color="#ffffff";
1752
		texto_listo=false,siete=false;
1753
		uno=true;
1754
		size=48;
1755
		xf=320,yf =480;
1756
		negritas=false, bold="";
1757
		shadow = true, nueve=true;
1758
		italic=false, ita="";
1759
		rectangulo=false, diez=false;
1760
     	fontfamily="Arial";
1761
     	r=0,g=0,b=0,a=1;
1762
		 var imagenServidorNoticia;
6585 nelberth 1763
         console.log(seleccionarCampo)
6113 nelberth 1764
		window.clearInterval(editorNoticia);
1765
		setTimeout(function(){
1766
			scroll_altura=$(".articulo_noticia").offset().top-110;
1767
			anchoFondoOscuro = $(".articulo_noticia").width();
1768
			altoFondoOscuro = $(".editor_imagenes").height();
1769
			$(".fondo_oscuro").css("width",""+anchoFondoOscuro+"px");
1770
			$(".fondo_oscuro").css("height",""+altoFondoOscuro+"px");
1771
 
6584 nelberth 1772
		},navegacion(nuevoHtmlImagen,seleccionarCampo));
6113 nelberth 1773
 
1774
		})
1775
 
6574 nelberth 1776
		function navegacion(nuevoHtmlImagen,campo,image='',reload=true){
6581 nelberth 1777
                selectorElementoName=campo.find('#name')
6577 nelberth 1778
 
1779
                selectorElementoEditor=campo.find('#contenido');
6113 nelberth 1780
 
6574 nelberth 1781
				if(image!=''){
6113 nelberth 1782
					const getBase64FromUrl = async (url) => {
1783
						const data = await fetch(url);
1784
						const blob = await data.blob();
1785
						return new Promise((resolve) => {
1786
							const reader = new FileReader();
1787
							reader.readAsDataURL(blob);
1788
							reader.onloadend = function() {
1789
							const base64data = reader.result;
1790
							resolve(base64data);
1791
							}
1792
						});
1793
					}
1794
 
1795
					getBase64FromUrl(image).then(function(e){
6581 nelberth 1796
						selectorElementoName.trigger('change');
6113 nelberth 1797
						$(".volver").css("display","block")
1798
						$(".a1").addClass("paso");
1799
						$(".titulo_pasos").html("LABEL_STEP_2");
1800
						setTimeout(function(){
1801
							recorte_listo=true;
1802
							$(".fondo_oscuro").css("display","none");
1803
							$("#boton_recortar").removeClass("recortar").text("LABEL_SEND").addClass("info_noticia").attr('type','submit');
1804
							$(".recortar10").removeClass("recortar");
1805
							$(".canvas").removeClass("recortar");
1806
							$(".b1").addClass("paso");
1807
							$(".titulo_pasos").html("LABEL_STEP_3");
1808
							if(texto!=""){
1809
								seis=true;
1810
								siete=true;
1811
							}
1812
							cinco=true;
1813
							dos=true;
1814
							cuatro=true;
1815
							actualizar();
1816
 
1817
						},editorNoticia(e));
1818
 
1819
 
1820
					})
1821
 
1822
					setTimeout(function(){
1823
						$(".canvas_subir").html('<span class="icon-plus fa fa-spinner"></span> Cargando...')
6581 nelberth 1824
						selectorElementoName.trigger('change');
6577 nelberth 1825
					},selectorElementoEditor.html(nuevoHtmlImagen));
6113 nelberth 1826
				}else{
1827
					setTimeout(function(){
6581 nelberth 1828
					    selectorElementoName.trigger('change');
6577 nelberth 1829
					},selectorElementoEditor.html(nuevoHtmlImagen));
6113 nelberth 1830
				}
6574 nelberth 1831
 
6113 nelberth 1832
		}
1833
 
1834
		$(window).on("scroll", function(){
1835
			console.log(scroll_altura)
1836
		if($(window).scrollTop()>scroll_altura){
1837
			$("#cuadro_noticias").addClass("fixed");
1838
		}else{
1839
			$("#cuadro_noticias").removeClass("fixed");
1840
		}
1841
	})
1842
 
1843
	$(document).on("dragover", "#imagen_noticia", function(e){
1844
		e.preventDefault();
1845
		e.stopPropagation();
1846
		$(this).css({"background":"rgba(0,0,0,.2)"})
1847
	})
1848
	$(document).on("drop", "#imagen_noticia", function(e){
1849
		e.preventDefault();
1850
		e.stopPropagation();
1851
		$(this).css("background", "none");
1852
		var archivo = e.originalEvent.dataTransfer.files;
1853
		var img=archivo[0];
1854
		if(img.type =="image/jpeg"||img.type =="image/png"){
1855
			$(".modificar").removeClass("animated");
1856
			var render = new FileReader();
1857
			render.readAsDataURL(img);
1858
			render.onload = function(e){
1859
				$(".volver").css("display","block")
1860
				$(".a1").addClass("paso");
1861
				$(".titulo_pasos").html("LABEL_STEP_2");
1862
				console.log(e.target.result)
1863
				editorNoticia(e.target.result)
1864
			}
1865
		}
1866
	})
1867
	$(document).on("dragover", "body", function(e){
1868
		e.preventDefault();
1869
		e.stopPropagation();
1870
	})
1871
	$(document).on("drop", "body", function(e){
1872
		e.preventDefault();
1873
		e.stopPropagation();
1874
	})
1875
 
1876
	var canvas='<div class="editorNoticia"><canvas id="editorNoticia">LABEL_NOT_SUPPORTED</canvas></div>';
1877
	$(document).on("mouseover", ".editorNoticia", function(){
1878
		$("body").css({"overflow": "hidden"});
1879
		$(".cuadro_noticias, .fixed_noticia,.tituloEditor,.grid-padre").css("margin-right", "17px")
1880
		$(".barra,.footer").css("padding-right","17px")
1881
 
1882
 
1883
	})
1884
	$(document).on("mouseover", "#editorNoticia", function(){
1885
		if(recorte_listo){
1886
			ocho=true;
1887
		}
1888
	})
1889
	$(document).on("mouseout", "#editorNoticia", function(){
1890
		if(recorte_listo){
1891
			ocho=false;
1892
			actualizar2()
1893
		}
1894
	})
1895
	$(document).on("mouseout", ".editorNoticia",function(){
1896
		$("body").css({"overflow": "auto"})
1897
		$(".cuadro_noticias, .fixed_noticia,.tituloEditor,.grid-padre").css("margin-right", "0px")
1898
		$(".barra,.footer").css("padding-right","0px")
1899
 
1900
	})
1901
	$(document).on('mousewheel', ".editorNoticia",function(e){
1902
		var ruedita = e.originalEvent.wheelDelta
1903
		if(ruedita>0){
1904
			scale = scale+(scale/10);
1905
			$("#porciento_scale").html((scale*100).toFixed(2)+"%")
1906
		}else{
1907
			scale = scale-(scale/10);
1908
			$("#porciento_scale").html((scale*100).toFixed(2)+"%")
1909
		}
1910
		$("#editorNoticia").css({"transform": "scale("+scale+")"});
1911
	})
1912
	$(document).on("click", ".as", function(e){
1913
		e.preventDefault();
1914
		 scale = $(this).data("scale");
1915
		 $("#porciento_scale").html((scale*100).toFixed(2)+"%")
1916
		 $("#editorNoticia").css({"transform": "scale("+scale+")"});
1917
 
1918
	})
1919
	$(document).on("click", ".ps", function(e){
1920
		e.preventDefault();
1921
		$(".cantidades_scale").slideToggle(200).css("display", "block");
1922
	})
1923
	$(document).on("click", "#cerrar_filter_modal, .icon_filter", function(e){
1924
		e.preventDefault();
1925
		if(recorte_listo){
1926
		$(".contenido_filter").slideToggle(200).css("display", "block");
1927
		}
1928
	})
1929
	$(document).on("click", "#cerrar_text_modal, .icon_text", function(e){
1930
		e.preventDefault();
1931
		if(recorte_listo){
1932
			$(".contenido_text").slideToggle(200).css("display", "block");
1933
		}
1934
	})
1935
 
1936
	$(document).on("click", "#cerrar_cut_modal, .icon_cut", function(e){
1937
		e.preventDefault();
1938
		if(cortar){
1939
			$(".contenido_cut").slideToggle(200).css("display", "block");
1940
		}
1941
 
1942
	})
1943
	$(document).on("click", "#menos_scale", function(e){
1944
		e.preventDefault();
1945
		scale = scale-(scale/10);
1946
		 $("#porciento_scale").html((scale*100).toFixed(2)+"%")
1947
		 $("#editorNoticia").css({"transform": "scale("+scale+")"});
1948
	})
1949
 
1950
	$(document).on("click", "#mas_scale", function(e){
1951
		e.preventDefault();
1952
		scale = scale+(scale/10);
1953
		 $("#porciento_scale").html((scale*100).toFixed(2)+"%")
1954
		 $("#editorNoticia").css({"transform": "scale("+scale+")"});
1955
	})
1956
	$(document).on("click", "#noche", function(){
1957
		$(".oa").removeClass("oa")
1958
		filter( .5,1.3,1.31,1.33,1.38);
1959
		$(this).addClass("oa")
1960
	})
1961
	$(document).on("click", "#sa", function(){
1962
		$(".oa").removeClass("oa")
1963
		filter( .7,1.1,1.64,1.66,1.50);
1964
		$(this).addClass("oa")
1965
	})
1966
	$(document).on("click", "#crema", function(){
1967
		$(".oa").removeClass("oa")
1968
		filter( .75,1,1.66,1.60,1.51);
1969
		$(this).addClass("oa")
1970
	})
1971
	$(document).on("click", "#setenta", function(){
1972
		$(".oa").removeClass("oa")
1973
		filter( .8,.75,1.60,1.66,1.58);
1974
		$(this).addClass("oa")
1975
	})
1976
	$(document).on("click", "#orange", function(){
1977
		$(".oa").removeClass("oa")
1978
		filter( .8,1,1.6,1.45,1.49);
1979
		$(this).addClass("oa")
1980
	})
1981
	$(document).on("click", "#relieve", function(){
1982
		$(".oa").removeClass("oa")
1983
		filter( .7,1.2,1.60,1.66,1.58);
1984
		$(this).addClass("oa")
1985
	})
1986
	$(document).on("click", "#bosque", function(){
1987
		$(".oa").removeClass("oa")
1988
		filter( .85,.75,1.47,1.66,1.54);
1989
		$(this).addClass("oa")
1990
	})
1991
	$(document).on("click", "#desierto", function(){
1992
		$(".oa").removeClass("oa")
1993
		filter( .8,.9,1.66,1.43,1.28);
1994
		$(this).addClass("oa")
1995
	})
1996
	$(document).on("click", "#villa", function(){
1997
		$(".oa").removeClass("oa")
1998
		filter( .8,.8,1.71,1.64,1.58);
1999
		$(this).addClass("oa")
2000
	})
2001
	$(document).on("click", "#magia", function(){
2002
		$(".oa").removeClass("oa")
2003
		filter( .7,1.2,1.49,1.49,1.6);
2004
		$(this).addClass("oa")
2005
	})
2006
	$(document).on("click", "#luz", function(){
2007
		$(".oa").removeClass("oa")
2008
		filter( .9,.9,1.45,1.54,1.54);
2009
		$(this).addClass("oa")
2010
	})
2011
	$(document).on("click", "#retoque", function(){
2012
		$(".oa").removeClass("oa")
2013
		filter( .9,1.3,1,1,1);
2014
		$(this).addClass("oa")
2015
	})
2016
	$(document).on("click", "#saturacion", function(){
2017
		$(".oa").removeClass("oa")
2018
		filter( 1,1.5,1,1,1);
2019
		$(this).addClass("oa")
2020
	})
2021
	$(document).on("click", "#rosa", function(){
2022
		$(".oa").removeClass("oa")
2023
		filter( .8,1.2,1.24,.99,1);
2024
		$(this).addClass("oa")
2025
	})
2026
	$(document).on("click", "#historia", function(){
2027
		$(".oa").removeClass("oa")
2028
		filter( .9,1.1,1.33,1.19,.91);
2029
		$(this).addClass("oa")
2030
	})
2031
	$(document).on("click", "#encantador", function(){
2032
		$(".oa").removeClass("oa")
2033
		filter( .9,1.2,26,-12,0,2);
2034
		$(this).addClass("oa")
2035
	})
2036
	$(document).on("click", "#emocion", function(){
2037
		$(".oa").removeClass("oa")
2038
		filter( 1.1,1.4,40,12,-6,2);
2039
		$(this).addClass("oa")
2040
	})
2041
	$(document).on("click", "#beige", function(){
2042
		$(".oa").removeClass("oa")
2043
		filter( .9,1.32,56,47,17,2);
2044
		$(this).addClass("oa")
2045
	})
2046
	$(document).on("click", "#fine", function(){
2047
		$(".oa").removeClass("oa")
2048
		filter( .87,1.19,55,37,23,2);
2049
		$(this).addClass("oa")
2050
	})
2051
	$(document).on("click", "#lord", function(){
2052
		$(".oa").removeClass("oa")
2053
		filter( 1.2,.9,67,13,-23,2);
2054
		$(this).addClass("oa")
2055
	})
2056
	$(document).on("click", "#70", function(){
2057
		$(".oa").removeClass("oa")
2058
		filter( 1.2,1.2,35,7,18,2);
2059
		$(this).addClass("oa")
2060
	})
2061
	$(document).on("click", "#arbol", function(){
2062
		$(".oa").removeClass("oa")
2063
		filter(.92,1.23,-11,11,11,2);
2064
		$(this).addClass("oa")
2065
	})
2066
	$(document).on("click", "#verano", function(){
2067
		$(".oa").removeClass("oa")
2068
		filter( 1,1.4,-3,-1,-12,2);
2069
		$(this).addClass("oa")
2070
	})
2071
	$(document).on("click", "#cf", function(){
2072
		$(".oa").removeClass("oa")
2073
		filter( .85,1.26,-15,2,-1,2);
2074
		$(this).addClass("oa")
2075
	})
2076
	$(document).on("click", "#angeles", function(){
2077
		$(".oa").removeClass("oa")
2078
		filter( 1,1.4,5,12,1,2);
2079
		$(this).addClass("oa")
2080
	})
2081
	$(document).on("click", "#caliente", function(){
2082
		$(".oa").removeClass("oa")
2083
		filter( .9,1.2,43,-17,-55,2);
2084
		$(this).addClass("oa")
2085
	})
2086
	$(document).on("click", "#otono", function(){
2087
		$(".oa").removeClass("oa")
2088
		filter( 1,1.29,29,26,17,2);
2089
		$(this).addClass("oa")
2090
	})
2091
	$(document).on("click", "#marzo", function(){
2092
		$(".oa").removeClass("oa")
2093
		filter( .85,1.3,43,25,-11,2);
2094
		$(this).addClass("oa")
2095
	})
2096
	$(document).on("click", "#pera", function(){
2097
		$(".oa").removeClass("oa")
2098
		filter( .8,1.25,31,41,12,2);
2099
		$(this).addClass("oa")
2100
	})
2101
	$(document).on("click", "#comun", function(){
2102
		$(".oa").removeClass("oa")
2103
		filter( 1,1.36,4,5,1,2);
2104
		$(this).addClass("oa")
2105
	})
2106
	$(document).on("click", "#oro", function(){
2107
		$(".oa").removeClass("oa")
2108
		filter( .9,1.3,37,-25,1,2);
2109
		$(this).addClass("oa")
2110
	})
2111
	$(document).on("click", "#gotico", function(){
2112
		$(".oa").removeClass("oa")
2113
		filter( 1.1,1.3,-47,-42,-30,2);
2114
		$(this).addClass("oa")
2115
	})
2116
	$(document).on("click", "#forestal", function(){
2117
		$(".oa").removeClass("oa")
2118
		filter( 1,1.4,-5,42,11,2);
2119
		$(this).addClass("oa")
2120
	})
2121
	$(document).on("click", "#luna", function(){
2122
		$(".oa").removeClass("oa")
2123
		filter( .9,1.2,-5,-7,4,2);
2124
		$(this).addClass("oa")
2125
	})
2126
	$(document).on("click", "#fiesta", function(){
2127
		$(".oa").removeClass("oa")
2128
		filter( 1.1,1.3,-1,-1,26,2);
2129
		$(this).addClass("oa")
2130
	})
2131
	$(document).on("click", "#gris", function(){
2132
		$(".oa").removeClass("oa")
2133
		filtergris(1,1)
2134
		$(this).addClass("oa")
2135
	})
2136
	$(document).on("click", "#lhs", function(){
2137
		$(".oa").removeClass("oa")
2138
		filtergris(.8,1.5);
2139
		$(this).addClass("oa")
2140
	})
2141
	$(document).on("click", "#normal", function(){
2142
		$(".oa").removeClass("oa")
2143
		$(this).addClass("oa")
2144
		filter();
2145
	})
2146
	var texto_listo=false,siete=false;
2147
	var texto;
2148
	$(document).on("keyup", "#texto_input", function(e){
2149
		e.preventDefault();
2150
		texto = $(this).val();
2151
		if(texto_actualizar){
2152
			siete=true;
2153
		}
2154
		if(texto!=""){
2155
			texto_actualizar=true;
2156
			actualizar2();
2157
		}else{
2158
			actualizar2();
2159
		}
2160
 
2161
	})
2162
	var color="#ffffff";
2163
	$(document).on("change", "#color", function(){
2164
    	color=$(this).val();
2165
    	seis=true;
2166
    	actualizar2();
2167
    })
2168
    var size=48;
2169
    $(document).on("keyup change", "#font-size", function(){
2170
    	size=$(this).val();
2171
    	size = parseInt(size);
2172
    	seis=true;
2173
    	siete=true;
2174
    	actualizar2();
2175
    })
2176
    var negritas=false, bold="";
2177
    $(document).on("click", "#negritas", function(e){
2178
    	e.preventDefault();
2179
    	if(!negritas){
2180
    		bold="bold";
2181
    		$(this).addClass("fa");
2182
    		seis=true;
2183
    		siete=true;
2184
    		actualizar2();
2185
    		negritas=true;
2186
    	}else{
2187
    		bold="";
2188
    		$(this).removeClass("fa");
2189
    		seis=true;
2190
    		siete=true;
2191
    		actualizar2();
2192
    		negritas=false;
2193
    	}
2194
    })
2195
    var italic=false, ita="";
2196
     $(document).on("click", "#italic", function(e){
2197
    	e.preventDefault();
2198
    	if(!italic){
2199
    		ita="italic";
2200
    		$(this).addClass("fa");
2201
    		seis=true;
2202
    		siete=true;
2203
    		actualizar2();
2204
    		italic=true;
2205
    	}else{
2206
    		ita="";
2207
    		$(this).removeClass("fa");
2208
    		seis=true;
2209
    		siete=true;
2210
    		actualizar2();
2211
    		italic=false;
2212
    	}
2213
    })
2214
     var fontfamily="Arial";
2215
     $(document).on("click", ".fs", function(e){
2216
    	e.preventDefault();
2217
    	$(".at").removeClass("at");
2218
    	$(this).addClass("at");
2219
    	fontfamily= $(this).text();
2220
    	seis=true;
2221
    	siete=true;
2222
    	actualizar2();
2223
 
2224
    })
2225
     var shadow = true, nueve=true;
2226
     $(document).on("click","#shadow", function(e){
2227
     	e.preventDefault();
2228
     	if(shadow){
2229
     		$(this).removeClass("fa");
2230
     		seis=true;
2231
     		nueve=false;
2232
     		actualizar2();
2233
     		shadow=false;
2234
     	}else{
2235
     		$(this).addClass("fa");
2236
     		seis=true;
2237
     		nueve=true;
2238
     		actualizar2();
2239
     		shadow=true;
2240
     	}
2241
 
2242
     })
2243
     var rectangulo=false, diez=false, colorrect="#000000";
2244
     $(document).on("click", "#rectangulo", function(e){
2245
     	e.preventDefault();
2246
     	if(!rectangulo){
2247
     		$(this).addClass("fa");
2248
     		diez=true;
2249
     		actualizar2();
2250
     		rectangulo=true;
2251
     	}else{
2252
     		$(this).removeClass("fa");
2253
     		diez=false;
2254
     		actualizar2();
2255
     		rectangulo=false;
2256
     	}
2257
 
2258
     })
2259
     var r=0,g=0,b=0;
2260
    $(document).on("change", "#colorrect", function(){
2261
    	colorrect=$(this).val();
2262
    	r=parseInt(colorrect.slice(1,3),16);
2263
    	g=parseInt(colorrect.slice(3,5),16);
2264
    	b=parseInt(colorrect.slice(5,7),16);
2265
    	seis=true;
2266
    	actualizar2();
2267
    })
2268
    var a=1;
2269
 
2270
    $(document).on("keyup change", "#opacidad", function(){
2271
    	a=$(this).val();
2272
    	a=a/100;
2273
    	seis=true;
2274
    	actualizar2();
2275
    })
2276
	var imaNoti = new Image();
2277
	function filter(brillo=1, contraste=1, rojo=1, verde=1, azul=1, valor=1){
2278
		cuatro=false;
2279
		restaurar(brillo, contraste);
2280
		datos=imagenOriginal.data;
2281
		if(valor==2){
2282
			for (var i =  0; i <datos.length; i+=4) {
2283
				datos[i]=datos[i]+rojo;
2284
				datos[i+1]=datos[i+1]+verde;
2285
				datos[i+2]=datos[i+2]+azul;
2286
			}
2287
		}else{
2288
			for (var i =  0; i <datos.length; i+=4) {
2289
				datos[i]=datos[i]*rojo;
2290
				datos[i+1]=datos[i+1]*verde;
2291
				datos[i+2]=datos[i+2]*azul
2292
			}
2293
		}
2294
		editor.putImageData(imagenOriginal,0,0)
2295
		var imagenNoticia = elemento.toDataURL("image/jpeg", 1.0);
2296
	    imaNoti.src = imagenNoticia;
2297
		actualizar2();
2298
	}
2299
	function filtergris(brillo=1, contraste=1){
2300
		cuatro=false;
2301
		restaurar(brillo, contraste);
2302
		datos=imagenOriginal.data;
2303
		var auxiliar;
2304
		for (var i =  0; i <datos.length; i+=4) {
2305
			auxiliar = 0.34 * datos[i] + 0.5 *datos[i+1] + 0.16 * datos[i+2];
2306
			datos[i]=auxiliar;
2307
			datos[i+1]=auxiliar;
2308
			datos[i+2]=auxiliar;
2309
		}
2310
 
2311
		editor.putImageData(imagenOriginal,0,0)
2312
		var imagenNoticia = elemento.toDataURL("image/jpeg", 1.0);
2313
	    imaNoti.src = imagenNoticia;
2314
		actualizar2();
2315
	}
2316
	function restaurar(brillo = 1, contraste=1){
2317
		editor.filter = "none"
2318
		editor.filter = 'contrast('+contraste+') brightness('+brillo+') saturate(1) sepia(0)';
2319
		editor.fillStyle="rgba(255,255,255,1)"
2320
		editor.fillRect(0,0,ancho,alto);
2321
		editor.fillStyle=""+color+"";
2322
		var pxf=0,pyf=0;
2323
			if(xf>=(yf/recorte)){
2324
				pxf=xf/ancho;
2325
				pyf=yf/pxf;
2326
				py=(alto/2)-(pyf/2);
2327
				editor.drawImage(imagen,x,y,xf,yf,0,py,ancho,pyf);
2328
			}else{
2329
				pyf=yf/alto;
2330
				pxf=xf/pyf;
2331
				px=(ancho/2)-(pxf/2);
2332
				editor.drawImage(imagen,x,y,xf,yf,px,0,pxf,alto);
2333
			}
2334
		imagenOriginal = editor.getImageData(0,0,ancho,alto)
2335
	}
2336
	var ocho=false;
2337
	function actualizar2(){
2338
		if(recorte_listo){
2339
		if(cuatro){
2340
			imagenOriginal = editor.getImageData(0,0,ancho,alto)
2341
			var imagenNoticia = elemento.toDataURL("image/jpeg", 1.0);
2342
	    	imaNoti.src = imagenNoticia;
2343
	    	cuatro=false;
2344
		}
2345
		editor.filter = "none"
2346
		$(imaNoti).ready(function(e){
2347
			noticia.drawImage(imaNoti,0,0,320,480);
2348
			editor.drawImage(imaNoti,0,0,ancho,alto)
2349
			if(texto_actualizar){
2350
				if(texto!=""){
2351
					if(seis){
2352
						ancho_imaNoti = imaNoti.width;
2353
 
2354
						scale_noticia = -(((ancho_imaNoti-320)/ancho_imaNoti)-1);
2355
						editor.fillStyle=""+color+"";
2356
						editor.strokeStyle="rgb(255,255,255)";
2357
						if(nueve){
2358
							editor.shadowColor="rgba(0,0,0,.5)";
2359
							editor.shadowOffsetX=6;
2360
							editor.shadowOffsetY=6;
2361
							editor.shadowBlur=6;
2362
							noticia.shadowColor="rgba(0,0,0,.5)";
2363
							noticia.shadowOffsetX=6*scale_noticia;
2364
							noticia.shadowOffsetY=6*scale_noticia;
2365
							noticia.shadowBlur=6*scale_noticia;
2366
						}else{
2367
							editor.shadowColor="rgba(0,0,0,0)";
2368
							noticia.shadowColor="rgba(0,0,0,0)";
2369
						}
2370
						editor.font=""+ita+" "+bold+" "+size+"px "+fontfamily+"";
2371
						editor.textAlign="start";
2372
						editor.textBaseline="top";
2373
 
2374
						var sizeNoticia = size*scale_noticia;
2375
						noticia.fillStyle=""+color+"";
2376
						noticia.font=""+ita+" "+bold+" "+sizeNoticia+"px "+fontfamily+"";
2377
						noticia.textAlign="start";
2378
						noticia.textBaseline="top";
2379
						seis=false;
2380
					}
2381
					if(siete){
2382
						dimencionesTexto = editor.measureText(texto);
2383
						txf=dimencionesTexto.width+20;
2384
						tyf= (20+size);
2385
						siete=false;
2386
					}
2387
					if(cinco){
2388
						dimencionesTexto = editor.measureText(texto);
2389
						if(xf>=(yf/recorte)){
2390
							tx=(xf/2)-(dimencionesTexto.width/2);
2391
							ty=(xf*recorte/2)-(size/2);
2392
						}else{
2393
							tx=(yf/recorte/2)-(dimencionesTexto.width/2);
2394
							ty=(yf/2)-(size/2);
2395
						}
2396
 
2397
						txf=dimencionesTexto.width+20;
2398
						tyf= size+20;
2399
						cinco=false;
2400
					}
2401
					if(diez){
2402
						editor.fillStyle="rgba("+r+","+g+","+b+","+a+")";
2403
						noticia.fillStyle="rgba("+r+","+g+","+b+","+a+")";
2404
						editor.fillRect(tx-10,ty-10,txf,tyf);
2405
						noticia.fillRect(((tx-10)*scale_noticia),((ty-10)*scale_noticia),txf*scale_noticia,tyf*scale_noticia);
2406
						editor.fillStyle=""+color+"";
2407
						noticia.fillStyle=""+color+"";
2408
 
2409
					}
2410
					editor.fillText(texto,tx,ty);
2411
					noticia.fillText(texto,(tx*scale_noticia),ty*scale_noticia);
2412
					if(ocho){
2413
						editor.strokeRect(tx-10,ty-10,txf,tyf)
2414
						editor.arc(tx+txf,ty+tyf,10,0,Math.PI*2,false);
2415
						editor.fill();
2416
						editor.beginPath();
2417
					}
2418
					texto_listo=true;
2419
				}
2420
			}
2421
		})
2422
 
2423
	}
2424
	}
2425
	function actualizar(){
2426
			$(imagen).ready(function(e){
2427
				if(uno){
2428
					ancho=imagen.width, alto = imagen.height;
2429
					elemento.width = ancho;
2430
					elemento.height = alto;
2431
					$(".scale").css("display","flex");
2432
					mitadX=ancho/2;
2433
					mitadY=alto/2;
2434
					x=mitadX-xf/2;
2435
					y=mitadY-yf/2;
2436
					if(ancho<=alto){
2437
					 scale = -(((alto-450)/alto)-1);
2438
 
2439
					}else{
2440
					 scale = -(((ancho-500)/ancho)-1);
2441
					}
2442
					$("#porciento_scale").html((scale*100).toFixed(2)+"%")
2443
					$("#ancho").html(ancho+"px");
2444
					$("#alto").html(alto+"px");
2445
					uno=false;
2446
				}
2447
				if(dos){
2448
 
2449
					if(xf>=(yf/recorte)){
2450
						alto=xf*recorte;
2451
						ancho=xf;
2452
					}else{
2453
						ancho=yf/recorte;
2454
						alto=yf;
2455
 
2456
					}
2457
					elemento.width = ancho;
2458
					elemento.height = alto;
2459
					if(xf<=yf){
2460
					 scale = -(((yf-450)/yf)-1);
2461
 
2462
					}else{
2463
					 scale = -(((xf-500)/xf)-1);
2464
					}
2465
 
2466
					$("#porciento_scale").html((scale*100).toFixed(2)+"%")
2467
					$("#ancho").html(Math.round(xf)+"px");
2468
					$("#alto").html(Math.round(yf)+"px");
2469
					dos=false;
2470
				}
2471
 
2472
					var pxf=0,pyf=0;
2473
					noticia.fillStyle="rgba(255,255,255,1)"
2474
					noticia.fillRect(0,0,320,480);
2475
				if(xf>=(yf/recorte)){
2476
					pxf=xf/320;
2477
					pyf=yf/pxf;
2478
					py=(480/2)-(pyf/2);
2479
					noticia.drawImage(imagen,x,y,xf,yf,0,py,320,pyf);
2480
				}else{
2481
					pyf=yf/480;
2482
					pxf=xf/pyf;
2483
					px=(320/2)-(pxf/2);
2484
					noticia.drawImage(imagen,x,y,xf,yf,px,0,pxf,480);
2485
				}
2486
 
2487
				$("#editorNoticia").css({"transform": "scale("+scale+")"});
2488
				if(!recorte_listo){
2489
					editor.drawImage(imagen,0,0,ancho,alto);
2490
					editor.fillStyle="rgba(0,0,0,.2)"
2491
					editor.fillRect(0,0,ancho,alto);
2492
					editor.fillStyle="rgba(255,255,255,.1)"
2493
					editor.fillRect(x,y,xf,yf);
2494
					editor.fillStyle="rgba(255,255,255,.5)"
2495
					editor.fillRect(x,y,16,16);
2496
					editor.fillRect((x+xf)-16,y,16,16);
2497
					editor.fillRect(x,y+yf-16,16,16);
2498
					editor.fillRect(x+xf-16,yf+y-16,16,16);
2499
					esta=true;
2500
				}else{
2501
					var pxf=0,pyf=0;
2502
 
2503
					editor.fillStyle="rgba(255,255,255,1)"
2504
					editor.fillRect(0,0,ancho,alto);
2505
					if(xf>=(yf/recorte)){
2506
						pxf=xf/ancho;
2507
						pyf=yf/pxf;
2508
						py=(alto/2)-(pyf/2);
2509
						editor.drawImage(imagen,x,y,xf,yf,0,py,ancho,pyf);
2510
					}else{
2511
						pyf=yf/alto;
2512
						pxf=xf/pyf;
2513
						px=(ancho/2)-(pxf/2);
2514
						editor.drawImage(imagen,x,y,xf,yf,px,0,pxf,alto);
2515
				}
2516
 
2517
				}
2518
			})
2519
		}
2520
	var imagenOriginal;
2521
	var x,y,xf=320,yf =480, elemento,editor,centro, total,scale,dimencionesTexto,ancho_imaNoti,
2522
	recorte_listo=false,alto,ancho,tx,ty,txf,tyf,cuatro=true,texto_actualizar=false,cinco=true,seis=true,cuatro;
2523
	var  mitadY,mitadX, uno=true,dos=false, recorte=480/320, imagen_noticias, scale_noticia, tres=true,rotar=false, cortar=false;;
2524
	var translateX;
2525
 
2526
	$(document).on("click", ".recortar10", function(e){
2527
 
2528
		e.preventDefault();
2529
		recorte_listo=false;
2530
		uno=true;
2531
		$(".fondo_oscuro").css("display","block");
2532
		$("#boton_recortar").addClass("recortar").text("Recortar").removeClass("info_noticia");
2533
		$("#boton_recortar3").addClass("recortar").text("Recortar").removeClass("info_noticia3");
2534
		$(".contenido_text").css("display", "none");
2535
		$(".contenido_filter").css("display", "none");
2536
		$(".recortar10").addClass("recortar");
2537
		$(".canvas").addClass("recortar")
2538
		$(".oa").removeClass("oa");
2539
		$("#normal").addClass("oa");
2540
		$(".b1").removeClass("paso");
2541
		$(".titulo_pasos").html("LABEL_STEP_2");
2542
		window.clearInterval(actualizar2);
2543
		actualizar();
2544
 
2545
	})
2546
 
2547
 
2548
	blockCelda=true;
2549
	$(document).on("click", "#blockCelda", function(e){
2550
		e.preventDefault();
2551
		if(blockCelda){
2552
			$(this).html('<span class="fa fa-unlock"></span>')
2553
 
2554
			blockCelda=false;
2555
		}else{
2556
			$(this).html('<span class="fa fa-lock"></span>')
2557
			blockCelda=true;
2558
		}
2559
		t4=true;
2560
 
2561
	})
2562
	var imagen
2563
	function editorNoticia(img){
2564
		 cortar=true;
2565
		imagen= new Image();
2566
		$(".canvas").html(canvas);
2567
		elemento = document.getElementById("editorNoticia");
2568
		editor = elemento.getContext("2d");
2569
		elemento2 = document.getElementById("imagen_noticias");
2570
		noticia = elemento2.getContext("2d");
2571
 
2572
		$(document).on("click", ".boton_marino.recortar",function(e){
2573
			e.preventDefault();
2574
			recorte_listo=true;
2575
			$(".fondo_oscuro").css("display","none");
2576
			$("#boton_recortar").removeClass("recortar").text("LABEL_SEND").addClass("info_noticia").attr('type','submit');
2577
			$(".recortar10").removeClass("recortar");
2578
			$(".canvas").removeClass("recortar");
2579
			$(".b1").addClass("paso");
2580
			$(".titulo_pasos").html("LABEL_STEP_3");
2581
			if(texto!=""){
2582
				seis=true;
2583
				siete=true;
2584
			}
2585
			cinco=true;
2586
			dos=true;
2587
			cuatro=true;
2588
			actualizar();
2589
		})
2590
 
2591
		var cli = false, t1= false, t2=false,t3=false,t4=false,tcli=false;
2592
		var mouse =[];
2593
 
2594
 
2595
		function raton(elemento, e){
2596
			return {
2597
				x:((e.pageX - elemento.offsetLeft - ((ancho/2)-((ancho*scale)/2)))/scale),
2598
				y:((e.pageY - elemento.offsetTop - ((alto/2)-((alto*scale)/2)))/scale)
2599
			}
2600
		}
2601
 
2602
		imagen.src=img;
2603
		$(".recortar10").addClass("recortar");
2604
		$("#boton_recortar").removeClass("boton_normal").addClass("recortar boton_marino").text("LABEL_CUT")
2605
		actualizar();
2606
 
2607
		$(elemento).mousemove(function(e){
2608
			mouse = raton(this, e);
2609
			//console.log("raton x: "+mouse.x+ " raton Y: " +mouse.y+ " tx: "+tx+" ty: "+ty+" txf:"+(txf+tx)+" tyf:"+(tyf+ty) )
2610
			if(!recorte_listo){
2611
				if(x+16<mouse.x &&(xf+x-16)>mouse.x && y+16<mouse.y && (y+yf-16)>mouse.y){
2612
			 		$(elemento).css("cursor","move");
2613
			 	}else if((xf+x-16)<mouse.x &&(xf+x)>mouse.x && (y+yf-16)<mouse.y && (y+yf)>mouse.y){
2614
			 		$(elemento).css("cursor","nw-resize");
2615
			 	}else if((xf+x-16)<mouse.x &&(xf+x)>mouse.x && y<mouse.y && (y+16)>mouse.y){
2616
			 		$(elemento).css("cursor","ne-resize");
2617
			 	}else if(x<mouse.x &&(16+x)>mouse.x && y<mouse.y && (y+16)>mouse.y){
2618
			 		$(elemento).css("cursor","se-resize");
2619
			 	}else if(x<mouse.x &&(16+x)>mouse.x && (y+yf-16)<mouse.y &&(y+yf)>mouse.y){
2620
			 		$(elemento).css("cursor","sw-resize");
2621
			 	}else{
2622
			 		$(elemento).css("cursor","default");
2623
			 	}
2624
			}else if(texto_listo){
2625
				if(tx-10<mouse.x && tx-10+txf>mouse.x && ty-10<mouse.y && ty-10+tyf>mouse.y){
2626
			 		$(elemento).css("cursor","move");
2627
			 	}else if((txf+tx-10)<mouse.x &&(txf+tx-10+20)>mouse.x && (ty-10+tyf)<mouse.y && (ty-10+tyf+20)>mouse.y){
2628
			 		$(elemento).css("cursor","pointer");
2629
			 	}else{
2630
			 		$(elemento).css("cursor","default");
2631
			 	}
2632
			}
2633
			else{
2634
				$(elemento).css("cursor","default");
2635
			}
2636
		})
2637
		$(elemento).mousedown(function(e){
2638
			mouse = raton(this, e);
2639
			if(!recorte_listo){
2640
				if(x+16<mouse.x &&(xf+x-16)>mouse.x && y+16<mouse.y && (y+yf-16)>mouse.y){
2641
			 		cli = true;
2642
			 	}
2643
			 	if((xf+x-16)<mouse.x &&(xf+x)>mouse.x && (y+yf-16)<mouse.y && (y+yf)>mouse.y){
2644
			 		t4 = true;
2645
			 	}
2646
				if((xf+x-16)<mouse.x &&(xf+x)>mouse.x && y<mouse.y && (y+16)>mouse.y){
2647
			 		t3 = true;
2648
			 	}
2649
			 	if(x<mouse.x &&(16+x)>mouse.x && y<mouse.y && (y+16)>mouse.y){
2650
			 		t1 = true;
2651
			 	}
2652
			 	if(x<mouse.x &&(16+x)>mouse.x && (y+yf-16)<mouse.y &&(y+yf)>mouse.y){
2653
			 		t2 = true;
2654
			 	}
2655
			}else if(texto_listo){
2656
				if(tx-10<mouse.x && tx-10+txf>mouse.x && ty-10<mouse.y && ty-10+tyf>mouse.y){
2657
			 		tcli=true;
2658
			 	}else if((txf+tx-10)<mouse.x &&(txf+tx-10+20)>mouse.x && (ty-10+tyf)<mouse.y && (ty-10+tyf+20)>mouse.y){
2659
			 		rotar=true;
2660
			 	}
2661
			}
2662
 
2663
		 })
2664
 
2665
		 $(elemento).mousemove(function(e){
2666
		 	mouse = raton(this, e);
2667
		 	if(!recorte_listo){
2668
			 	if(cli){
2669
			 		if((mouse.y-(yf/2))>=0&&(mouse.y+(yf/2))<=alto){
2670
				 		y = (mouse.y-(yf/2));
2671
			 		}else{
2672
			 			if((mouse.y-(yf/2))<0){
2673
			 				y=0;
2674
			 			}
2675
			 			if((mouse.y+(yf/2))>alto){
2676
			 				y=alto-yf;
2677
			 			}
2678
			 		}
2679
			 		if((mouse.x-(xf/2))>=0&&(mouse.x+(xf/2))<=ancho){
2680
			 			x = (mouse.x-(xf/2));
2681
			 		}else{
2682
			 			if((mouse.x-(xf/2))<0){
2683
			 				x=0;
2684
			 			}
2685
			 			if((mouse.x+(xf/2))>ancho){
2686
			 				x=(ancho)-xf;
2687
			 			}
2688
			 		}
2689
			 	}
2690
				if(blockCelda){
2691
			 	if(t4){
2692
			 		if(mouse.y<(alto-10)&&(x+xf)<=(ancho)){
2693
				 		if(Math.round(xf)>=50){
2694
							if(((mouse.y-y)/recorte)>50){
2695
				 				yf=mouse.y-y;
2696
				 				xf=(yf/recorte);
2697
				 			}
2698
						}
2699
			 		}else{
2700
			 			if(mouse.y>=(alto-10)){
2701
			 				yf=alto-y;
2702
				 			xf=(yf/recorte);
2703
				 			t4=false;
2704
			 			}
2705
			 			if(x+xf>(ancho)){
2706
			 				xf=(ancho)-x;
2707
				 			yf=(xf*recorte);
2708
				 			t4=false;
2709
			 			}
2710
			 		}
2711
			 	}
2712
			 	if(t3){
2713
			 		if(mouse.y>0&&(x+xf)<=(ancho)){
2714
				 		if(Math.round(xf)>=50){
2715
							if(((yf+(y-mouse.y))/recorte)>50){
2716
					 			yf=yf+(y-mouse.y);
2717
					 			xf=(yf/recorte);
2718
					 			y=mouse.y;
2719
				 			}
2720
				 		}
2721
 
2722
			 		}else{
2723
			 			if(mouse.y<=0) {
2724
			 				yf=yf+(y-mouse.y);
2725
				 			xf=(yf/recorte);
2726
			 				y=0;
2727
			 				t3=false;
2728
			 			}
2729
			 			if(x+xf>(ancho)){
2730
			 				xf=(ancho)-x;
2731
				 			yf=xf*recorte;
2732
				 			t3=false;
2733
			 			}
2734
			 		}
2735
			 	}
2736
			 	if(t2){
2737
			 		if(mouse.y<(alto-10)&&x>=0){
2738
				 		if(Math.round(xf)>=50){
2739
							if(((mouse.y-y)/recorte)>50){
2740
					 			x=(x+(yf-(mouse.y-y))/recorte);
2741
					 			yf=mouse.y-y;
2742
					 			xf=(yf/recorte);
2743
				 			}
2744
					 	}
2745
 
2746
			 		}else{
2747
			 			if(mouse.y>=(alto-10)) {
2748
			 				yf=alto-y;
2749
				 			xf=(yf/recorte);
2750
				 			t2=false;
2751
			 			}
2752
			 			if(0>x){
2753
			 				x=0;
2754
			 				xf=mouse.y-y;
2755
				 			yf=(xf*recorte);
2756
				 			t2=false;
2757
			 			}
2758
			 		}
2759
			 	}
2760
			 	if(t1){
2761
			 		if(mouse.y>0&&x>=0){
2762
				 		if(Math.round(xf)>=50){
2763
							if(((yf+(y-mouse.y))/recorte)>50){
2764
								yf=yf+(y-mouse.y);
2765
					 			xf=(yf/recorte);
2766
					 			x=(x-(y-mouse.y)/recorte);
2767
					 			y=mouse.y;
2768
							}
2769
				 		}
2770
			 		}else{
2771
			 			if(mouse.y<=0) {
2772
			 				yf=yf+(y-mouse.y);
2773
				 			xf=(yf/recorte);
2774
			 				y=0;
2775
			 				t1=false;
2776
			 			}
2777
			 			if(0>x){
2778
			 				x=0;
2779
			 				xf=yf+(y-mouse.y);
2780
				 			yf=(xf*recorte);
2781
				 			t1=false;
2782
			 			}
2783
			 		}
2784
			 	}
2785
				}else{
2786
				 if(t4){
2787
			 		if(mouse.y<(alto-10-(2/scale))&&mouse.x<=(ancho-(2/scale))){
2788
 
2789
							if((mouse.y-y)>50){
2790
				 				yf=mouse.y-y;
2791
				 			}
2792
							if((mouse.x-x)>50){
2793
								xf=mouse.x-x;
2794
							}
2795
 
2796
			 		}else{
2797
			 			if(mouse.y>=(alto-10-(2/scale))){
2798
			 				yf=alto-y;
2799
			 			}
2800
			 			if(mouse.x>(ancho-(2/scale))){
2801
			 				xf=(ancho)-x;
2802
			 			}
2803
						 t4=false;
2804
			 		}
2805
			 	}
2806
			 	if(t3){
2807
			 		if(mouse.y>(2/scale)&&mouse.x<=(ancho-(2/scale))){
2808
 
2809
							if((yf-(mouse.y-y))>50){
2810
				 				yf=yf-(mouse.y-y);
2811
								y=mouse.y;
2812
				 			}
2813
							if((mouse.x-x)>50){
2814
								xf=mouse.x-x;
2815
							}
2816
 
2817
 
2818
			 		}else{
2819
						if(mouse.x>(ancho-(2/scale))){
2820
							xf=ancho-x;
2821
						}
2822
						if(mouse.y<=(2/scale)){
2823
							yf=yf-(mouse.y-y);
2824
							y=0;
2825
						}
2826
			 			t3=false;
2827
			 		}
2828
			 	}
2829
				/* Izquierda abajo */
2830
			 	if(t2){
2831
			 		if(mouse.y<(alto-10-(2/scale))&&mouse.x>=(2/scale)){
2832
							 if((mouse.y-y)>50){
2833
								yf=mouse.y-y;
2834
				 			}
2835
							if((xf-(mouse.x-x))>50){
2836
								xf=xf-(mouse.x-x);
2837
								x=mouse.x
2838
							}
2839
 
2840
			 		}else{
2841
			 			if(mouse.y>=(alto-10-(2/scale))) {
2842
							yf=alto-y;
2843
			 			}
2844
 
2845
			 			if(mouse.x<(2/scale)){
2846
							xf=xf-(mouse.x-x);
2847
			 				x=0;
2848
			 			}
2849
						 t2=false;
2850
			 		}
2851
			 	}
2852
				/* izquierda arriba */
2853
			 	if(t1){
2854
			 		if(mouse.y>(2/scale)&&mouse.x>=(2/scale)){
2855
 
2856
							if((yf-(mouse.y-y))>50){
2857
				 				yf=yf-(mouse.y-y);
2858
								y=mouse.y;
2859
				 			}
2860
							if((xf-(mouse.x-x))>50){
2861
								xf=xf-(mouse.x-x);
2862
								x=mouse.x
2863
							}
2864
 
2865
			 		}else{
2866
						if(mouse.y<=(2/scale)){
2867
							yf=yf-(mouse.y-y);
2868
							y=0;
2869
						}
2870
						 if(mouse.x<(2/scale)){
2871
							xf=xf-(mouse.x-x);
2872
			 				x=0;
2873
 
2874
			 			}
2875
						 t1=false;
2876
			 		}
2877
			 	}
2878
			}
2879
 
2880
		 	actualizar();
2881
		 	}else if(texto_listo){
2882
		 		if(tcli){
2883
		 			tx=mouse.x-(txf/2)
2884
		 			ty=mouse.y-(tyf/2)
2885
		 		}else if(rotar){
2886
 
2887
		 		}
2888
 
2889
		 		actualizar2();
2890
		 	}
2891
		 })
2892
		 $(elemento).mouseup(function(e){
2893
		 	if(!recorte_listo){
2894
			 	cli=false;
2895
			 	t1=false;
2896
			 	t2=false;
2897
			 	t3=false;
2898
			 	t4=false;
2899
		 	}else if (texto_listo) {
2900
		 		tcli=false;
2901
		 	}
2902
		 })
2903
 
2904
 
2905
	}
2906
	/* Titulo */
2907
 
2908
var titulo_noticia, censor_titulo = true, numero_titulo=0;
2909
	$(document).on("keyup change", "#name", function(e){
2910
	console.log(numero_titulo)
2911
	titulo_noticia = $(this).val();
2912
	titulo_elemento= $(".titulo_topico");
2913
	if(titulo_noticia!=""){
2914
		if(censor_titulo){
2915
			titulo_elemento.html(titulo_noticia);
2916
			if(titulo_elemento.height()>38){
2917
				var titulo_noticia2 = "";
2918
				for(var i =0; i <titulo_noticia.length;i++){
2919
					titulo_noticia2 = titulo_noticia2 + titulo_noticia.split("")[i];
2920
					titulo_elemento.html(titulo_noticia2);
2921
					if(titulo_elemento.height()>38){
2922
						titulo_noticia2 = titulo_noticia2.slice(0,-5) + "...";
2923
						titulo_elemento.html(titulo_noticia2);
2924
						numero_titulo = titulo_noticia2.length;
2925
						censor_titulo=false;
2926
						break;
2927
					}
2928
 
2929
				}
2930
			}else{
2931
				numero_titulo=0;
2932
			}
2933
		}else{
2934
			if(numero_titulo+1>=titulo_noticia.length){
2935
				titulo_elemento.html(titulo_noticia);
2936
				censor_titulo=true;
2937
			}
2938
		}
2939
	}else{
6543 nelberth 2940
		titulo_elemento.html("LABEL_TITLE_TOPIC");
6113 nelberth 2941
		censor_titulo = true;
2942
	}
2943
})
2944
 
1 www 2945
});
2946
JS;
2947
$this->inlineScript()->captureEnd();
2948
?>
2949
 
2950
 
2951
<!-- Content Header (Page header) -->
2952
<section class="content-header">
2953
	<div class="container-fluid">
2954
    	<div class="row mb-2">
2955
        	<div class="col-sm-12">
2956
            	<h1>LABEL_SLIDES</h1>
2957
			</div>
2958
		</div>
2959
	</div><!-- /.container-fluid -->
2960
</section>
2961
 
6122 nelberth 2962
<section class="content" id='content1'>
1 www 2963
	<div class="container-fluid">
2964
    	<div class="row">
2965
        	<div class="col-12">
2966
				<div class="card">
2967
					<div class="card-header">
2968
						<?php
2969
                        $form = $this->form;
2970
            	        $form->setAttributes([
2971
                            'name'    => 'form-filter',
2972
                            'id'      => 'form-filter',
2973
                        ]);
2974
 
2975
                        $form->prepare();
2976
                        echo $this->form()->openTag($form);
2977
                        ?>
2978
                        <div class="row">
2979
                            <div class="col-md-6 col-sm-12">
2980
                                <div class="form-group">
2981
                                    <?php
2982
                                        $element = $form->get('topic_uuid');
2983
 
2984
                                        $element->setOptions(['label' => 'LABEL_TOPIC']);
2985
 
2986
                                        $element->setAttributes(['class' => 'form-control']);
2987
                                        echo $this->formLabel($element);
2988
                                        echo $this->formSelect($element);
2989
                                    ?>
2990
                                </div>
2991
                            </div>
2992
                            <div class="col-md-6 col-sm-12">
2993
                                <div class="form-group">
2994
                                    <?php
2995
                                        $element = $form->get('capsule_uuid');
2996
                                        $element->setOptions(['label' => 'LABEL_CAPSULE']);
2997
                                        $element->setAttributes(['class' => 'form-control']);
2998
                                        echo $this->formLabel($element);
2999
                                        echo $this->formSelect($element);
3000
                                    ?>
3001
                                </div>
3002
                            </div>
3003
                        </div>
3004
						<?php echo $this->form()->closeTag($form); ?>
3005
					</div>
3006
					<div class="card-body">
20 steven 3007
        	    		<table id="gridTable" class="table   table-hover">
1 www 3008
                      		<thead>
3009
        						<tr>
3010
                                	<th>LABEL_NAME</th>
3011
                                  	<th>LABEL_DETAILS</th>
3012
                                  	<th>LABEL_MEDIA</th>
3013
                                  	<th>LABEL_ACTIONS</th>
3014
                                </tr>
3015
                       		</thead>
3016
                         	<tbody>
3017
                         	</tbody>
3018
                    	</table>
3019
                   	</div>
3020
                   	<div class="card-footer clearfix">
3021
                   		<div style="float:right;">
3022
							<button type="button" class="btn btn-info btn-refresh"><i class="fa fa-refresh"></i> LABEL_REFRESH  </button>
3023
							<?php if($allowAdd) : ?>
3024
							<button type="button" class="btn btn-primary btn-add"><i class="fa fa-plus"></i> LABEL_ADD </button>
3025
							<?php endif; ?>
3026
						</div>
3027
                 	</div>
3028
          		</div>
3029
           	</div>
3030
        </div>
3031
 	</div>
3032
</section>
3033
 
3034
 
3035
 
3036
<!-- The Modal -->
6531 nelberth 3037
<div  id="company-microlearning-slide-text-add-box" style='display:none'>
6528 nelberth 3038
 
1 www 3039
    		<?php
3040
    	    $form = $this->formTextAdd;
3041
    	    $form->setAttributes([
3042
    	       'method'    => 'post',
3043
    	       'name'      => 'form-slide-text-add',
3044
    	       'id'        => 'form-slide-text-add'
3045
    	    ]);
3046
    	    $form->prepare();
3047
    	    echo $this->form()->openTag($form);
3048
 
3049
    	    $element = $form->get('type');
3050
    	    echo $this->formHidden($element);
3051
 
3052
    	    ?>
3053
 
6528 nelberth 3054
            <div class="d-flex justify-content-center tituloEditor">
6590 nelberth 3055
              <h4>LABEL_ADD_TEXT_SLIDE</h4>
6528 nelberth 3056
 
3057
             </div>
3058
 
3059
 
3060
            <div class="grid-padre">
3061
				<div class="form-group grid-1-2">
1 www 3062
    				<?php
3063
                        $element = $form->get('name');
3064
                        $element->setAttributes(['class' => 'form-control']);
3065
                        $element->setOptions(['label' => 'LABEL_NAME']);
3066
                        echo $this->formLabel($element);
3067
                        echo $this->formText($element);
3068
                    ?>
3069
				</div>
6528 nelberth 3070
                <div class="form-group grid-1-2">
1 www 3071
                	<?php
3072
                    $element = $form->get('description');
3073
                    $element->setOptions(['label' => 'LABEL_DESCRIPTION']);
6600 nelberth 3074
                    $element->setAttributes(['id' => 'description_add', 'rows' => '2',  'class' => 'form-control']);
1 www 3075
                    echo $this->formLabel($element);
3076
                    echo $this->formTextArea($element);
3077
                    ?>
3078
   				</div>
6528 nelberth 3079
				<div class="form-group grid-1-2">
1 www 3080
    				<?php
3081
                        $element = $form->get('order');
3082
                        $element->setAttributes(['class' => 'form-control']);
3083
                        $element->setOptions(['label' => 'LABEL_ORDER']);
3084
                        echo $this->formLabel($element);
3085
                        echo $this->formText($element);
3086
                    ?>
3087
				</div>
6529 nelberth 3088
                <?php
3089
                    $element = $form->get('background');
3090
					$element->setAttributes([ 'class' => 'background']);
3091
                    echo $this->formHidden($element);
3092
                ?>
6543 nelberth 3093
				<div class="contenido form-group " id="contenido"></div>
6529 nelberth 3094
 
1 www 3095
      		</div>
3096
 
3097
          	<?php echo $this->form()->closeTag($form); ?>
6528 nelberth 3098
 
1 www 3099
</div>
3100
 
3101
 
3102
 
3103
 
3104
<!-- The Modal -->
6596 nelberth 3105
<div id="company-microlearning-slide-text-edit-box" style='display:none'>
6595 nelberth 3106
            <?php
1 www 3107
    	    $form = $this->formTextEdit;
3108
    	    $form->setAttributes([
3109
    	       'method'    => 'post',
3110
    	       'name'      => 'form-slide-text-edit',
3111
    	       'id'        => 'form-slide-text-edit'
3112
    	    ]);
3113
    	    $form->prepare();
3114
    	    echo $this->form()->openTag($form);
3115
 
3116
    	    $element = $form->get('type');
3117
    	    echo $this->formHidden($element);
3118
 
6595 nelberth 3119
    	    ?>
3120
            <div class="d-flex justify-content-center tituloEditor">
3121
              <h4>LABEL_EDIT_TEXT_SLIDE</h4>
1 www 3122
 
6595 nelberth 3123
             </div>
3124
 
3125
 
3126
            <div class="grid-padre">
3127
				<div class="form-group grid-1-2">
1 www 3128
    				<?php
3129
                        $element = $form->get('name');
3130
                        $element->setAttributes(['class' => 'form-control']);
3131
                        $element->setOptions(['label' => 'LABEL_NAME']);
3132
                        echo $this->formLabel($element);
3133
                        echo $this->formText($element);
3134
                    ?>
3135
				</div>
6595 nelberth 3136
                <div class="form-group grid-1-2">
1 www 3137
                	<?php
3138
                    $element = $form->get('description');
3139
                    $element->setOptions(['label' => 'LABEL_DESCRIPTION']);
6600 nelberth 3140
                    $element->setAttributes(['id' => 'description_edit', 'rows' => '2',  'class' => 'form-control']);
1 www 3141
                    echo $this->formLabel($element);
3142
                    echo $this->formTextArea($element);
3143
                    ?>
3144
   				</div>
6595 nelberth 3145
				<div class="form-group grid-1-2">
1 www 3146
    				<?php
3147
                        $element = $form->get('order');
3148
                        $element->setAttributes(['class' => 'form-control']);
3149
                        $element->setOptions(['label' => 'LABEL_ORDER']);
3150
                        echo $this->formLabel($element);
3151
                        echo $this->formText($element);
3152
                    ?>
3153
				</div>
6595 nelberth 3154
                <?php
3155
                    $element = $form->get('background');
3156
					$element->setAttributes([ 'class' => 'background']);
3157
                    echo $this->formHidden($element);
3158
                ?>
3159
				<div class="contenido form-group " id="contenido"></div>
3160
 
1 www 3161
      		</div>
3162
 
3163
          	<?php echo $this->form()->closeTag($form); ?>
6595 nelberth 3164
 
1 www 3165
</div>
3166
 
3167
 
3168
 
3169
<!-- The Modal -->
6523 nelberth 3170
<div class='imageType'  id="company-microlearning-slide-image-add-box" style='display:none' >
1 www 3171
    		<?php
3172
    	    $form = $this->formImageAdd;
3173
    	    $form->setAttributes([
3174
    	       'method'    => 'post',
3175
    	        'name'      => 'form-slide-image-add',
3176
    	        'id'        => 'form-slide-image-add'
3177
    	    ]);
3178
    	    $form->prepare();
3179
    	    echo $this->form()->openTag($form);
3180
 
3181
    	    $element = $form->get('type');
3182
    	    echo $this->formHidden($element);
3183
 
3184
    	    ?>
3185
            <!-- Modal Header -->
6126 nelberth 3186
            <div class="d-flex justify-content-center tituloEditor">
6131 nelberth 3187
              <h4>LABEL_ADD_IMAGE_SLIDE</h4>
1 www 3188
 
6126 nelberth 3189
             </div>
3190
 
1 www 3191
            <!-- Modal body -->
6126 nelberth 3192
            <div class="grid-padre">
6140 nelberth 3193
                 <div class="form-group grid-1-2">
1 www 3194
    				<?php
3195
                        $element = $form->get('name');
3196
                        $element->setAttributes(['class' => 'form-control']);
3197
                        $element->setOptions(['label' => 'LABEL_NAME']);
3198
                        echo $this->formLabel($element);
3199
                        echo $this->formText($element);
3200
                    ?>
3201
				</div>
6142 nelberth 3202
 
6137 nelberth 3203
 
6134 nelberth 3204
                <?php
3205
                    $element = $form->get('file');
3206
					$element->setAttributes([ 'class' => 'file']);
3207
                    echo $this->formHidden($element);
3208
                ?>
6129 nelberth 3209
				<div class="form-group grid-1-2">
1 www 3210
    				<?php
3211
                        $element = $form->get('order');
3212
                        $element->setAttributes(['class' => 'form-control']);
3213
                        $element->setOptions(['label' => 'LABEL_ORDER']);
3214
                        echo $this->formLabel($element);
3215
                        echo $this->formText($element);
3216
                    ?>
3217
				</div>
6544 nelberth 3218
                <div class="contenido form-group " id="contenido"></div>
1 www 3219
      		</div>
3220
 
6125 nelberth 3221
 
1 www 3222
          	<?php echo $this->form()->closeTag($form); ?>
3223
</div>
3224
 
6523 nelberth 3225
<div class='imageType' id="company-microlearning-slide-image-edit-box" style='display:none' >
6505 nelberth 3226
            <?php
3227
    	    $form = $this->formImageEdit;
3228
    	    $form->setAttributes([
3229
    	       'method'    => 'post',
3230
    	       'name'      => 'form-slide-image-edit',
3231
    	       'id'        => 'form-slide-image-edit'
3232
    	    ]);
3233
    	    $form->prepare();
3234
    	    echo $this->form()->openTag($form);
3235
 
3236
    	    $element = $form->get('type');
3237
    	    echo $this->formHidden($element);
3238
 
3239
    	    ?>
3240
            <!-- Modal Header -->
3241
            <div class="d-flex justify-content-center tituloEditor">
3242
              <h4>LABEL_EDIT_IMAGE_SLIDE</h4>
3243
 
3244
             </div>
3245
 
3246
            <!-- Modal body -->
3247
            <div class="grid-padre">
3248
                 <div class="form-group grid-1-2">
3249
    				<?php
3250
                        $element = $form->get('name');
3251
                        $element->setAttributes(['class' => 'form-control']);
3252
                        $element->setOptions(['label' => 'LABEL_NAME']);
3253
                        echo $this->formLabel($element);
3254
                        echo $this->formText($element);
3255
                    ?>
3256
				</div>
3257
 
3258
 
3259
                <?php
3260
                    $element = $form->get('file');
3261
					$element->setAttributes([ 'class' => 'file']);
3262
                    echo $this->formHidden($element);
3263
                ?>
3264
				<div class="form-group grid-1-2">
3265
    				<?php
3266
                        $element = $form->get('order');
3267
                        $element->setAttributes(['class' => 'form-control']);
3268
                        $element->setOptions(['label' => 'LABEL_ORDER']);
3269
                        echo $this->formLabel($element);
3270
                        echo $this->formText($element);
3271
                    ?>
3272
				</div>
6625 nelberth 3273
 
6569 nelberth 3274
                <div class="contenido form-group " id="contenido"></div>
6505 nelberth 3275
      		</div>
1 www 3276
 
6505 nelberth 3277
 
3278
          	<?php echo $this->form()->closeTag($form); ?>
3279
</div>
1 www 3280
 
3281
 
3282
<!-- The Modal -->
6523 nelberth 3283
 
1 www 3284
 
3285
 
3286
 
3287
<!-- The Modal -->
6618 nelberth 3288
<div  id="company-microlearning-slide-video-add-box"  style='display:none'>
3289
 
1 www 3290
    		<?php
3291
    	    $form = $this->formVideoAdd;
3292
    	    $form->setAttributes([
3293
    	       'method'    => 'post',
3294
    	        'name'      => 'form-slide-video-add',
3295
    	        'id'        => 'form-slide-video-add'
3296
    	    ]);
3297
    	    $form->prepare();
3298
    	    echo $this->form()->openTag($form);
3299
 
3300
    	    $element = $form->get('type');
3301
    	    echo $this->formHidden($element);
3302
 
3303
    	    ?>
6618 nelberth 3304
 
3305
              <div class="d-flex justify-content-center tituloEditor">
3306
              <h4>LABEL_ADD_VIDEO_SLIDE</h4>
1 www 3307
 
6618 nelberth 3308
             </div>
3309
            <div class="grid-padre">
3310
				<div class="form-group  grid-1-2">
1 www 3311
    				<?php
3312
                        $element = $form->get('name');
3313
                        $element->setAttributes(['class' => 'form-control']);
3314
                        $element->setOptions(['label' => 'LABEL_NAME']);
3315
                        echo $this->formLabel($element);
3316
                        echo $this->formText($element);
3317
                    ?>
3318
				</div>
6618 nelberth 3319
				<div class="form-group  grid-1-2">
1 www 3320
    				<?php
3321
                        $element = $form->get('order');
3322
                        $element->setAttributes(['class' => 'form-control']);
3323
                        $element->setOptions(['label' => 'LABEL_ORDER']);
3324
                        echo $this->formLabel($element);
3325
                        echo $this->formText($element);
3326
                    ?>
3327
				</div>
6618 nelberth 3328
				<div class="form-group  grid-1-2">
1 www 3329
 
3330
                 		<?php
3331
                        $element = $form->get('file');
3332
                        $element->setAttributes(['class' => 'form-control']);
3333
                        $element->setOptions(['label' => 'LABEL_VIDEO']);
3334
                        $element->setAttributes(['accept' => 'video/webm,video/mpeg,video/mp4']);
3335
                        echo $this->formLabel($element);
3336
                        ?>
3337
                        <div class="file-loading">
3338
                        <?php echo $this->formFile($element);?>
3339
                        </div>
3340
 
3341
          		</div>
6625 nelberth 3342
                  <?php
3343
                    $element = $form->get('background');
3344
					$element->setAttributes([ 'class' => 'background']);
3345
                    echo $this->formHidden($element);
3346
                ?>
6618 nelberth 3347
          		<div class="contenido form-group " id="contenido"></div>
1 www 3348
      		</div>
3349
 
3350
            <!-- Modal footer -->
6618 nelberth 3351
 
1 www 3352
          	<?php echo $this->form()->closeTag($form); ?>
6618 nelberth 3353
 
1 www 3354
</div>
3355
 
3356
 
3357
 
3358
 
3359
<!-- The Modal -->
3360
<div class="modal" id="company-microlearning-slide-video-edit-box">
3361
	<div class="modal-dialog   modal-xl">
3362
    	<div class="modal-content">
3363
        	<?php
3364
    	    $form = $this->formVideoEdit;
3365
    	    $form->setAttributes([
3366
    	       'method'    => 'post',
3367
    	       'name'      => 'form-slide-video-edit',
3368
    	       'id'        => 'form-slide-video-edit'
3369
    	    ]);
3370
    	    $form->prepare();
3371
    	    echo $this->form()->openTag($form);
3372
 
3373
    	    $element = $form->get('type');
3374
    	    echo $this->formHidden($element);
3375
 
3376
    	    ?>
3377
 
3378
            <!-- Modal Header -->
3379
      		<div class="modal-header">
3380
        		<h4 class="modal-title">LABEL_EDIT_VIDEO_SLIDE</h4>
3381
        		<button type="button" class="close" data-dismiss="modal">&times;</button>
3382
      		</div>
3383
 
3384
            <!-- Modal body -->
3385
            <div class="modal-body">
3386
				<div class="form-group">
3387
    				<?php
3388
                        $element = $form->get('name');
3389
                        $element->setAttributes(['class' => 'form-control']);
3390
                        $element->setOptions(['label' => 'LABEL_NAME']);
3391
                        echo $this->formLabel($element);
3392
                        echo $this->formText($element);
3393
                    ?>
3394
				</div>
3395
				<div class="form-group">
3396
    				<?php
3397
                        $element = $form->get('order');
3398
                        $element->setAttributes(['class' => 'form-control']);
3399
                        $element->setOptions(['label' => 'LABEL_ORDER']);
3400
                        echo $this->formLabel($element);
3401
                        echo $this->formText($element);
3402
                    ?>
3403
				</div>
3404
				<div class="form-group">
3405
 
3406
                 		<?php
3407
                        $element = $form->get('file');
3408
                        $element->setAttributes(['class' => 'form-control']);
3409
                        $element->setOptions(['label' => 'LABEL_VIDEO']);
3410
                        $element->setAttributes(['accept' => 'video/webm,video/mpeg,video/mp4']);
3411
                        echo $this->formLabel($element);
3412
                        ?>
3413
                        <div class="file-loading">
3414
                        <?php echo $this->formFile($element);?>
3415
                        </div>
3416
 
3417
          		</div>
3418
          		<div class="form-group">
3419
 
3420
                 		<?php
3421
                        $element = $form->get('background');
3422
                        $element->setAttributes(['class' => 'form-control']);
3423
                        $element->setOptions(['label' => 'LABEL_IMAGE_BACKGROUND']);
3424
                        $element->setAttributes(['accept' => 'image/jpg,image/jpeg,image/png']);
3425
                        echo $this->formLabel($element);
3426
                        ?>
3427
                        <div class="file-loading">
3428
                        <?php echo $this->formFile($element);?>
3429
                        </div>
3430
 
3431
          		</div>
3432
      		</div>
3433
 
3434
            <!-- Modal footer -->
3435
      		<div class="modal-footer">
3436
      			<button type="submit" class="btn btn-primary">LABEL_SAVE</button>
3437
        		<button type="button" class="btn btn-danger" data-dismiss="modal">Cerrar</button>
3438
          	</div>
3439
          	<?php echo $this->form()->closeTag($form); ?>
3440
         </div>
3441
	</div>
3442
</div>
3443
 
3444
 
3445
 
3446
 
3447
<!-- The Modal -->
3448
<div class="modal" id="company-microlearning-slide-document-add-box">
3449
	<div class="modal-dialog   modal-xl">
3450
    	<div class="modal-content">
3451
    		<?php
3452
    	    $form = $this->formDocumentAdd;
3453
    	    $form->setAttributes([
3454
    	       'method'    => 'post',
3455
    	        'name'      => 'form-slide-document-add',
3456
    	        'id'        => 'form-slide-document-add'
3457
    	    ]);
3458
    	    $form->prepare();
3459
    	    echo $this->form()->openTag($form);
3460
 
3461
    	    $element = $form->get('type');
3462
    	    echo $this->formHidden($element);
3463
 
3464
    	    ?>
3465
            <!-- Modal Header -->
3466
      		<div class="modal-header">
3467
        		<h4 class="modal-title">LABEL_ADD_DOCUMENT_SLIDE</h4>
3468
        		<button type="button" class="close" data-dismiss="modal">&times;</button>
3469
      		</div>
3470
 
3471
            <!-- Modal body -->
3472
            <div class="modal-body">
3473
				<div class="form-group">
3474
    				<?php
3475
                        $element = $form->get('name');
3476
                        $element->setAttributes(['class' => 'form-control']);
3477
                        $element->setOptions(['label' => 'LABEL_NAME']);
3478
                        echo $this->formLabel($element);
3479
                        echo $this->formText($element);
3480
                    ?>
3481
				</div>
3482
				<div class="form-group">
3483
    				<?php
3484
                        $element = $form->get('order');
3485
                        $element->setAttributes(['class' => 'form-control']);
3486
                        $element->setOptions(['label' => 'LABEL_ORDER']);
3487
                        echo $this->formLabel($element);
3488
                        echo $this->formText($element);
3489
                    ?>
3490
				</div>
3491
				<div class="form-group">
3492
 
3493
                 		<?php
3494
                        $element = $form->get('file');
3495
                        $element->setAttributes(['class' => 'form-control']);
3496
                        $element->setOptions(['label' => 'LABEL_DOCUMENT']);
3497
                        $element->setAttributes(['accept' => 'application/pdf']);
3498
                        echo $this->formLabel($element);
3499
                        ?>
3500
                        <div class="file-loading">
3501
                        <?php echo $this->formFile($element);?>
3502
                        </div>
3503
 
3504
          		</div>
3505
         		<div class="form-group">
3506
 
3507
                 		<?php
3508
                        $element = $form->get('background');
3509
                        $element->setAttributes(['class' => 'form-control']);
3510
                        $element->setOptions(['label' => 'LABEL_IMAGE_BACKGROUND']);
3511
                        $element->setAttributes(['accept' => 'image/jpg,image/jpeg,image/png']);
3512
                        echo $this->formLabel($element);
3513
                        ?>
3514
                        <div class="file-loading">
3515
                        <?php echo $this->formFile($element);?>
3516
                        </div>
3517
 
3518
          		</div>
3519
      		</div>
3520
 
3521
            <!-- Modal footer -->
3522
      		<div class="modal-footer">
3523
      			<button type="submit" class="btn btn-primary">LABEL_SAVE</button>
3524
        		<button type="button" class="btn btn-danger" data-dismiss="modal">Cerrar</button>
3525
          	</div>
3526
          	<?php echo $this->form()->closeTag($form); ?>
3527
         </div>
3528
	</div>
3529
</div>
3530
 
3531
 
3532
 
3533
 
3534
<!-- The Modal -->
3535
<div class="modal" id="company-microlearning-slide-document-edit-box">
3536
	<div class="modal-dialog   modal-xl">
3537
    	<div class="modal-content">
3538
    		<?php
3539
    	    $form = $this->formDocumentEdit;
3540
    	    $form->setAttributes([
3541
    	       'method'    => 'post',
3542
    	       'name'      => 'form-slide-document-edit',
3543
    	       'id'        => 'form-slide-document-edit'
3544
    	    ]);
3545
    	    $form->prepare();
3546
    	    echo $this->form()->openTag($form);
3547
 
3548
    	    $element = $form->get('type');
3549
    	    echo $this->formHidden($element);
3550
 
3551
    	    ?>
3552
            <!-- Modal Header -->
3553
      		<div class="modal-header">
3554
        		<h4 class="modal-title">LABEL_EDIT_DOCUMENT_SLIDE</h4>
3555
        		<button type="button" class="close" data-dismiss="modal">&times;</button>
3556
      		</div>
3557
 
3558
            <!-- Modal body -->
3559
            <div class="modal-body">
3560
				<div class="form-group">
3561
    				<?php
3562
                        $element = $form->get('name');
3563
                        $element->setAttributes(['class' => 'form-control']);
3564
                        $element->setOptions(['label' => 'LABEL_NAME']);
3565
                        echo $this->formLabel($element);
3566
                        echo $this->formText($element);
3567
                    ?>
3568
				</div>
3569
				<div class="form-group">
3570
    				<?php
3571
                        $element = $form->get('order');
3572
                        $element->setAttributes(['class' => 'form-control']);
3573
                        $element->setOptions(['label' => 'LABEL_ORDER']);
3574
                        echo $this->formLabel($element);
3575
                        echo $this->formText($element);
3576
                    ?>
3577
				</div>
3578
				<div class="form-group">
3579
 
3580
                 		<?php
3581
                        $element = $form->get('file');
3582
                        $element->setAttributes(['class' => 'form-control']);
3583
                        $element->setOptions(['label' => 'LABEL_DOCUMENT']);
3584
                        $element->setAttributes(['accept' => 'application/pdf']);
3585
                        echo $this->formLabel($element);
3586
                        ?>
3587
                        <div class="file-loading">
3588
                        <?php echo $this->formFile($element);?>
3589
                        </div>
3590
 
3591
          		</div>
3592
         		<div class="form-group">
3593
 
3594
                 		<?php
3595
                        $element = $form->get('background');
3596
                        $element->setAttributes(['class' => 'form-control']);
3597
                        $element->setOptions(['label' => 'LABEL_IMAGE_BACKGROUND']);
3598
                        $element->setAttributes(['accept' => 'image/jpg,image/jpeg,image/png']);
3599
                        echo $this->formLabel($element);
3600
                        ?>
3601
                        <div class="file-loading">
3602
                        <?php echo $this->formFile($element);?>
3603
                        </div>
3604
 
3605
          		</div>
3606
      		</div>
3607
 
3608
            <!-- Modal footer -->
3609
      		<div class="modal-footer">
3610
      			<button type="submit" class="btn btn-primary">LABEL_SAVE</button>
3611
        		<button type="button" class="btn btn-danger" data-dismiss="modal">Cerrar</button>
3612
          	</div>
3613
          	<?php echo $this->form()->closeTag($form); ?>
3614
         </div>
3615
	</div>
3616
</div>
3617
 
3618
 
3619
 
3620
<!-- The Modal -->
3621
<div class="modal" id="company-microlearning-slide-audio-add-box">
3622
	<div class="modal-dialog   modal-xl">
3623
    	<div class="modal-content">
3624
    		<?php
3625
    	    $form = $this->formAudioAdd;
3626
    	    $form->setAttributes([
3627
    	       'method'    => 'post',
3628
    	        'name'      => 'form-slide-audio-add',
3629
    	        'id'        => 'form-slide-audio-add'
3630
    	    ]);
3631
    	    $form->prepare();
3632
    	    echo $this->form()->openTag($form);
3633
 
3634
    	    $element = $form->get('type');
3635
    	    echo $this->formHidden($element);
3636
 
3637
    	    ?>
3638
            <!-- Modal Header -->
3639
      		<div class="modal-header">
3640
        		<h4 class="modal-title">LABEL_ADD_AUDIO_SLIDE</h4>
3641
        		<button type="button" class="close" data-dismiss="modal">&times;</button>
3642
      		</div>
3643
 
3644
            <!-- Modal body -->
3645
            <div class="modal-body">
3646
				<div class="form-group">
3647
    				<?php
3648
                        $element = $form->get('name');
3649
                        $element->setAttributes(['class' => 'form-control']);
3650
                        $element->setOptions(['label' => 'LABEL_NAME']);
3651
                        echo $this->formLabel($element);
3652
                        echo $this->formText($element);
3653
                    ?>
3654
				</div>
3655
				<div class="form-group">
3656
    				<?php
3657
                        $element = $form->get('order');
3658
                        $element->setAttributes(['class' => 'form-control']);
3659
                        $element->setOptions(['label' => 'LABEL_ORDER']);
3660
                        echo $this->formLabel($element);
3661
                        echo $this->formText($element);
3662
                    ?>
3663
				</div>
3664
				<div class="form-group">
3665
 
3666
                 		<?php
3667
                        $element = $form->get('file');
3668
                        $element->setAttributes(['class' => 'form-control']);
3669
                        $element->setOptions(['label' => 'LABEL_AUDIO']);
3670
                        $element->setAttributes(['accept' => 'audio/x-wav, audio/mpeg']);
3671
                        echo $this->formLabel($element);
3672
                        ?>
3673
                        <div class="file-loading">
3674
                        <?php echo $this->formFile($element);?>
3675
                        </div>
3676
 
3677
          		</div>
3678
          		<div class="form-group">
3679
 
3680
                 		<?php
3681
                        $element = $form->get('background');
3682
                        $element->setAttributes(['accept' => 'image/jpg,image/jpeg,image/png']);
3683
                        $element->setAttributes(['class' => 'form-control']);
3684
                        $element->setOptions(['label' => 'LABEL_IMAGE_BACKGROUND']);
3685
                        echo $this->formLabel($element);
3686
                        ?>
3687
                        <div class="file-loading">
3688
                        <?php echo $this->formFile($element);?>
3689
                        </div>
3690
 
3691
          		</div>
3692
      		</div>
3693
 
3694
            <!-- Modal footer -->
3695
      		<div class="modal-footer">
3696
      			<button type="submit" class="btn btn-primary">LABEL_SAVE</button>
3697
        		<button type="button" class="btn btn-danger" data-dismiss="modal">Cerrar</button>
3698
          	</div>
3699
          	<?php echo $this->form()->closeTag($form); ?>
3700
         </div>
3701
	</div>
3702
</div>
3703
 
3704
 
3705
 
3706
 
3707
 
3708
<!-- The Modal -->
3709
<div class="modal" id="company-microlearning-slide-audio-edit-box">
3710
	<div class="modal-dialog   modal-xl">
3711
    	<div class="modal-content">
3712
        	<?php
3713
    	    $form = $this->formAudioEdit;
3714
    	    $form->setAttributes([
3715
    	       'method'    => 'post',
3716
    	       'name'      => 'form-slide-audio-edit',
3717
    	       'id'        => 'form-slide-audio-edit'
3718
    	    ]);
3719
    	    $form->prepare();
3720
    	    echo $this->form()->openTag($form);
3721
 
3722
    	    $element = $form->get('type');
3723
    	    echo $this->formHidden($element);
3724
 
3725
    	    ?>
3726
 
3727
            <!-- Modal Header -->
3728
      		<div class="modal-header">
3729
        		<h4 class="modal-title">LABEL_EDIT_AUDIO_SLIDE</h4>
3730
        		<button type="button" class="close" data-dismiss="modal">&times;</button>
3731
      		</div>
3732
 
3733
            <!-- Modal body -->
3734
            <div class="modal-body">
3735
				<div class="form-group">
3736
    				<?php
3737
                        $element = $form->get('name');
3738
                        $element->setAttributes(['class' => 'form-control']);
3739
                        $element->setOptions(['label' => 'LABEL_ORDER']);
3740
                        echo $this->formLabel($element);
3741
                        echo $this->formText($element);
3742
                    ?>
3743
				</div>
3744
				<div class="form-group">
3745
    				<?php
3746
                        $element = $form->get('order');
3747
                        $element->setAttributes(['class' => 'form-control']);
3748
                        $element->setOptions(['label' => 'LABEL_ORDER']);
3749
                        echo $this->formLabel($element);
3750
                        echo $this->formText($element);
3751
                    ?>
3752
				</div>
3753
				<div class="form-group">
3754
 
3755
                 		<?php
3756
                        $element = $form->get('file');
3757
                        $element->setAttributes(['class' => 'form-control']);
3758
                        $element->setOptions(['label' => 'LABEL_AUDIO']);
3759
                        $element->setAttributes(['accept' => 'audio/x-wav, audio/mpeg']);
3760
                        echo $this->formLabel($element);
3761
                        ?>
3762
                        <div class="file-loading">
3763
                        <?php echo $this->formFile($element);?>
3764
                        </div>
3765
 
3766
          		</div>
3767
          		<div class="form-group">
3768
 
3769
                 		<?php
3770
                        $element = $form->get('background');
3771
                        $element->setAttributes(['class' => 'form-control']);
3772
                        $element->setOptions(['label' => 'LABEL_IMAGE_BACKGROUND']);
3773
                        $element->setAttributes(['accept' => 'image/jpg,image/jpeg,image/png']);
3774
                        echo $this->formLabel($element);
3775
                        ?>
3776
                        <div class="file-loading">
3777
                        <?php echo $this->formFile($element);?>
3778
                        </div>
3779
 
3780
          		</div>
3781
      		</div>
3782
 
3783
            <!-- Modal footer -->
3784
      		<div class="modal-footer">
3785
      			<button type="submit" class="btn btn-primary">LABEL_SAVE</button>
3786
        		<button type="button" class="btn btn-danger" data-dismiss="modal">Cerrar</button>
3787
          	</div>
3788
          	<?php echo $this->form()->closeTag($form); ?>
3789
         </div>
3790
	</div>
3791
</div>
3792
 
3793
 
3794
 
3795
<!-- The Modal -->
3796
<div class="modal" id="company-microlearning-slide-quizz-add-box">
3797
	<div class="modal-dialog   modal-xl">
3798
    	<div class="modal-content">
3799
    		<?php
3800
    	    $form = $this->formQuizzAdd;
3801
    	    $form->setAttributes([
3802
    	       'method'    => 'post',
3803
    	        'name'      => 'form-slide-quizz-add',
3804
    	        'id'        => 'form-slide-quizz-add'
3805
    	    ]);
3806
    	    $form->prepare();
3807
    	    echo $this->form()->openTag($form);
3808
 
3809
    	    $element = $form->get('type');
3810
    	    echo $this->formHidden($element);
3811
 
3812
    	    ?>
3813
            <!-- Modal Header -->
3814
      		<div class="modal-header">
3815
        		<h4 class="modal-title">LABEL_ADD_QUIZ_SLIDE</h4>
3816
        		<button type="button" class="close" data-dismiss="modal">&times;</button>
3817
      		</div>
3818
 
3819
            <!-- Modal body -->
3820
            <div class="modal-body">
3821
				<div class="form-group">
3822
    				<?php
3823
                        $element = $form->get('name');
3824
                        $element->setAttributes(['class' => 'form-control']);
3825
                        $element->setOptions(['label' => 'LABEL_NAME']);
3826
                        echo $this->formLabel($element);
3827
                        echo $this->formText($element);
3828
                    ?>
3829
				</div>
3830
				<div class="form-group">
3831
    				<?php
3832
                        $element = $form->get('order');
3833
                        $element->setAttributes(['class' => 'form-control']);
3834
                        $element->setOptions(['label' => 'LABEL_ORDER']);
3835
                        echo $this->formLabel($element);
3836
                        echo $this->formText($element);
3837
                    ?>
3838
				</div>
3839
          		<div class="form-group">
3840
 
3841
                 		<?php
3842
                        $element = $form->get('background');
3843
                        $element->setAttributes(['class' => 'form-control']);
3844
                        $element->setOptions(['label' => 'LABEL_IMAGE_BACKGROUND']);
3845
                        $element->setAttributes(['accept' => 'image/jpg,image/jpeg,image/png']);
3846
                        echo $this->formLabel($element);
3847
                        ?>
3848
                        <div class="file-loading">
3849
                        <?php echo $this->formFile($element);?>
3850
                        </div>
3851
 
3852
          		</div>
3853
				<div class="form-group">
3854
    				<?php
3855
                        $element = $form->get('quiz_id');
3856
                        $element->setAttributes(['class' => 'form-control']);
3857
                        $element->setOptions(['label' => 'LABEL_QUIZ']);
3858
                        echo $this->formLabel($element);
3859
                        echo $this->formSelect($element);
3860
                    ?>
3861
				</div>
3862
      		</div>
3863
 
3864
            <!-- Modal footer -->
3865
      		<div class="modal-footer">
3866
      			<button type="submit" class="btn btn-primary">LABEL_SAVE</button>
3867
        		<button type="button" class="btn btn-danger" data-dismiss="modal">Cerrar</button>
3868
          	</div>
3869
          	<?php echo $this->form()->closeTag($form); ?>
3870
         </div>
3871
	</div>
3872
</div>
3873
 
3874
 
3875
 
3876
<!-- The Modal -->
3877
<div class="modal" id="company-microlearning-slide-quizz-edit-box">
3878
	<div class="modal-dialog   modal-xl">
3879
    	<div class="modal-content">
3880
        	<?php
3881
    	    $form = $this->formQuizzEdit;
3882
    	    $form->setAttributes([
3883
    	       'method'    => 'post',
3884
    	       'name'      => 'form-slide-quizz-edit',
3885
    	       'id'        => 'form-slide-quizz-edit'
3886
    	    ]);
3887
    	    $form->prepare();
3888
    	    echo $this->form()->openTag($form);
3889
 
3890
    	    $element = $form->get('type');
3891
    	    echo $this->formHidden($element);
3892
 
3893
    	    ?>
3894
 
3895
            <!-- Modal Header -->
3896
      		<div class="modal-header">
3897
        		<h4 class="modal-title">LABEL_EDIT_QUIZ_SLIDE</h4>
3898
        		<button type="button" class="close" data-dismiss="modal">&times;</button>
3899
      		</div>
3900
 
3901
            <!-- Modal body -->
3902
            <div class="modal-body">
3903
				<div class="form-group">
3904
    				<?php
3905
                        $element = $form->get('name');
3906
                        $element->setAttributes(['class' => 'form-control']);
3907
                        $element->setOptions(['label' => 'LABEL_NAME']);
3908
                        echo $this->formLabel($element);
3909
                        echo $this->formText($element);
3910
                    ?>
3911
				</div>
3912
				<div class="form-group">
3913
    				<?php
3914
                        $element = $form->get('order');
3915
                        $element->setAttributes(['class' => 'form-control']);
3916
                        $element->setOptions(['label' => 'LABEL_ORDER']);
3917
                        echo $this->formLabel($element);
3918
                        echo $this->formText($element);
3919
                    ?>
3920
				</div>
3921
          		<div class="form-group">
3922
 
3923
                 		<?php
3924
                        $element = $form->get('background');
3925
                        $element->setAttributes(['class' => 'form-control']);
3926
                        $element->setOptions(['label' => 'LABEL_IMAGE_BACKGROUND']);
3927
                        $element->setAttributes(['accept' => 'image/jpg,image/jpeg,image/png']);
3928
                        echo $this->formLabel($element);
3929
                        ?>
3930
                        <div class="file-loading">
3931
                        <?php echo $this->formFile($element);?>
3932
                        </div>
3933
 
3934
          		</div>
3935
				<div class="form-group">
3936
    				<?php
3937
                        $element = $form->get('quiz_id');
3938
                        $element->setAttributes(['class' => 'form-control']);
3939
                        $element->setOptions(['label' => 'LABEL_QUIZ']);
3940
                        echo $this->formLabel($element);
3941
                        echo $this->formSelect($element);
3942
                    ?>
3943
				</div>
3944
 
3945
 
3946
      		</div>
3947
 
3948
            <!-- Modal footer -->
3949
      		<div class="modal-footer">
3950
      			<button type="submit" class="btn btn-primary">LABEL_SAVE</button>
3951
        		<button type="button" class="btn btn-danger" data-dismiss="modal">Cerrar</button>
3952
          	</div>
3953
 
3954
          	<?php echo $this->form()->closeTag($form); ?>
3955
         </div>
3956
	</div>
3957
</div>
3958
 
3959
 
3960
 
3961
<!-- The Modal -->
3962
<div class="modal" id="company-microlearning-play-video-box">
3963
	<div class="modal-dialog ">
3964
    	<div class="modal-content">
3965
 
3966
            <!-- Modal Header -->
3967
      		<div class="modal-header">
3968
        		<h4 class="modal-title">LABEL_PLAY_VIDEO</h4>
3969
        		<button type="button" class="close" data-dismiss="modal">&times;</button>
3970
      		</div>
3971
 
3972
            <!-- Modal body -->
3973
            <div class="modal-body">
3974
				<video src=""  style="width: 300px; height: auto" controls preload="false" autoplay="false"  poster="" id="microlearning-play-video"></video>
3975
      		</div>
3976
 
3977
            <!-- Modal footer -->
3978
      		<div class="modal-footer">
3979
        		<button type="button" class="btn btn-danger" data-dismiss="modal">Cerrar</button>
3980
          	</div>
3981
         </div>
3982
	</div>
3983
</div>
3984
 
3985
 
3986
 
3987
 
3988
 
3989
<!-- The Modal -->
3990
<div class="modal" id="company-microlearning-play-audio-box">
3991
	<div class="modal-dialog ">
3992
    	<div class="modal-content">
3993
 
3994
            <!-- Modal Header -->
3995
      		<div class="modal-header">
3996
        		<h4 class="modal-title">LABEL_PLAY_AUDIO</h4>
3997
        		<button type="button" class="close" data-dismiss="modal">&times;</button>
3998
      		</div>
3999
 
4000
            <!-- Modal body -->
4001
            <div class="modal-body">
4002
				<audio src="" controls autoplay="false"  id="microlearning-play-audio" >
4003
                  Your browser does not support the <code>audio</code> element.
4004
                </audio>
4005
      		</div>
4006
 
4007
            <!-- Modal footer -->
4008
      		<div class="modal-footer">
4009
        		<button type="button" class="btn btn-danger" data-dismiss="modal">Cerrar</button>
4010
          	</div>
4011
         </div>
4012
	</div>
4013
</div>
4014
 
4015
 
4016
<!-- The Modal -->
4017
<div class="modal" id="company-microlearning-view-image-box">
4018
	<div class="modal-dialog ">
4019
    	<div class="modal-content">
4020
 
4021
            <!-- Modal Header -->
4022
      		<div class="modal-header">
6108 nelberth 4023
        		<h4 class="modal-title">LABEL_IMAGE</h4>
1 www 4024
        		<button type="button" class="close" data-dismiss="modal">&times;</button>
4025
      		</div>
4026
 
4027
            <!-- Modal body -->
4028
            <div class="modal-body text-center">
4029
				<img src="" class="img img-responsive" style="width: 300px; height: auto" id="image-view" />
4030
      		</div>
4031
 
4032
            <!-- Modal footer -->
4033
      		<div class="modal-footer">
4034
        		<button type="button" class="btn btn-danger" data-dismiss="modal">Cerrar</button>
4035
          	</div>
4036
         </div>
4037
	</div>
4038
</div>
4039
 
4040
 
4041
<!-- The Modal -->
4042
<div class="modal" id="company-microlearning-view-document-box">
4043
	<div class="modal-dialog ">
4044
    	<div class="modal-content">
4045
 
4046
            <!-- Modal Header -->
4047
      		<div class="modal-header">
4048
        		<h4 class="modal-title">LABEL_DOCUMENT</h4>
4049
        		<button type="button" class="close" data-dismiss="modal">&times;</button>
4050
      		</div>
4051
 
4052
            <!-- Modal body -->
4053
            <div class="modal-body text-center">
4054
            	<iframe id="document-view" style="width: 450px; height: 300px; scroll: auto">
4055
 
4056
            	</iframe>
4057
       	</div>
4058
 
4059
            <!-- Modal footer -->
4060
      		<div class="modal-footer">
4061
        		<button type="button" class="btn btn-danger" data-dismiss="modal">Cerrar</button>
4062
          	</div>
4063
         </div>
4064
	</div>
4065
</div>
4066
 
4067
 
4068
<!-- The Modal -->
4069
<div class="modal" id="company-microlearning-view-text-box">
4070
	<div class="modal-dialog modal-xl">
4071
    	<div class="modal-content">
4072
 
4073
            <!-- Modal Header -->
4074
      		<div class="modal-header">
4075
        		<h4 class="modal-title">LABEL_TEXT</h4>
4076
        		<button type="button" class="close" data-dismiss="modal">&times;</button>
4077
      		</div>
4078
 
4079
            <!-- Modal body -->
4080
            <div class="modal-body" >
4081
            	<div id="document-text" style="width: 100%; height: 300px; scroll: auto; overflow: auto;">
4082
 
4083
 
4084
            	</div>
4085
 
4086
       	</div>
4087
 
4088
            <!-- Modal footer -->
4089
      		<div class="modal-footer">
4090
        		<button type="button" class="btn btn-danger" data-dismiss="modal">Cerrar</button>
4091
          	</div>
4092
         </div>
4093
	</div>
4094
</div>
4095
 
4096
 
4097
<!-- The Modal -->
4098
<div class="modal" id="company-microlearning-add-capsule-type-box">
4099
	<div class="modal-dialog ">
4100
    	<div class="modal-content">
4101
 
4102
            <!-- Modal Header -->
4103
      		<div class="modal-header">
6092 nelberth 4104
        		<h4 class="modal-title">LABEL_ADD_CAPSULE_SELECT_TYPE</h4>
1 www 4105
        		<button type="button" class="close" data-dismiss="modal">&times;</button>
4106
      		</div>
4107
 
4108
            <!-- Modal body -->
4109
            <div class="modal-body">
4110
				<table style="width: 100%">
4111
					<tr>
4112
      					<td class="text-left" ><button type="button" class="btn btn-primary btn-add-text"> Texto </button></td>
4113
      					<td class="text-left" ><button type="button" class="btn btn-primary btn-add-image"> Imagén </button></td>
4114
      				</tr>
4115
      				<tr>
4116
						<td class="text-left" ><button type="button" class="btn btn-primary btn-add-video"> Video </button></td>
4117
						<td class="text-left" ><button type="button" class="btn btn-primary btn-add-audio"> Audio </button></td>
4118
					</tr>
4119
					<tr>
4120
						<td class="text-left" ><button type="button" class="btn btn-primary btn-add-document"> Documento </button></td>
4121
        				<td class="text-left" ><button type="button" class="btn btn-primary btn-add-quizz"> Cuestionario </button></td>
4122
        			</tr>
4123
                </table>
4124
      		</div>
4125
 
4126
            <!-- Modal footer -->
4127
      		<div class="modal-footer">
4128
        		<button type="button" class="btn btn-danger" data-dismiss="modal">LABEL_CLOSE</button>
4129
          	</div>
4130
         </div>
4131
	</div>
4132
</div>
4133
 
4134
 
4135
 
4136
 
4137