Proyectos de Subversion LeadersLinked - Backend

Rev

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