Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 6644 | Rev 6646 | Ir a la última revisión | | Comparar con el anterior | Ultima modificación | Ver Log |

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