Proyectos de Subversion LeadersLinked - Backend

Rev

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