Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 11043 | Rev 11045 | 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
 
5
$roleName = $currentUser->getUserTypeId();
6
 
7
 
8
 
9
$routeDatatable = $this->url('microlearning/content/capsules');
10
 
11
$allowAdd       = $acl->isAllowed($roleName, 'microlearning/content/capsules/add') ? 1 : 0;
12
$allowEdit      = $acl->isAllowed($roleName, 'microlearning/content/capsules/edit') ? 1 : 0;
13
$allowDelete    = $acl->isAllowed($roleName, 'microlearning/content/capsules/delete') ? 1 : 0;
14
$allowUsers     = $acl->isAllowed($roleName, 'microlearning/content/capsules/users') ? 1 : 0;
15
 
16
 
17
 
18
$this->headLink()->appendStylesheet($this->basePath('plugins/nprogress/nprogress.css'));
19
$this->inlineScript()->appendFile($this->basePath('plugins/nprogress/nprogress.js'));
20
 
21
$this->inlineScript()->appendFile($this->basePath('plugins/ckeditor/ckeditor.js'));
22
 
23
 
24
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-fileinput/css/fileinput.min.css'));
25
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-fileinput/themes/explorer-fas/theme.css'));
26
 
27
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/js/plugins/piexif.js'));
28
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/js/plugins/sortable.js'));
29
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/js/fileinput.js'));
30
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/js/locales/es.js'));
31
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/themes/fas/theme.js'));
32
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/themes/explorer-fas/theme.js'));
33
 
34
 
35
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/jquery.validate.js'));
36
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/additional-methods.js'));
37
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/localization/messages_es.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
 
6701 nelberth 47
$this->headLink()->appendStylesheet($this->basePath('plugins/nelberth-editor/style.css'));
1 www 48
 
49
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap4-toggle/css/bootstrap4-toggle.min.css'));
50
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap4-toggle/js/bootstrap4-toggle.min.js'));
51
 
52
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-confirmation/dist/bootstrap-confirmation.js'));
53
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-checkbox/awesome-bootstrap-checkbox.css'));
54
 
55
 
56
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-input-number/input-number-format.jquery.js'));
57
 
58
 
59
$this->headStyle()->captureStart();
60
echo <<<CSS
61
 
62
 
63
#gridTableUsers {
64
    display: flex;
65
    flex-flow: column;
66
    width: 100%;
67
}
68
 
69
#gridTableUsers thead {
70
    flex: 0 0 auto;
71
}
72
 
73
#gridTableUsers tbody {
74
    flex: 1 1 auto;
75
    display: block;
76
    overflow-y: auto;
77
    overflow-x: hidden;
78
}
79
 
80
#gridTableUsers tr {
81
    width: 100%;
82
    display: table;
83
    table-layout: fixed;
84
}
6903 nelberth 85
.imagen-contaner{
86
	border:1px solid rgb(200,200,200);
87
	border-radius:5px;
6917 nelberth 88
	padding:10px;
89
	display:flex;
90
	flex-flow:column;
91
	align-items:center;
6903 nelberth 92
}
1 www 93
CSS;
94
$this->headStyle()->captureEnd();
95
 
96
$this->headLink()->captureStart();
97
 
98
$this->inlineScript()->captureStart();
99
echo <<<JS
100
    jQuery( document ).ready(function( $ ) {
101
 
102
        $.validator.setDefaults({
103
            debug: true,
104
            highlight: function(element) {
105
                $(element).addClass('is-invalid');
106
            },
107
            unhighlight: function(element) {
108
                $(element).removeClass('is-invalid');
109
            },
110
            errorElement: 'span',
111
            errorClass: 'error invalid-feedback',
112
            errorPlacement: function(error, element) {
113
                if(element.parent('.btn-file').length) {
114
                    error.insertAfter(element.parent().parent());
115
                } else if(element.parent('.toggle').length) {
116
                    error.insertAfter(element.parent().parent());
117
                } else {
118
                    error.insertAfter(element.parent());
119
                }
120
            }
121
        });
122
 
123
 
124
        $.fn.showFormErrorValidator = function(fieldname, errors) {
125
            var field = $(fieldname);
126
            if(field) {
127
                $(field).addClass('is-invalid');
128
 
129
 
130
                var error = $('<span id="' + fieldname +'-error" class="error invalid-feedback">' + errors + '</div>');
131
                if(element.parent('.btn-file').length) {
132
                    error.insertAfter(element.parent().parent());
133
                } else if(element.parent('.toggle').length) {
134
                    error.insertAfter(element.parent().parent());
135
                } else {
136
                    error.insertAfter(element.parent());
137
                }
138
            }
139
        };
140
 
141
 
142
 
143
        var allowEdit   = $allowEdit;
144
        var allowDelete = $allowDelete;
145
        var allowUsers  = $allowUsers;
146
 
147
 
148
        var gridTable = $('#gridTable').dataTable( {
149
            'processing': true,
150
            'serverSide': true,
151
            'searching': true,
152
            'order': [[ 0, 'asc' ]],
153
            'ordering':  true,
154
            'ordenable' : true,
155
            'responsive': true,
156
            'select' : false,
157
        	'paging': true,
158
            'pagingType': 'simple_numbers',
159
 
160
    		'ajax': {
161
    			'url' : '$routeDatatable',
162
    			'type' : 'get',
163
                'data': function ( d ) {
164
                    d.topic_uuid = $('#form-filter #topic_uuid').val();
165
 
166
                },
167
                'beforeSend': function (request) {
168
                  NProgress.start();
169
                },
170
                'dataFilter': function(response) {
171
                    var response = jQuery.parseJSON( response );
172
 
173
                    var json                = {};
174
                    json.recordsTotal       = 0;
175
                    json.recordsFiltered    = 0;
176
                    json.data               = [];
177
 
178
                    if(response.success) {
179
                        $('#form-capsule-add').attr('action', response.data.link_add );
180
 
181
                        json.recordsTotal       = response.data.total;
182
                        json.recordsFiltered    = response.data.total;
183
                        json.data               = response.data.items;
184
                    } else {
185
                        $.fn.showError(response.data)
186
                    }
187
 
188
                    return JSON.stringify( json );
189
                }
190
    		},
191
            'language' : {
192
                'sProcessing':     'LABEL_DATATABLE_SPROCESSING',
193
                'sLengthMenu':     'LABEL_DATATABLE_SLENGTHMENU',
194
                'sZeroRecords':    'LABEL_DATATABLE_SZERORECORDS',
195
                'sEmptyTable':     'LABEL_DATATABLE_SEMPTYTABLE',
196
                'sInfo':           'LABEL_DATATABLE_SINFO',
197
                'sInfoEmpty':      'LABEL_DATATABLE_SINFOEMPTY',
198
                'sInfoFiltered':   'LABEL_DATATABLE_SINFOFILTERED',
199
                'sInfoPostFix':    '',
200
                'sSearch':         'LABEL_DATATABLE_SSEARCH',
201
                'sUrl':            '',
202
                'sInfoThousands':  ',',
203
                'sLoadingRecords': 'LABEL_DATATABLE_SLOADINGRECORDS',
204
                'oPaginate': {
205
                    'sFirst':    'LABEL_DATATABLE_SFIRST',
206
                    'sLast':     'LABEL_DATATABLE_SLAST',
207
                    'sNext':     'LABEL_DATATABLE_SNEXT',
208
                    'sPrevious': 'LABEL_DATATABLE_SPREVIOUS'
209
                },
210
                'oAria': {
211
                    'sSortAscending':  ': LABEL_DATATABLE_SSORTASCENDING',
212
                    'sSortDescending': ':LABEL_DATATABLE_SSORTDESCENDING'
213
                },
214
            },
215
            'drawCallback': function( settings ) {
216
                NProgress.done();
217
                $('button.btn-delete').confirmation({
218
                    rootSelector: 'button.btn-delete',
219
                    title : 'LABEL_ARE_YOU_SURE',
220
                    singleton : true,
221
                    btnOkLabel: 'LABEL_YES',
222
                    btnCancelLabel: 'LABEL_NO',
223
                    onConfirm: function(value) {
224
                        action = $(this).data('href');
225
                        NProgress.start();
226
                        $.ajax({
227
                            'dataType'  : 'json',
228
                            'accept'    : 'application/json',
229
                            'method'    : 'post',
230
                            'url'       :  action,
231
                        }).done(function(response) {
232
                            if(response['success']) {
233
                                $.fn.showSuccess(response['data']);
234
                                gridTable.api().ajax.reload(null, false);
235
                            } else {
236
                                $.fn.showError(response['data']);
237
                            }
238
                        }).fail(function( jqXHR, textStatus, errorThrown) {
239
                            $.fn.showError(textStatus);
240
                        }).always(function() {
241
                            NProgress.done();
242
                        });
243
                    },
244
                });
245
            },
246
            'aoColumns': [
247
                { 'mDataProp': 'name' },
248
                { 'mDataProp': 'details' },
249
                { 'mDataProp': 'images' },
250
                { 'mDataProp': 'actions' },
251
    	    ],
252
            'columnDefs': [
253
                {
254
                    'targets': 0,
255
                    'className' : 'text-vertical-middle',
256
                },
257
                {
258
                    'targets': -3,
259
                    'orderable': false,
260
                    'render' : function ( data, type, row ) {
261
                        var s = '';
262
                        s += 'LABEL_STATUS: ' + data['status']  + '<br/>';
263
 
264
                         if(allowUsers && row['actions']['link_total_users']  ) {
265
                            s += 'LABEL_TOTAL_USERS: ' + data['total_users']  + ' <button class="btn btn-view-total-users" data-href="' + row['actions']['link_total_users'] + '" data-toggle="tooltip" title="LABEL_VIEW"><i class="fa fa-external-link"></i></button> <br>';
266
                         } else {
267
                            s += 'LABEL_TOTAL_USERS: ' + data['total_users']  + '<br/>';
268
                         }
269
                         if(allowUsers && row['actions']['link_total_users_actives']  ) {
270
                            s += 'LABEL_TOTAL_USERS_ACTIVE: ' + data['total_users_active']  + ' <button class="btn btn-view-total-users" data-href="' + row['actions']['link_total_users_actives'] + '" data-toggle="tooltip" title="LABEL_VIEW"><i class="fa fa-external-link"></i></button> <br>';
271
                         } else {
272
                            s += 'LABEL_TOTAL_USERS_ACTIVE: ' + data['total_users_active']  + '<br/>';
273
                         }
274
 
275
                        return s;
276
                    }
277
                },
278
                {
279
                    'targets': -2,
280
                    'orderable': false,
281
                    'render' : function ( data, type, row ) {
282
                        s = '';
283
 
6903 nelberth 284
						if( data['marketplace'] )  {
285
                            s = s + '&nbsp; <img class="btn-view-image-marketplace" data-href="' + data['marketplace'] + '" data-toggle="tooltip" src="'+data['marketplace']+'" title="LABEL_VIEW" style="width: 40px; object-fit: cover; height: 40px;" /> '
1 www 286
                        }  else {
287
                            s = s + '';
288
                        }
6903 nelberth 289
 
290
                        if( data['image'] )  {
291
                            s = s + '&nbsp; <img class="btn-view-image-app" data-href="' + data['image'] + '" data-toggle="tooltip" src="'+data['image']+'" title="LABEL_VIEW" style="width: 40px; object-fit: cover; height: 40px;" /> '
1 www 292
                        }  else {
293
                            s = s + '';
294
                        }
295
 
296
 
297
 
6903 nelberth 298
 
299
 
1 www 300
                        return s;
301
                    }
302
                },
303
 
304
 
305
                {
306
                    'targets': -1,
307
                    'orderable': false,
308
                    'render' : function ( data, type, row ) {
309
                        s = '';
310
 
311
                        if(allowEdit && data['link_edit']  ) {
312
                            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> LABEL_EDIT </button>&nbsp;';
313
                        }
314
                        if(allowDelete && data['link_delete']  ) {
315
                            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> LABEL_DELETE </button>&nbsp;';
316
                        }
317
 
318
                        return s;
319
                    }
320
                }
321
              ],
322
        });
323
 
324
 
6823 nelberth 325
        var seleccionarCampo;
1 www 326
    var validatorAdd = $('#form-capsule-add').validate({
327
        debug: true,
328
        onclick: false,
329
        onkeyup: false,
330
        ignore: [],
331
        rules: {
332
            'name': {
333
                required: true,
334
                maxlength: 128,
335
            },
336
            'description': {
337
                updateCkeditor:function() {
338
                        CKEDITOR.instances.description_add.updateElement();
339
                },
340
                required: true
341
            },
342
           'file': {
343
                required: true,
344
            },
345
            'order' : {
346
                required: true,
347
                digits: true,
348
                min: 1,
349
                max: 250
350
            },
351
           'marketplace': {
6861 nelberth 352
                required: true,
1 www 353
            },
354
            'status' : {
355
                required: true,
356
            },
357
            'privacy' : {
358
                required: true,
359
            },
360
            'type' : {
361
                required: true,
362
            },
363
            'cost' : {
364
                required: function() {
365
                    return $('#form-capsule-add #type').val() == 's';
366
                },
367
                'number' : true,
368
                'min' : 0
369
            }
370
        },
371
        submitHandler: function(form)
372
        {
373
            var formdata = false;
374
            if (window.FormData){
375
                formdata = new FormData(form); //form[0]);
376
            }
377
 
6948 nelberth 378
            $('#boton_recortar').prop('disabled', true);
6859 nelberth 379
			NProgress.start();
1 www 380
            $.ajax({
381
                'dataType'  : 'json',
382
                'accept'    : 'application/json',
383
                'method'    : 'post',
384
                'url'       :  $('#form-capsule-add').attr('action'),
385
                'data'      :  formdata,
386
                'processData': false,
387
                'contentType': false,
388
            }).done(function(response) {
389
                if(response['success']) {
390
                    $.fn.showSuccess(response['data']);
6932 nelberth 391
                       console.log(response)
6703 nelberth 392
                    $('body, html').animate({scrollTop: '0px'}, 300);
393
					$('#content1').css('display','block');
394
                    $('.contenido').html('');
395
            		seleccionarCampo.css('display','none');
7000 nelberth 396
					$('#titleTypeImage').html('LABEL_IMAGE_MARKETPLACE')
6997 nelberth 397
					$('.marketplaceImg').attr('src', '')
6946 nelberth 398
					fileToggle=true;
1 www 399
                    gridTable.api().ajax.reload(null, false);
400
                } else {
401
                    validatorAdd.resetForm();
402
                    if(jQuery.type(response['data']) == 'string') {
403
                        $.fn.showError(response['data']);
404
                    } else  {
405
                        $.each(response['data'], function( fieldname, errors ) {
406
                            $.fn.showFormErrorValidator('#form-capsule-add #' + fieldname, errors);
407
                        });
408
                    }
409
                }
410
            }).fail(function( jqXHR, textStatus, errorThrown) {
6936 nelberth 411
				console.log(jqXHR)
1 www 412
                $.fn.showError(textStatus);
413
            }).always(function() {
6949 nelberth 414
				$('#boton_recortar').prop('disabled', false);
1 www 415
                NProgress.done();
416
            });
417
            return false;
418
        },
419
        invalidHandler: function(form, validator) {
420
 
421
        }
422
    });
423
 
424
    var validatorEdit  = $('#form-capsule-edit').validate({
425
        debug: true,
426
        onclick: false,
427
        onkeyup: false,
428
        ignore: [],
429
        rules: {
430
              'name': {
431
                required: true,
432
                maxlength: 128,
433
            },
434
            'description': {
435
                updateCkeditor:function() {
436
                        CKEDITOR.instances.description_edit.updateElement();
437
                },
438
                required: true
439
            },
440
           'file': {
6990 nelberth 441
                required: true,
1 www 442
            },
443
            'order' : {
444
                required: true,
445
                digits: true,
446
                min: 1,
447
                max: 250
448
            },
449
           'marketplace': {
6990 nelberth 450
                required: true,
1 www 451
            },
452
            'status' : {
453
                required: true,
454
            },
455
            'privacy' : {
456
                required: true,
457
            },
458
            'type' : {
459
                required: true,
460
            },
461
            'cost' : {
462
                required: function() {
463
                    return $('#form-capsule-edit #type').val() == 's';
464
                },
465
                'number' : true,
466
                'min' : 0
467
            }
468
        },
469
        submitHandler: function(form)
470
        {
471
            var formdata = false;
472
            if (window.FormData){
473
                formdata = new FormData(form); //form[0]);
474
            }
475
 
6992 nelberth 476
			$('#boton_recortar').prop('disabled', true);
477
			NProgress.start();
1 www 478
            $.ajax({
479
                'dataType'  : 'json',
480
                'accept'    : 'application/json',
481
                'method'    : 'post',
482
                'url'       :  $('#form-capsule-edit').attr('action'),
483
                'data'      :  formdata,
484
                'processData': false,
485
                'contentType': false,
486
            }).done(function(response) {
487
                if(response['success']) {
488
                    $.fn.showSuccess(response['data']);
6993 nelberth 489
					console.log(response)
6990 nelberth 490
					$('body, html').animate({scrollTop: '0px'}, 300);
491
					$('#content1').css('display','block');
492
                    $('.contenido').html('');
493
            		seleccionarCampo.css('display','none');
7000 nelberth 494
					$('#titleTypeImage').html('LABEL_IMAGE_MARKETPLACE')
6997 nelberth 495
					$('.marketplaceImg').attr('src', '')
6990 nelberth 496
					fileToggle=true;
6996 nelberth 497
					imagenEdit='';
1 www 498
                    gridTable.api().ajax.reload(null, false);
499
                } else {
500
                    validatorAdd.resetForm();
501
                    if(jQuery.type(response['data']) == 'string') {
502
                        $.fn.showError(response['data']);
503
                    } else  {
504
                        $.each(response['data'], function( fieldname, errors ) {
505
                            $.fn.showFormErrorValidator('#form-capsule-edit #' + fieldname, errors);
506
                        });
507
                    }
508
                }
509
            }).fail(function( jqXHR, textStatus, errorThrown) {
6993 nelberth 510
				console.log(jqXHR)
1 www 511
                $.fn.showError(textStatus);
512
            }).always(function() {
6996 nelberth 513
 
6992 nelberth 514
				$('#boton_recortar').prop('disabled', false);
1 www 515
                NProgress.done();
516
            });
517
            return false;
518
        },
519
        invalidHandler: function(form, validator) {
520
 
521
        }
522
    });
523
 
524
 
525
 
526
        $('body').on('click', '.btn-view-image-marketplace', function(e) {
527
            e.preventDefault();
528
 
529
            $('#image-marketplace').attr('src', $(this).data('href'));
530
            $('#modalAppMarkeplate').modal('show');
531
            return false;
532
        });
533
 
534
        $('body').on('click', '.btn-view-image-app', function(e) {
535
            e.preventDefault();
536
 
537
            $('#image-app').attr('src', $(this).data('href'));
538
            $('#modalImageApp').modal('show');
539
            return false;
540
        });
541
 
542
        $('#form-capsule-add #order').inputNumberFormat({decimal: 0});
543
 
544
 
545
 
546
 
547
        $('body').on('click', 'button.btn-add', function(e) {
548
            e.preventDefault();
549
 
550
            $('#form-capsule-add #name').val('');
551
            $('#form-capsule-add #order').val('1');
552
 
553
            $('#form-capsule-add #privacy').val('');
554
            $('#form-capsule-add #status').val('');
555
            $('#form-capsule-add #cost').val('');
556
            $('#form-capsule-add #form-row-cost').hide();
557
 
558
            CKEDITOR.instances.description_add.setData('');
559
            validatorAdd.resetForm();
560
 
6694 nelberth 561
            $('body, html').animate({scrollTop: '0px'}, 300);
562
		    $('#content1').css('display','none');
563
            seleccionarCampo= $('#modalCapsuleAdd');
564
            seleccionarCampo.css('display','block')
565
		    iniciarEditor(seleccionarCampo)
1 www 566
            return false;
567
        });
568
 
569
 
570
        $('#form-capsule-edit #order').inputNumberFormat({decimal: 0});
571
 
6859 nelberth 572
 
1 www 573
 
6991 nelberth 574
 
1 www 575
 
576
        $('body').on('click', 'button.btn-edit', function(e) {
577
            e.preventDefault();
7045 nelberth 578
			NProgress.start();
1 www 579
            var url = $(this).data('href');
580
            $.ajax({
581
                'dataType'  : 'json',
582
                'accept'    : 'application/json',
583
                'method'    : 'get',
584
                'url'       :  url,
585
            }).done(function(response) {
586
                if(response['success']) {
6980 nelberth 587
					console.log(response)
1 www 588
                    $('#form-capsule-edit').attr('action',url);
589
                    $('#form-capsule-edit #name').val(response['data']['name']);
590
                    $('#form-capsule-edit #order').val(response['data']['order']);
591
                    $('#form-capsule-edit #privacy').val(response['data']['privacy']);
592
                    $('#form-capsule-edit #type').val(response['data']['type']);
593
                    $('#form-capsule-edit #status').val(response['data']['status']);
594
 
595
                    if('s' == response['data']['type']) {
596
                        $('#form-capsule-edit #form-row-cost').show();
597
                        $('#form-capsule-edit #cost').val(response['data']['cost']);
598
                    } else {
599
                        $('#form-capsule-edit #form-row-cost').hide();
600
                        $('#form-capsule-edit #cost').val('');
601
                    }
602
 
603
                    CKEDITOR.instances.description_edit.setData(response['data']['description']);
604
                    validatorEdit.resetForm();
6979 nelberth 605
					 fileToggle=true;
6975 nelberth 606
					$('body, html').animate({scrollTop: '0px'}, 300);
607
					$('#content1').css('display','none');
608
                    seleccionarCampo= $('#modalCapsuleEdit');
609
                    seleccionarCampo.css('display','block')
6984 nelberth 610
					imagenEdit=response['data']['image'];
6975 nelberth 611
		            iniciarEditor(seleccionarCampo,response['data']['marketplace'])
6984 nelberth 612
 
1 www 613
                } else {
614
                    validatorEdit.resetForm();
615
                    if(jQuery.type(response['data']) == 'string') {
616
                        $.fn.showError(response['data']);
617
                    } else  {
618
                        $.each(response['data'], function( fieldname, errors ) {
619
                            $.fn.showFormErrorValidator('#form-capsule-edit #' + fieldname, errors);
620
                        });
621
                    }
622
                }
623
            }).fail(function( jqXHR, textStatus, errorThrown) {
624
                $.fn.showError(textStatus);
625
            }).always(function() {
626
                NProgress.done();
627
            });
628
        });
629
 
6886 nelberth 630
 
1 www 631
 
632
 
8290 stevensc 633
        CKEDITOR.replace('description_add', {
634
			toolbar: [
635
                    { name: 'editing', items: ['Scayt'] },
636
                    { name: 'links', items: ['Link', 'Unlink'] },
637
                    { name: 'paragraph', items: ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote'] },
638
                    { name: 'basicstyles', items: ['Bold', 'Italic', 'Strike', 'RemoveFormat'] },
639
                    '/',
640
                    { name: 'insert', items: ['Image', 'Table', 'HorizontalRule', 'SpecialChar'] },
641
                    { name: 'styles', items: ['Styles', 'Format'] },
642
                    { name: 'tools', items: ['Maximize'] }
643
                ],
644
                removePlugins: 'elementspath,Anchor',
645
                heigth: 100
646
		});
647
        CKEDITOR.replace('description_edit', {
648
			toolbar: [
649
                    { name: 'editing', items: ['Scayt'] },
650
                    { name: 'links', items: ['Link', 'Unlink'] },
651
                    { name: 'paragraph', items: ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote'] },
652
                    { name: 'basicstyles', items: ['Bold', 'Italic', 'Strike', 'RemoveFormat'] },
653
                    '/',
654
                    { name: 'insert', items: ['Image', 'Table', 'HorizontalRule', 'SpecialChar'] },
655
                    { name: 'styles', items: ['Styles', 'Format'] },
656
                    { name: 'tools', items: ['Maximize'] }
657
                ],
658
                removePlugins: 'elementspath,Anchor',
659
                heigth: 100
660
		});
1 www 661
 
662
        $('#form-capsule-add #type').change(function(e) {
663
            e.preventDefault();
664
 
665
            if('s' == $(this).val()) {
666
                $('#form-capsule-add #form-row-cost').show();
667
            } else {
668
                $('#form-capsule-add #cost').val(0);
669
                $('#form-capsule-add #form-row-cost').hide();
670
            }
671
 
672
        });
673
 
674
        $('#form-capsule-edit #type').change(function(e) {
675
            e.preventDefault();
676
 
677
            if('s' == $(this).val()) {
678
                $('#form-capsule-edit #form-row-cost').show();
679
            } else {
680
                $('#form-capsule-edit #cost').val(0);
681
                $('#form-capsule-edit #form-row-cost').hide();
682
            }
683
 
684
        });
685
 
686
        $('#form-capsule-add #order').inputNumberFormat({decimal: 0});
687
        $('#form-capsule-add #cost').inputNumberFormat({decimal: 2});
688
 
689
        $('#form-filter #topic_uuid').change(function(e) {
690
            e.preventDefault();
691
 
692
            gridTable.api().ajax.reload(null, false);
693
 
694
        });
695
 
696
 
697
 
698
 
699
 
700
    $('body').on('click', 'button.btn-view-total-users', function(e) {
701
        e.preventDefault();
702
 
703
        var href = $(this).data('href');
704
        NProgress.start();
705
        $.ajax({
706
            'dataType'  : 'json',
707
            'accept'    : 'application/json',
708
            'method'    : 'get',
709
            'url'       : href,
710
        }).done(function(response) {
711
            if(response['success']) {
712
 
713
                $('#table-users-topic').val(response['data']['topic']);
714
      			$('#table-users-capsule').val(response['data']['capsule']);
715
 
716
                $('#gridTableUsers tbody').empty();
717
 
718
                $.each(response['data']['items'], function(index, item) {
719
 
720
                    console.log(item);
721
 
722
                    var s = '<tr>';
723
                    s = s + '<td>' + item['first_name'] + '</td>';
724
                    s = s + '<td>' + item['last_name'] + '</td>';
725
                    s = s + '<td>' + item['email'] + '</td>';
726
 
727
                    s = s + '<td>';
728
                    if(item['details']['access']) {
729
                        s = s + 'LABEL_ACCESS : ' + item['details']['access'] + '<br>';
730
                    }
731
                    if(item['details']['paid_from']) {
732
                        s = s + 'LABEL_PAID_FROM : ' + item['details']['paid_from'] + '<br>';
733
                    }
734
                    if(item['details']['paid_to']) {
735
                        s = s + 'LABEL_PAID_TO : ' + item['details']['paid_to'] + '<br>';
736
                    }
737
 
738
                    s = s + '</td>';
739
                    s = s + '</tr>';
740
 
741
                    $('#gridTableUsers tbody').append(s);
742
 
743
 
744
                });
745
 
746
                $('#notificationUsersModal').modal('show');
747
 
748
            } else {
749
                $.fn.showError(response['data']);
750
 
751
            }
752
        }).fail(function( jqXHR, textStatus, errorThrown) {
753
            $.fn.showError(textStatus);
754
        }).always(function() {
755
 
756
            NProgress.done();
757
        });
758
        return false;
759
 
760
    });
761
    $('body').on('click', 'button.btn-refresh', function(e) {
762
        e.preventDefault();
763
        gridTable.api().ajax.reload(null, false);
764
    });
6682 nelberth 765
       	/*Script del editor (Aqui comienza el cielo y la tierra) */
6863 nelberth 766
 
767
		var fileToggle=true;
6886 nelberth 768
		$('body').on('click', '#ir_atras', function(e) {
769
            e.preventDefault();
770
			if(fileToggle){
6985 nelberth 771
				imagenEdit='';
6886 nelberth 772
            	$('body, html').animate({scrollTop: '0px'}, 300);
773
				$('#content1').css('display','block');
774
           		seleccionarCampo.css('display','none');
775
            	$('.contenido').html('');
6997 nelberth 776
				$('.marketplaceImg').attr('src', '')
6886 nelberth 777
			}else{
7000 nelberth 778
				$('#titleTypeImage').html('LABEL_IMAGE_MARKETPLACE')
6997 nelberth 779
				$('.marketplaceImg').attr('src', '')
6964 nelberth 780
				fileToggle=true;
6890 nelberth 781
				iniciarEditor(seleccionarCampo,imagenServidorNoticia,false)
6964 nelberth 782
 
6886 nelberth 783
			}
784
            return false;
785
        });
6984 nelberth 786
		var imagenEdit='';
6682 nelberth 787
		var imagenServidorNoticia;
788
		var scroll_altura,viente;
789
		var nombre_user = $(".perfil_u_nombre").text();
790
		var primer_nombre = nombre_user.split(" ")[0];
11027 nelberth 791
		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 class="recortar_texto">LABEL_CUT</div><div id="blockCelda"><span class="fa fa-unlock"></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_TEXT</div><div class="fa fa-times" id="cerrar_text_modal"></div></div><div class="fonts mb-20"><select name="fuentes" id="selectFuente" class="select-custom mr-2"><option value="arial" selected>LABEL_FONT_ARIAL</option><option value="calibri">LABEL_FONT_CALIBRI</option><option value="forte">LABEL_FONT_FORTE</option><option value="impact">LABEL_FONT_IMPACT</option><option value="jokerman">LABEL_FONT_JOKERMAN</option><option value="mv boli">LABEL_FONT_MV_BOLI</option><option value="times new roman">LABEL_FONT_TIMES_NEW_ROMAN</option><option value="verdana">LABEL_FONT_VERDANA</option><option value="vivaldi">LABEL_FONT_VIVALDI</option></select><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 mb-20"> <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><div class="color_letra font"><label>A</label><input type="color" class="" data-tooltip="Color de la letra" name="" id="color" value="#ffffff"/></div><div class="font fa" data-tooltip="Sombra de la letra" id="shadow">S</div><div class="font" id="rectangulo" data-tooltip="Fondo de la letra"> <div class="rectangulo">F</div></div></div><div class="color_fondo_cuadro mb-20 flex-column" style="display:none"> <div class="w-100 d-flex justify-content-between border-bottom"><label for="colorrect" class="font-weight-normal d-flex align-items-center" style="margin:0 !important">LABEL_COLOR_BACKGROUND: </label><input type="color" name="" id="colorrect" value="#000000" style="width:30px" data-tooltip="Color del fondo" class="mr-2"/></div><div class="d-flex flex-column"><label for="opacidad" class="font-weight-normal mt-2">LABEL_BACKGROUND_TRANSPARENCY</label><input type="range" id="opacidad" max="100" min="1" step="1" value="100" ></div></div><input id="texto_input" type="text" name="texto" placeholder="LABEL_ADD_TEXT_HERE"/> </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 mb-20"> <div>LABEL_FILTERS</div><div class="fa fa-times" id="cerrar_filter_modal"></div></div><div class="fonts mb-20"> <select name="filtros" id="selectFiltro" class="select-custom"><option class="opcion_editor" value="normal">LABEL_FILTER_NORMAL</option><option class="opcion_editor" value=".5,1.3,1.31,1.33,1.38">LABEL_FILTER_NIGHT</option><option class="opcion_editor" value=".7,1.1,1.64,1.66,1.50">LABEL_FILTER_SAINT_ANA</option><option class="opcion_editor" value=".75,1,1.66,1.60,1.51">LABEL_FILTER_CREAM</option><option class="opcion_editor" value=".7,1.2,1.49,1.49,1.6">LABEL_FILTER_MAGIC</option><option class="opcion_editor" value=".7,1.2,1.60,1.66,1.58">LABEL_FILTER_RELIEF</option><option class="opcion_editor" value=".9,.9,1.45,1.54,1.54">LABEL_FILTER_LIGHT</option><option class="opcion_editor" value="1,1.5,1,1,1">LABEL_FILTER_SATURATION</option><option class="opcion_editor" value=".9,1.3,1,1,1">LABEL_FILTER_RETOUCH</option><option class="opcion_editor" value=".8,1,1.6,1.45,1.49">LABEL_FILTER_ORANGE</option><option class="opcion_editor" value=".8,.75,1.60,1.66,1.58">LABEL_FILTER_WIND</option><option class="opcion_editor" value=".8,.9,1.66,1.43,1.28">LABEL_FILTER_DESERT</option><option class="opcion_editor" value=".85,.75,1.47,1.66,1.54">LABEL_FILTER_FOREST</option><option class="opcion_editor" value=".8,.8,1.71,1.64,1.58">LABEL_FILTER_TOWN</option><option class="opcion_editor" value=".8,1.2,1.24,.99,1">LABEL_FILTER_PINK</option><option class="opcion_editor" value=".9,1.1,1.33,1.19,.91">LABEL_FILTER_HISTORY</option><option class="opcion_editor" value="1,1,gris">LABEL_FILTER_GRAY</option><option class="opcion_editor" value=".8,1.5,gris">LABEL_FILTER_OLD_PICTURE</option><option class="opcion_editor" value=".9,1.2,26,-12,0,2">LABEL_FILTER_CHARMING</option><option class="opcion_editor" value="1.1,1.4,40,12,-6,2">LABEL_FILTER_EMOTION</option><option class="opcion_editor" value=".9,1.32,56,47,17,2">LABEL_FILTER_BEIGE</option><option class="opcion_editor" value=".87,1.19,55,37,23,2">LABEL_FILTER_FINE</option><option class="opcion_editor" value="1.2,.9,67,13,-23,2">LABEL_FILTER_LORD</option><option class="opcion_editor" value="1.2,1.2,35,7,18,2">LABEL_FILTER_70S</option><option class="opcion_editor" value=".92,1.23,-11,11,11,2">LABEL_FILTER_TREE</option><option class="opcion_editor" value=" 1,1.4,-3,-1,-12,2">LABEL_FILTER_SUMMER</option><option class="opcion_editor" value=".85,1.26,-15,2,-1,2">LABEL_FILTER_COLD_WEATHER</option><option class="opcion_editor" value="1,1.4,5,12,1,2">LABEL_FILTER_ANGELS</option><option class="opcion_editor" value=".9,1.2,43,-17,-55,2">LABEL_FILTER_HOT</option><option class="opcion_editor" value="1,1.29,29,26,17,2">LABEL_FILTER_FALL</option><option class="opcion_editor" value=".85,1.3,43,25,-11,2">LABEL_FILTER_MARCH</option><option class="opcion_editor" value=".8,1.25,31,41,12,2">LABEL_FILTER_PEAR</option><option class="opcion_editor" value="1,1.36,4,5,1,2">LABEL_FILTER_COMMON</option><option class="opcion_editor" value=".9,1.3,37,-25,1,2">LABEL_FILTER_GOLD</option><option class="opcion_editor" value="1.1,1.3,-47,-42,-30,2">LABEL_FILTER_GOTHIC</option><option class="opcion_editor" value="1,1.4,-5,42,11,2">LABEL_FILTER_FORESTRY</option><option class="opcion_editor" value=".9,1.2,-5,-7,4,2">LABEL_FILTER_MOON</option><option class="opcion_editor" value="1.1,1.3,-1,-1,26,2">LABEL_FILTER_PARTY</option> </select> </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> <div class="canvas_imagen"> <div class="canvas recortar"> <div class="canvas_subir d-flex flex-column" id="imagen_noticia"><div>LABEL_DRAG_IMAGE_HERE_OR </div><label class="font-weight-normal mt-2" style="font-size:0.6em"for="imagen_noticia_file"> LABEL_UPLOAD_FILE_IMAGE <div class="ml-2 btn btn-primary btn-sm">LABEL_SELECT_IMAGE</div></label> <input style="display:none" type="file" id="imagen_noticia_file" accept="image/x-png,image/jpeg"></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 class="modificar animated fadeInRight delay-04 fast escalar"> <div> <div class="titulo_recortar"><span class="icon-ungroup fa fa-scissors mb-20"></span>LABEL_CUT</div><div class="opcion_editor recortar10"> <div class="recortar_texto">LABEL_CUT</div><div id="blockCelda"><span class="fa fa-unlock"></span></div></div></div><div class="texto"> <div class="mb-20"> <div class="titulo_texto "><span class="icon-plus fa fa-text-width"></span>LABEL_TEXT</div></div><div class="fonts mb-20"> <select name="fuentes" id="selectFuente" class="select-custom mr-2"> <option value="arial" selected>LABEL_FONT_ARIAL</option> <option value="calibri">LABEL_FONT_CALIBRI</option> <option value="forte">LABEL_FONT_FORTE</option> <option value="impact">LABEL_FONT_IMPACT</option> <option value="jokerman">LABEL_FONT_JOKERMAN</option> <option value="mv boli">LABEL_FONT_MV_BOLI</option> <option value="times new roman">LABEL_FONT_TIMES_NEW_ROMAN</option> <option value="verdana">LABEL_FONT_VERDANA</option> <option value="vivaldi">LABEL_FONT_VIVALDI</option> </select> <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 mb-20"> <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><div class="color_letra font"><label>A</label><input type="color" class="" data-tooltip="Color de la letra" name="" id="color" value="#ffffff"/></div><div class="font fa" data-tooltip="Sombra de la letra" id="shadow">S</div><div class="font" id="rectangulo" data-tooltip="Fondo de la letra"> <div class="rectangulo">F</div></div></div><div class="color_fondo_cuadro mb-20 flex-column" style="display:none"> <div class="w-100 d-flex justify-content-between border-bottom"><label for="colorrect" class="font-weight-normal d-flex align-items-center" style="margin:0 !important">LABEL_COLOR_BACKGROUND: </label><input type="color" name="" id="colorrect" value="#000000" style="width:30px" data-tooltip="Color del fondo" class="mr-2"/></div><div class="d-flex flex-column"><label for="opacidad" class="font-weight-normal mt-2">LABEL_BACKGROUND_TRANSPARENCY</label><input type="range" id="opacidad" max="100" min="1" step="1" value="100" ></div></div><input id="texto_input" type="text" name="texto" placeholder="LABEL_ADD_TEXT_HERE"/> <div class="mb-20"> <div class="titulo_filtro"><span class="icon-eyedropper fa fa-eyedropper"></span>LABEL_FILTERS</div></div><div class="fonts mb-20"> <select name="filtros" id="selectFiltro" class="select-custom selectFiltro"><option class="opcion_editor" value="normal" >LABEL_FILTER_NORMAL</option><option class="opcion_editor" value=".5,1.3,1.31,1.33,1.38">LABEL_FILTER_NIGHT</option><option class="opcion_editor" value=".7,1.1,1.64,1.66,1.50">LABEL_FILTER_SAINT_ANA</option><option class="opcion_editor" value=".75,1,1.66,1.60,1.51">LABEL_FILTER_CREAM</option><option class="opcion_editor" value=".7,1.2,1.49,1.49,1.6">LABEL_FILTER_MAGIC</option><option class="opcion_editor" value=".7,1.2,1.60,1.66,1.58">LABEL_FILTER_RELIEF</option><option class="opcion_editor" value=".9,.9,1.45,1.54,1.54">LABEL_FILTER_LIGHT</option><option class="opcion_editor" value="1,1.5,1,1,1">LABEL_FILTER_SATURATION</option><option class="opcion_editor" value=".9,1.3,1,1,1">LABEL_FILTER_RETOUCH</option><option class="opcion_editor" value=".8,1,1.6,1.45,1.49">LABEL_FILTER_ORANGE</option><option class="opcion_editor" value=".8,.75,1.60,1.66,1.58">LABEL_FILTER_WIND</option><option class="opcion_editor" value=".8,.9,1.66,1.43,1.28">LABEL_FILTER_DESERT</option><option class="opcion_editor" value=".85,.75,1.47,1.66,1.54">LABEL_FILTER_FOREST</option><option class="opcion_editor" value=".8,.8,1.71,1.64,1.58">LABEL_FILTER_TOWN</option><option class="opcion_editor" value=".8,1.2,1.24,.99,1">LABEL_FILTER_PINK</option><option class="opcion_editor" value=".9,1.1,1.33,1.19,.91">LABEL_FILTER_HISTORY</option><option class="opcion_editor" value="1,1,gris">LABEL_FILTER_GRAY</option><option class="opcion_editor" value=".8,1.5,gris">LABEL_FILTER_OLD_PICTURE</option><option class="opcion_editor" value=".9,1.2,26,-12,0,2">LABEL_FILTER_CHARMING</option><option class="opcion_editor" value="1.1,1.4,40,12,-6,2">LABEL_FILTER_EMOTION</option><option class="opcion_editor" value=".9,1.32,56,47,17,2">LABEL_FILTER_BEIGE</option><option class="opcion_editor" value=".87,1.19,55,37,23,2">LABEL_FILTER_FINE</option><option class="opcion_editor" value="1.2,.9,67,13,-23,2">LABEL_FILTER_LORD</option><option class="opcion_editor" value="1.2,1.2,35,7,18,2">LABEL_FILTER_70S</option><option class="opcion_editor" value=".92,1.23,-11,11,11,2">LABEL_FILTER_TREE</option><option class="opcion_editor" value=" 1,1.4,-3,-1,-12,2">LABEL_FILTER_SUMMER</option><option class="opcion_editor" value=".85,1.26,-15,2,-1,2">LABEL_FILTER_COLD_WEATHER</option><option class="opcion_editor" value="1,1.4,5,12,1,2">LABEL_FILTER_ANGELS</option><option class="opcion_editor" value=".9,1.2,43,-17,-55,2">LABEL_FILTER_HOT</option><option class="opcion_editor" value="1,1.29,29,26,17,2">LABEL_FILTER_FALL</option><option class="opcion_editor" value=".85,1.3,43,25,-11,2">LABEL_FILTER_MARCH</option><option class="opcion_editor" value=".8,1.25,31,41,12,2">LABEL_FILTER_PEAR</option><option class="opcion_editor" value="1,1.36,4,5,1,2">LABEL_FILTER_COMMON</option><option class="opcion_editor" value=".9,1.3,37,-25,1,2">LABEL_FILTER_GOLD</option><option class="opcion_editor" value="1.1,1.3,-47,-42,-30,2">LABEL_FILTER_GOTHIC</option><option class="opcion_editor" value="1,1.4,-5,42,11,2">LABEL_FILTER_FORESTRY</option><option class="opcion_editor" value=".9,1.2,-5,-7,4,2">LABEL_FILTER_MOON</option><option class="opcion_editor" value="1.1,1.3,-1,-1,26,2">LABEL_FILTER_PARTY</option> </select> </div></div></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>'
792
 
6966 nelberth 793
		var pw=420,ph=320;
6682 nelberth 794
		$(document).on("click", ".info_noticia", function(e){
795
			imagenServidorNoticia = elemento.toDataURL("image/jpeg", 1.0);
6863 nelberth 796
			if(fileToggle){
6864 nelberth 797
				e.preventDefault();
6863 nelberth 798
				setTimeout(function(){
6972 nelberth 799
 
6997 nelberth 800
					$('.marketplaceImg').attr('src', imagenServidorNoticia)
7000 nelberth 801
					$('#titleTypeImage').html('LABEL_IMAGE')
6863 nelberth 802
					fileToggle=false;
6984 nelberth 803
					if(imagenEdit==""){
804
						iniciarEditor(seleccionarCampo)
805
					}else{
806
						iniciarEditor(seleccionarCampo,imagenEdit)
807
					}
6925 nelberth 808
 
6863 nelberth 809
				},$('.marketplace').val(imagenServidorNoticia.split(',')[1]));
810
			}else{
811
				$('.file').val(imagenServidorNoticia.split(',')[1]);
6946 nelberth 812
 
6863 nelberth 813
			}
814
 
6682 nelberth 815
			console.log($('.file').val())
6874 nelberth 816
			console.log($('.marketplace').val())
6682 nelberth 817
			$(".c1").addClass("paso");
1 www 818
 
6682 nelberth 819
 
820
		})
8582 nelberth 821
		var edit;
6889 nelberth 822
		function iniciarEditor(campo, image='',load=true){
6682 nelberth 823
		 cortar=false;
824
		recorte_listo=false;
825
		texto="";
826
		seis=true;
827
		color="#ffffff";
828
		texto_listo=false,siete=false;
829
		uno=true;
830
		size=48;
831
		cinco=true;
11038 nelberth 832
		blockCelda=false;
6952 nelberth 833
		if(fileToggle){
6970 nelberth 834
			pw=420; ph=320;
835
			recorte=ph/pw;
6952 nelberth 836
		}else{
6970 nelberth 837
			pw=320; ph=480;
838
			recorte=ph/pw;
6952 nelberth 839
		}
840
 
6926 nelberth 841
		xf=pw,yf =ph;
6682 nelberth 842
		negritas=false, bold="";
843
		shadow = true, nueve=true;
844
		italic=false, ita="";
845
		rectangulo=false, diez=false;
846
     	fontfamily="Arial";
847
     	r=0,g=0,b=0,a=1;
848
		window.clearInterval(editorNoticia);
849
		setTimeout(function(){
6959 nelberth 850
			if(fileToggle){
851
				$('#imagen_noticias').css({
852
					'height': '320px',
853
    				'width': '420px',
854
				})
6999 nelberth 855
				$('.cuadro_noticias').addClass('tienda')
6959 nelberth 856
 
6965 nelberth 857
			}else{
858
				$('#imagen_noticias').css({
859
					'height': '480px',
860
    				'width': '320px',
861
				})
6999 nelberth 862
				$('.cuadro_noticias').removeClass('tienda')
6959 nelberth 863
			}
6971 nelberth 864
			console.log(ph+'  '+pw)
6682 nelberth 865
			scroll_altura=$(".articulo_noticia").offset().top-110;
866
			anchoFondoOscuro = $(".articulo_noticia").width();
867
			altoFondoOscuro = $(".editor_imagenes").height();
868
			$(".fondo_oscuro").css("width",""+anchoFondoOscuro+"px");
869
			$(".fondo_oscuro").css("height",""+altoFondoOscuro+"px");
870
 
6889 nelberth 871
		},navegacion(nuevoHtmlImagen,campo,image,load));
6682 nelberth 872
 
873
		}
874
 
875
		$(document).on("click", ".volver", function(){
876
		var nombre_user = $(".perfil_u_nombre").text();
877
		var primer_nombre = nombre_user.split(" ")[0];
878
		 cortar=false;
879
		cinco=true;
880
		recorte_listo=false;
881
		texto="";
882
		seis=true;
883
		color="#ffffff";
884
		texto_listo=false,siete=false;
885
		uno=true;
886
		size=48;
6960 nelberth 887
		if(fileToggle){
888
			pw=420, ph=320;
6967 nelberth 889
			recorte=ph/pw
6960 nelberth 890
		}else{
891
			pw=320, ph=480;
6967 nelberth 892
			recorte=ph/pw
6960 nelberth 893
		}
6926 nelberth 894
		xf=pw,yf =ph;
11038 nelberth 895
		blockCelda=false;
6682 nelberth 896
		negritas=false, bold="";
897
		shadow = true, nueve=true;
898
		italic=false, ita="";
899
		rectangulo=false, diez=false;
900
     	fontfamily="Arial";
901
     	r=0,g=0,b=0,a=1;
902
		 var imagenServidorNoticia;
903
         console.log(seleccionarCampo)
904
		window.clearInterval(editorNoticia);
905
		setTimeout(function(){
6960 nelberth 906
			if(fileToggle){
907
				$('#imagen_noticias').css({
908
					'height': '320px',
909
    				'width': '420px',
910
				})
911
 
912
			}
6682 nelberth 913
			scroll_altura=$(".articulo_noticia").offset().top-110;
914
			anchoFondoOscuro = $(".articulo_noticia").width();
915
			altoFondoOscuro = $(".editor_imagenes").height();
916
			$(".fondo_oscuro").css("width",""+anchoFondoOscuro+"px");
917
			$(".fondo_oscuro").css("height",""+altoFondoOscuro+"px");
918
 
919
		},navegacion(nuevoHtmlImagen,seleccionarCampo));
920
 
921
		})
922
 
6889 nelberth 923
		function navegacion(nuevoHtmlImagen,campo,image='',load=true){
6682 nelberth 924
                selectorElementoName=campo.find('#name')
8583 nelberth 925
 
6824 nelberth 926
                selectorElementoEditor=campo.find('#contenido');
8584 nelberth 927
				edit=true;
6682 nelberth 928
				if(image!=''){
8585 nelberth 929
					edit=false;
6889 nelberth 930
					if(load){
8585 nelberth 931
 
8583 nelberth 932
 
6888 nelberth 933
						const getBase64FromUrl = async (url) => {
934
							const data = await fetch(url);
935
							const blob = await data.blob();
936
							return new Promise((resolve) => {
937
								const reader = new FileReader();
938
								reader.readAsDataURL(blob);
939
								reader.onloadend = function() {
940
								const base64data = reader.result;
941
								resolve(base64data);
942
								}
943
							});
944
						}
8583 nelberth 945
 
6888 nelberth 946
						getBase64FromUrl(image).then(function(e){
947
							selectorElementoName.trigger('change');
948
							$(".volver").css("display","block")
949
							$(".a1").addClass("paso");
950
							$(".titulo_pasos").html("LABEL_STEP_2");
951
							setTimeout(function(){
952
								recorte_listo=true;
953
								$(".fondo_oscuro").css("display","none");
6989 nelberth 954
								if(fileToggle){
7000 nelberth 955
									$("#boton_recortar").removeClass("recortar").text("LABEL_ATTACH_IMAGE").addClass("info_noticia");
6989 nelberth 956
									}else{
957
									$("#boton_recortar").removeClass("recortar").text("LABEL_SEND").addClass("info_noticia").attr('type','submit');
958
								}
6888 nelberth 959
								$(".recortar10").removeClass("recortar");
960
								$(".canvas").removeClass("recortar");
961
								$(".b1").addClass("paso");
962
								$(".titulo_pasos").html("LABEL_STEP_3");
963
								if(texto!=""){
964
									seis=true;
965
									siete=true;
966
								}
967
								cinco=true;
968
								dos=true;
969
								cuatro=true;
970
								actualizar();
971
 
972
							},editorNoticia(e));
973
 
974
 
975
						})
6891 nelberth 976
						setTimeout(function(){
7000 nelberth 977
							$(".canvas_subir").html('<span class="icon-plus fa fa-spinner"></span> LABEL_LOADING...')
6891 nelberth 978
							selectorElementoName.trigger('change');
979
						},selectorElementoEditor.html(nuevoHtmlImagen));
6888 nelberth 980
					}else{
6682 nelberth 981
						selectorElementoName.trigger('change');
6891 nelberth 982
						setTimeout(function(){
6888 nelberth 983
							$(".volver").css("display","block")
984
							$(".a1").addClass("paso");
985
							$(".titulo_pasos").html("LABEL_STEP_2");
986
							setTimeout(function(){
6905 nelberth 987
								recorte_listo=true;
6888 nelberth 988
								$(".fondo_oscuro").css("display","none");
6987 nelberth 989
								if(fileToggle){
990
 
7000 nelberth 991
									$("#boton_recortar").removeClass("recortar").text("LABEL_ATTACH_IMAGE").addClass("info_noticia");
6988 nelberth 992
								}else{
6987 nelberth 993
									$("#boton_recortar").removeClass("recortar").text("LABEL_SEND").addClass("info_noticia").attr('type','submit');
994
 
995
								}
6888 nelberth 996
								$(".recortar10").removeClass("recortar");
997
								$(".canvas").removeClass("recortar");
998
								$(".b1").addClass("paso");
999
								$(".titulo_pasos").html("LABEL_STEP_3");
1000
								if(texto!=""){
1001
									seis=true;
1002
									siete=true;
1003
								}
1004
								cinco=true;
1005
								dos=true;
1006
								cuatro=true;
1007
								actualizar();
6682 nelberth 1008
 
6888 nelberth 1009
							},editorNoticia(image));
6891 nelberth 1010
 
1011
 
1012
							selectorElementoName.trigger('change');
1013
						},selectorElementoEditor.html(nuevoHtmlImagen));
6888 nelberth 1014
					}
6891 nelberth 1015
 
6682 nelberth 1016
				}else{
1017
					setTimeout(function(){
1018
					    selectorElementoName.trigger('change');
1019
					},selectorElementoEditor.html(nuevoHtmlImagen));
1020
				}
1021
 
1022
		}
1023
 
1024
		$(window).on("scroll", function(){
1025
			console.log(scroll_altura)
1026
		if($(window).scrollTop()>scroll_altura){
1027
			$("#cuadro_noticias").addClass("fixed");
1028
		}else{
1029
			$("#cuadro_noticias").removeClass("fixed");
1030
		}
1031
	})
1032
 
1033
	$(document).on("dragover", "#imagen_noticia", function(e){
1034
		e.preventDefault();
1035
		e.stopPropagation();
1036
		$(this).css({"background":"rgba(0,0,0,.2)"})
1037
	})
1038
	$(document).on("drop", "#imagen_noticia", function(e){
1039
		e.preventDefault();
1040
		e.stopPropagation();
1041
		$(this).css("background", "none");
1042
		var archivo = e.originalEvent.dataTransfer.files;
1043
		var img=archivo[0];
1044
		if(img.type =="image/jpeg"||img.type =="image/png"){
1045
			$(".modificar").removeClass("animated");
1046
			var render = new FileReader();
1047
			render.readAsDataURL(img);
1048
			render.onload = function(e){
8354 nelberth 1049
				imagen2=new Image();
1050
				imagen2.src=e.target.result;
1051
 
1052
				$(imagen2).ready(function(e){
11030 nelberth 1053
					if(imagen2.width<320||imagen2.height<480){
8360 nelberth 1054
						$.fn.showError('LABEL_MINIMUM_IMAGE_SIZE');
8354 nelberth 1055
					}else{
1056
						$(".volver").css("display","block")
1057
						$(".a1").addClass("paso");
1058
						$(".titulo_pasos").html("LABEL_STEP_2");
1059
						editorNoticia(imagen2.src)
1060
					}
1061
				})
1062
			}
1063
		}else{
8360 nelberth 1064
			$.fn.showError('LABEL_SUPPORTED_FORMATS');
6682 nelberth 1065
		}
1066
	})
11030 nelberth 1067
	$(document).on("change", "#imagen_noticia_file", function(e){
1068
		file = $(this)[0].files[0];
1069
		e.preventDefault();
1070
		$(this).css("background", "none");
1071
		var archivo = file;
1072
		var img=file;
1073
		if(img.type =="image/jpeg"||img.type =="image/png"){
1074
			$(".modificar").removeClass("animated");
1075
			var render = new FileReader();
1076
			render.readAsDataURL(img);
1077
			render.onload = function(e){
1078
				imagen2=new Image();
1079
				imagen2.src=e.target.result;
1080
 
1081
				$(imagen2).ready(function(e){
1082
					if(imagen2.width<320||imagen2.height<480){
1083
						$.fn.showError('LABEL_MINIMUM_IMAGE_SIZE');
1084
					}else{
1085
						$(".volver").css("display","block")
1086
						$(".a1").addClass("paso");
1087
						$(".titulo_pasos").html("LABEL_STEP_2");
1088
						editorNoticia(imagen2.src)
1089
					}
1090
				})
1091
			}
1092
		}else{
1093
			$.fn.showError('LABEL_SUPPORTED_FORMATS');
1094
		}
1095
	})
6682 nelberth 1096
	$(document).on("dragover", "body", function(e){
1097
		e.preventDefault();
1098
		e.stopPropagation();
1099
	})
1100
	$(document).on("drop", "body", function(e){
1101
		e.preventDefault();
1102
		e.stopPropagation();
1103
	})
1104
 
1105
	var canvas='<div class="editorNoticia"><canvas id="editorNoticia">LABEL_NOT_SUPPORTED</canvas></div>';
1106
	$(document).on("mouseover", ".editorNoticia", function(){
1107
		$("body").css({"overflow": "hidden"});
1108
		$(".cuadro_noticias, .fixed_noticia,.tituloEditor,.grid-padre").css("margin-right", "17px")
1109
		$(".barra,.footer").css("padding-right","17px")
1110
 
1111
 
1112
	})
1113
	$(document).on("mouseover", "#editorNoticia", function(){
1114
		if(recorte_listo){
1115
			ocho=true;
1116
		}
1117
	})
1118
	$(document).on("mouseout", "#editorNoticia", function(){
1119
		if(recorte_listo){
1120
			ocho=false;
1121
			actualizar2()
1122
		}
1123
	})
1124
	$(document).on("mouseout", ".editorNoticia",function(){
1125
		$("body").css({"overflow": "auto"})
1126
		$(".cuadro_noticias, .fixed_noticia,.tituloEditor,.grid-padre").css("margin-right", "0px")
1127
		$(".barra,.footer").css("padding-right","0px")
1128
 
1129
	})
1130
	$(document).on('mousewheel', ".editorNoticia",function(e){
1131
		var ruedita = e.originalEvent.wheelDelta
1132
		if(ruedita>0){
1133
			scale = scale+(scale/10);
1134
			$("#porciento_scale").html((scale*100).toFixed(2)+"%")
1135
		}else{
1136
			scale = scale-(scale/10);
1137
			$("#porciento_scale").html((scale*100).toFixed(2)+"%")
1138
		}
1139
		$("#editorNoticia").css({"transform": "scale("+scale+")"});
1140
	})
1141
	$(document).on("click", ".as", function(e){
1142
		e.preventDefault();
1143
		 scale = $(this).data("scale");
1144
		 $("#porciento_scale").html((scale*100).toFixed(2)+"%")
1145
		 $("#editorNoticia").css({"transform": "scale("+scale+")"});
1146
 
1147
	})
1148
	$(document).on("click", ".ps", function(e){
1149
		e.preventDefault();
1150
		$(".cantidades_scale").slideToggle(200).css("display", "block");
1151
	})
1152
	$(document).on("click", "#cerrar_filter_modal, .icon_filter", function(e){
1153
		e.preventDefault();
1154
		if(recorte_listo){
1155
		$(".contenido_filter").slideToggle(200).css("display", "block");
1156
		}
1157
	})
1158
	$(document).on("click", "#cerrar_text_modal, .icon_text", function(e){
1159
		e.preventDefault();
1160
		if(recorte_listo){
1161
			$(".contenido_text").slideToggle(200).css("display", "block");
1162
		}
1163
	})
1164
 
1165
	$(document).on("click", "#cerrar_cut_modal, .icon_cut", function(e){
1166
		e.preventDefault();
1167
		if(cortar){
1168
			$(".contenido_cut").slideToggle(200).css("display", "block");
1169
		}
1170
 
1171
	})
1172
	$(document).on("click", "#menos_scale", function(e){
1173
		e.preventDefault();
1174
		scale = scale-(scale/10);
1175
		 $("#porciento_scale").html((scale*100).toFixed(2)+"%")
1176
		 $("#editorNoticia").css({"transform": "scale("+scale+")"});
1177
	})
1178
 
1179
	$(document).on("click", "#mas_scale", function(e){
1180
		e.preventDefault();
1181
		scale = scale+(scale/10);
1182
		 $("#porciento_scale").html((scale*100).toFixed(2)+"%")
1183
		 $("#editorNoticia").css({"transform": "scale("+scale+")"});
1184
	})
1185
	$(document).on("click", "#noche", function(){
1186
		$(".oa").removeClass("oa")
1187
		filter( .5,1.3,1.31,1.33,1.38);
1188
		$(this).addClass("oa")
1189
	})
1190
	$(document).on("click", "#sa", function(){
1191
		$(".oa").removeClass("oa")
1192
		filter( .7,1.1,1.64,1.66,1.50);
1193
		$(this).addClass("oa")
1194
	})
1195
	$(document).on("click", "#crema", function(){
1196
		$(".oa").removeClass("oa")
1197
		filter( .75,1,1.66,1.60,1.51);
1198
		$(this).addClass("oa")
1199
	})
1200
	$(document).on("click", "#setenta", function(){
1201
		$(".oa").removeClass("oa")
1202
		filter( .8,.75,1.60,1.66,1.58);
1203
		$(this).addClass("oa")
1204
	})
1205
	$(document).on("click", "#orange", function(){
1206
		$(".oa").removeClass("oa")
1207
		filter( .8,1,1.6,1.45,1.49);
1208
		$(this).addClass("oa")
1209
	})
1210
	$(document).on("click", "#relieve", function(){
1211
		$(".oa").removeClass("oa")
1212
		filter( .7,1.2,1.60,1.66,1.58);
1213
		$(this).addClass("oa")
1214
	})
1215
	$(document).on("click", "#bosque", function(){
1216
		$(".oa").removeClass("oa")
1217
		filter( .85,.75,1.47,1.66,1.54);
1218
		$(this).addClass("oa")
1219
	})
1220
	$(document).on("click", "#desierto", function(){
1221
		$(".oa").removeClass("oa")
1222
		filter( .8,.9,1.66,1.43,1.28);
1223
		$(this).addClass("oa")
1224
	})
1225
	$(document).on("click", "#villa", function(){
1226
		$(".oa").removeClass("oa")
1227
		filter( .8,.8,1.71,1.64,1.58);
1228
		$(this).addClass("oa")
1229
	})
1230
	$(document).on("click", "#magia", function(){
1231
		$(".oa").removeClass("oa")
1232
		filter( .7,1.2,1.49,1.49,1.6);
1233
		$(this).addClass("oa")
1234
	})
1235
	$(document).on("click", "#luz", function(){
1236
		$(".oa").removeClass("oa")
1237
		filter( .9,.9,1.45,1.54,1.54);
1238
		$(this).addClass("oa")
1239
	})
1240
	$(document).on("click", "#retoque", function(){
1241
		$(".oa").removeClass("oa")
1242
		filter( .9,1.3,1,1,1);
1243
		$(this).addClass("oa")
1244
	})
1245
	$(document).on("click", "#saturacion", function(){
1246
		$(".oa").removeClass("oa")
1247
		filter( 1,1.5,1,1,1);
1248
		$(this).addClass("oa")
1249
	})
1250
	$(document).on("click", "#rosa", function(){
1251
		$(".oa").removeClass("oa")
1252
		filter( .8,1.2,1.24,.99,1);
1253
		$(this).addClass("oa")
1254
	})
1255
	$(document).on("click", "#historia", function(){
1256
		$(".oa").removeClass("oa")
1257
		filter( .9,1.1,1.33,1.19,.91);
1258
		$(this).addClass("oa")
1259
	})
1260
	$(document).on("click", "#encantador", function(){
1261
		$(".oa").removeClass("oa")
1262
		filter( .9,1.2,26,-12,0,2);
1263
		$(this).addClass("oa")
1264
	})
1265
	$(document).on("click", "#emocion", function(){
1266
		$(".oa").removeClass("oa")
1267
		filter( 1.1,1.4,40,12,-6,2);
1268
		$(this).addClass("oa")
1269
	})
1270
	$(document).on("click", "#beige", function(){
1271
		$(".oa").removeClass("oa")
1272
		filter( .9,1.32,56,47,17,2);
1273
		$(this).addClass("oa")
1274
	})
1275
	$(document).on("click", "#fine", function(){
1276
		$(".oa").removeClass("oa")
1277
		filter( .87,1.19,55,37,23,2);
1278
		$(this).addClass("oa")
1279
	})
1280
	$(document).on("click", "#lord", function(){
1281
		$(".oa").removeClass("oa")
1282
		filter( 1.2,.9,67,13,-23,2);
1283
		$(this).addClass("oa")
1284
	})
1285
	$(document).on("click", "#70", function(){
1286
		$(".oa").removeClass("oa")
1287
		filter( 1.2,1.2,35,7,18,2);
1288
		$(this).addClass("oa")
1289
	})
1290
	$(document).on("click", "#arbol", function(){
1291
		$(".oa").removeClass("oa")
1292
		filter(.92,1.23,-11,11,11,2);
1293
		$(this).addClass("oa")
1294
	})
1295
	$(document).on("click", "#verano", function(){
1296
		$(".oa").removeClass("oa")
1297
		filter( 1,1.4,-3,-1,-12,2);
1298
		$(this).addClass("oa")
1299
	})
1300
	$(document).on("click", "#cf", function(){
1301
		$(".oa").removeClass("oa")
1302
		filter( .85,1.26,-15,2,-1,2);
1303
		$(this).addClass("oa")
1304
	})
1305
	$(document).on("click", "#angeles", function(){
1306
		$(".oa").removeClass("oa")
1307
		filter( 1,1.4,5,12,1,2);
1308
		$(this).addClass("oa")
1309
	})
1310
	$(document).on("click", "#caliente", function(){
1311
		$(".oa").removeClass("oa")
1312
		filter( .9,1.2,43,-17,-55,2);
1313
		$(this).addClass("oa")
1314
	})
1315
	$(document).on("click", "#otono", function(){
1316
		$(".oa").removeClass("oa")
1317
		filter( 1,1.29,29,26,17,2);
1318
		$(this).addClass("oa")
1319
	})
1320
	$(document).on("click", "#marzo", function(){
1321
		$(".oa").removeClass("oa")
1322
		filter( .85,1.3,43,25,-11,2);
1323
		$(this).addClass("oa")
1324
	})
1325
	$(document).on("click", "#pera", function(){
1326
		$(".oa").removeClass("oa")
1327
		filter( .8,1.25,31,41,12,2);
1328
		$(this).addClass("oa")
1329
	})
1330
	$(document).on("click", "#comun", function(){
1331
		$(".oa").removeClass("oa")
1332
		filter( 1,1.36,4,5,1,2);
1333
		$(this).addClass("oa")
1334
	})
1335
	$(document).on("click", "#oro", function(){
1336
		$(".oa").removeClass("oa")
1337
		filter( .9,1.3,37,-25,1,2);
1338
		$(this).addClass("oa")
1339
	})
1340
	$(document).on("click", "#gotico", function(){
1341
		$(".oa").removeClass("oa")
1342
		filter( 1.1,1.3,-47,-42,-30,2);
1343
		$(this).addClass("oa")
1344
	})
1345
	$(document).on("click", "#forestal", function(){
1346
		$(".oa").removeClass("oa")
1347
		filter( 1,1.4,-5,42,11,2);
1348
		$(this).addClass("oa")
1349
	})
1350
	$(document).on("click", "#luna", function(){
1351
		$(".oa").removeClass("oa")
1352
		filter( .9,1.2,-5,-7,4,2);
1353
		$(this).addClass("oa")
1354
	})
1355
	$(document).on("click", "#fiesta", function(){
1356
		$(".oa").removeClass("oa")
1357
		filter( 1.1,1.3,-1,-1,26,2);
1358
		$(this).addClass("oa")
1359
	})
1360
	$(document).on("click", "#gris", function(){
1361
		$(".oa").removeClass("oa")
1362
		filtergris(1,1)
1363
		$(this).addClass("oa")
1364
	})
1365
	$(document).on("click", "#lhs", function(){
1366
		$(".oa").removeClass("oa")
1367
		filtergris(.8,1.5);
1368
		$(this).addClass("oa")
1369
	})
1370
	$(document).on("click", "#normal", function(){
1371
		$(".oa").removeClass("oa")
1372
		$(this).addClass("oa")
1373
		filter();
1374
	})
1375
	var texto_listo=false,siete=false;
1376
	var texto;
1377
	$(document).on("keyup", "#texto_input", function(e){
1378
		e.preventDefault();
1379
		texto = $(this).val();
1380
		if(texto_actualizar){
1381
			siete=true;
1382
		}
1383
		if(texto!=""){
1384
			texto_actualizar=true;
1385
			actualizar2();
1386
		}else{
1387
			actualizar2();
1388
		}
1389
 
1390
	})
1391
	var color="#ffffff";
11041 nelberth 1392
	$(document).on("change input", "#color", function(){
6682 nelberth 1393
    	color=$(this).val();
1394
    	seis=true;
1395
    	actualizar2();
1396
    })
11040 nelberth 1397
	$(document).on("keypress", "#font-size, #texto_input", function(e){
1398
    	if(e.which == 13){
1399
      		return false;
1400
    	}
1401
  	});
6682 nelberth 1402
    var size=48;
1403
    $(document).on("keyup change", "#font-size", function(){
1404
    	size=$(this).val();
1405
    	size = parseInt(size);
1406
    	seis=true;
1407
    	siete=true;
1408
    	actualizar2();
1409
    })
1410
    var negritas=false, bold="";
1411
    $(document).on("click", "#negritas", function(e){
1412
    	e.preventDefault();
1413
    	if(!negritas){
1414
    		bold="bold";
1415
    		$(this).addClass("fa");
1416
    		seis=true;
1417
    		siete=true;
1418
    		actualizar2();
1419
    		negritas=true;
1420
    	}else{
1421
    		bold="";
1422
    		$(this).removeClass("fa");
1423
    		seis=true;
1424
    		siete=true;
1425
    		actualizar2();
1426
    		negritas=false;
1427
    	}
1428
    })
1429
    var italic=false, ita="";
1430
     $(document).on("click", "#italic", function(e){
1431
    	e.preventDefault();
1432
    	if(!italic){
1433
    		ita="italic";
1434
    		$(this).addClass("fa");
1435
    		seis=true;
1436
    		siete=true;
1437
    		actualizar2();
1438
    		italic=true;
1439
    	}else{
1440
    		ita="";
1441
    		$(this).removeClass("fa");
1442
    		seis=true;
1443
    		siete=true;
1444
    		actualizar2();
1445
    		italic=false;
1446
    	}
1447
    })
11039 nelberth 1448
	var fontfamily="Arial";
1449
     $(document).on("change", "#selectFuente", function(e){
6682 nelberth 1450
    	e.preventDefault();
11039 nelberth 1451
    	fontfamily= $(this).val();
6682 nelberth 1452
    	seis=true;
1453
    	siete=true;
1454
    	actualizar2();
1455
 
1456
    })
1457
     var shadow = true, nueve=true;
1458
     $(document).on("click","#shadow", function(e){
1459
     	e.preventDefault();
1460
     	if(shadow){
1461
     		$(this).removeClass("fa");
1462
     		seis=true;
1463
     		nueve=false;
1464
     		actualizar2();
1465
     		shadow=false;
1466
     	}else{
1467
     		$(this).addClass("fa");
1468
     		seis=true;
1469
     		nueve=true;
1470
     		actualizar2();
1471
     		shadow=true;
1472
     	}
1473
 
1474
     })
1475
     var rectangulo=false, diez=false, colorrect="#000000";
11042 nelberth 1476
	 $(document).on("click", "#rectangulo", function(e){
6682 nelberth 1477
     	e.preventDefault();
1478
     	if(!rectangulo){
1479
     		$(this).addClass("fa");
11042 nelberth 1480
			$('.color_fondo_cuadro').css('display','flex')
6682 nelberth 1481
     		diez=true;
1482
     		actualizar2();
1483
     		rectangulo=true;
1484
     	}else{
1485
     		$(this).removeClass("fa");
11042 nelberth 1486
			 $('.color_fondo_cuadro').css('display','none')
6682 nelberth 1487
     		diez=false;
1488
     		actualizar2();
1489
     		rectangulo=false;
1490
     	}
1491
 
1492
     })
1493
     var r=0,g=0,b=0;
11043 nelberth 1494
	 $(document).on("change input", "#colorrect", function(){
6682 nelberth 1495
    	colorrect=$(this).val();
11043 nelberth 1496
    	r=parseInt(colorrect.slice(1,3),16);
1497
    	g=parseInt(colorrect.slice(3,5),16);
1498
    	b=parseInt(colorrect.slice(5,7),16);
6682 nelberth 1499
    	seis=true;
1500
    	actualizar2();
1501
    })
1502
    var a=1;
1503
 
11044 nelberth 1504
	$(document).on("mousemove change ", "#opacidad", function(){
6682 nelberth 1505
    	a=$(this).val();
1506
    	a=a/100;
1507
    	seis=true;
1508
    	actualizar2();
1509
    })
1510
	var imaNoti = new Image();
1511
	function filter(brillo=1, contraste=1, rojo=1, verde=1, azul=1, valor=1){
1512
		cuatro=false;
1513
		restaurar(brillo, contraste);
1514
		datos=imagenOriginal.data;
1515
		if(valor==2){
1516
			for (var i =  0; i <datos.length; i+=4) {
1517
				datos[i]=datos[i]+rojo;
1518
				datos[i+1]=datos[i+1]+verde;
1519
				datos[i+2]=datos[i+2]+azul;
1520
			}
1521
		}else{
1522
			for (var i =  0; i <datos.length; i+=4) {
1523
				datos[i]=datos[i]*rojo;
1524
				datos[i+1]=datos[i+1]*verde;
1525
				datos[i+2]=datos[i+2]*azul
1526
			}
1527
		}
1528
		editor.putImageData(imagenOriginal,0,0)
1529
		var imagenNoticia = elemento.toDataURL("image/jpeg", 1.0);
1530
	    imaNoti.src = imagenNoticia;
1531
		actualizar2();
1532
	}
1533
	function filtergris(brillo=1, contraste=1){
1534
		cuatro=false;
1535
		restaurar(brillo, contraste);
1536
		datos=imagenOriginal.data;
1537
		var auxiliar;
1538
		for (var i =  0; i <datos.length; i+=4) {
8356 nelberth 1539
			auxiliar = 0.34 * datos[i] + 0.5 *datos[i+1] + 0.1/6 * datos[i+2];
6682 nelberth 1540
			datos[i]=auxiliar;
1541
			datos[i+1]=auxiliar;
1542
			datos[i+2]=auxiliar;
1543
		}
1544
 
1545
		editor.putImageData(imagenOriginal,0,0)
1546
		var imagenNoticia = elemento.toDataURL("image/jpeg", 1.0);
1547
	    imaNoti.src = imagenNoticia;
1548
		actualizar2();
1549
	}
1550
	function restaurar(brillo = 1, contraste=1){
1551
		editor.filter = "none"
1552
		editor.filter = 'contrast('+contraste+') brightness('+brillo+') saturate(1) sepia(0)';
1553
		editor.fillStyle="rgba(255,255,255,1)"
1554
		editor.fillRect(0,0,ancho,alto);
1555
		editor.fillStyle=""+color+"";
1556
		var pxf=0,pyf=0;
1557
			if(xf>=(yf/recorte)){
1558
				pxf=xf/ancho;
1559
				pyf=yf/pxf;
1560
				py=(alto/2)-(pyf/2);
1561
				editor.drawImage(imagen,x,y,xf,yf,0,py,ancho,pyf);
1562
			}else{
1563
				pyf=yf/alto;
1564
				pxf=xf/pyf;
1565
				px=(ancho/2)-(pxf/2);
1566
				editor.drawImage(imagen,x,y,xf,yf,px,0,pxf,alto);
1567
			}
1568
		imagenOriginal = editor.getImageData(0,0,ancho,alto)
1569
	}
1570
	var ocho=false;
1571
	function actualizar2(){
1572
		if(recorte_listo){
1573
		if(cuatro){
1574
			imagenOriginal = editor.getImageData(0,0,ancho,alto)
1575
			var imagenNoticia = elemento.toDataURL("image/jpeg", 1.0);
1576
	    	imaNoti.src = imagenNoticia;
1577
	    	cuatro=false;
1578
		}
1579
		editor.filter = "none"
1580
		$(imaNoti).ready(function(e){
6926 nelberth 1581
			noticia.drawImage(imaNoti,0,0,pw,ph);
6682 nelberth 1582
			editor.drawImage(imaNoti,0,0,ancho,alto)
1583
			if(texto_actualizar){
1584
				if(texto!=""){
1585
					if(seis){
1586
						ancho_imaNoti = imaNoti.width;
1587
 
6926 nelberth 1588
						scale_noticia = -(((ancho_imaNoti-pw)/ancho_imaNoti)-1);
6682 nelberth 1589
						editor.fillStyle=""+color+"";
1590
						editor.strokeStyle="rgb(255,255,255)";
1591
						if(nueve){
1592
							editor.shadowColor="rgba(0,0,0,.5)";
1593
							editor.shadowOffsetX=6;
1594
							editor.shadowOffsetY=6;
1595
							editor.shadowBlur=6;
1596
							noticia.shadowColor="rgba(0,0,0,.5)";
1597
							noticia.shadowOffsetX=6*scale_noticia;
1598
							noticia.shadowOffsetY=6*scale_noticia;
1599
							noticia.shadowBlur=6*scale_noticia;
1600
						}else{
1601
							editor.shadowColor="rgba(0,0,0,0)";
1602
							noticia.shadowColor="rgba(0,0,0,0)";
1603
						}
1604
						editor.font=""+ita+" "+bold+" "+size+"px "+fontfamily+"";
1605
						editor.textAlign="start";
1606
						editor.textBaseline="top";
1607
 
1608
						var sizeNoticia = size*scale_noticia;
1609
						noticia.fillStyle=""+color+"";
1610
						noticia.font=""+ita+" "+bold+" "+sizeNoticia+"px "+fontfamily+"";
1611
						noticia.textAlign="start";
1612
						noticia.textBaseline="top";
1613
						seis=false;
1614
					}
1615
					if(siete){
1616
						dimencionesTexto = editor.measureText(texto);
1617
						txf=dimencionesTexto.width+20;
1618
						tyf= (20+size);
1619
						siete=false;
1620
					}
1621
					if(cinco){
1622
						dimencionesTexto = editor.measureText(texto);
1623
						if(xf>=(yf/recorte)){
1624
							tx=(xf/2)-(dimencionesTexto.width/2);
1625
							ty=(xf*recorte/2)-(size/2);
1626
						}else{
1627
							tx=(yf/recorte/2)-(dimencionesTexto.width/2);
1628
							ty=(yf/2)-(size/2);
1629
						}
1630
 
1631
						txf=dimencionesTexto.width+20;
1632
						tyf= size+20;
1633
						cinco=false;
1634
					}
1635
					if(diez){
1636
						editor.fillStyle="rgba("+r+","+g+","+b+","+a+")";
1637
						noticia.fillStyle="rgba("+r+","+g+","+b+","+a+")";
1638
						editor.fillRect(tx-10,ty-10,txf,tyf);
1639
						noticia.fillRect(((tx-10)*scale_noticia),((ty-10)*scale_noticia),txf*scale_noticia,tyf*scale_noticia);
1640
						editor.fillStyle=""+color+"";
1641
						noticia.fillStyle=""+color+"";
1642
 
1643
					}
1644
					editor.fillText(texto,tx,ty);
1645
					noticia.fillText(texto,(tx*scale_noticia),ty*scale_noticia);
1646
					if(ocho){
1647
						editor.strokeRect(tx-10,ty-10,txf,tyf)
1648
						editor.arc(tx+txf,ty+tyf,10,0,Math.PI*2,false);
1649
						editor.fill();
1650
						editor.beginPath();
1651
					}
1652
					texto_listo=true;
1653
				}
1654
			}
1655
		})
1656
 
1657
	}
1658
	}
1659
	function actualizar(){
6962 nelberth 1660
 
6961 nelberth 1661
			$(imagen).ready(function(e){
1662
 
6682 nelberth 1663
				if(uno){
6962 nelberth 1664
					elemento2.height=ph;
6964 nelberth 1665
					elemento2.width=pw;
6682 nelberth 1666
					ancho=imagen.width, alto = imagen.height;
1667
					elemento.width = ancho;
1668
					elemento.height = alto;
6956 nelberth 1669
 
6682 nelberth 1670
					$(".scale").css("display","flex");
1671
					if(ancho<=alto){
1672
					 scale = -(((alto-450)/alto)-1);
8357 nelberth 1673
 
1674
 
6682 nelberth 1675
					}else{
1676
					 scale = -(((ancho-500)/ancho)-1);
8357 nelberth 1677
 
6682 nelberth 1678
					}
11033 nelberth 1679
					scale=scale*0.80;
8579 nelberth 1680
					if(edit){
1681
						if((ancho*recorte)<=alto){
1682
							xf=ancho*.70;
1683
							yf=xf*recorte;
1684
						}else{
1685
							yf=alto*.70;
1686
							xf=yf/recorte;
1687
						}
1688
					}
8357 nelberth 1689
					cuadro_dimencion=Math.round(12/scale);
1690
 
1691
					if(xf<50||yf<50){
1692
						xf=50;
1693
						yf=xf*recorte;
1694
					}
1695
					mitadX=ancho/2;
1696
					mitadY=alto/2;
1697
					x=mitadX-xf/2;
1698
					y=mitadY-yf/2;
1699
 
6682 nelberth 1700
					$("#porciento_scale").html((scale*100).toFixed(2)+"%")
1701
					$("#ancho").html(ancho+"px");
1702
					$("#alto").html(alto+"px");
1703
					uno=false;
1704
				}
1705
				if(dos){
1706
 
1707
					if(xf>=(yf/recorte)){
1708
						alto=xf*recorte;
1709
						ancho=xf;
1710
					}else{
1711
						ancho=yf/recorte;
1712
						alto=yf;
1713
 
1714
					}
1715
					elemento.width = ancho;
1716
					elemento.height = alto;
6963 nelberth 1717
					elemento2.height=ph;
1718
					elemento2.width=pw;
6682 nelberth 1719
					if(xf<=yf){
1720
					 scale = -(((yf-450)/yf)-1);
1721
 
1722
					}else{
1723
					 scale = -(((xf-500)/xf)-1);
1724
					}
1725
 
1726
					$("#porciento_scale").html((scale*100).toFixed(2)+"%")
1727
					$("#ancho").html(Math.round(xf)+"px");
1728
					$("#alto").html(Math.round(yf)+"px");
1729
					dos=false;
1730
				}
1731
 
1732
					var pxf=0,pyf=0;
1733
					noticia.fillStyle="rgba(255,255,255,1)"
6926 nelberth 1734
					noticia.fillRect(0,0,pw,ph);
6682 nelberth 1735
				if(xf>=(yf/recorte)){
6926 nelberth 1736
					pxf=xf/pw;
6682 nelberth 1737
					pyf=yf/pxf;
6926 nelberth 1738
					py=(ph/2)-(pyf/2);
1739
					noticia.drawImage(imagen,x,y,xf,yf,0,py,pw,pyf);
6682 nelberth 1740
				}else{
6926 nelberth 1741
					pyf=yf/ph;
6682 nelberth 1742
					pxf=xf/pyf;
6926 nelberth 1743
					px=(pw/2)-(pxf/2);
1744
					noticia.drawImage(imagen,x,y,xf,yf,px,0,pxf,ph);
6682 nelberth 1745
				}
1746
 
1747
				$("#editorNoticia").css({"transform": "scale("+scale+")"});
1748
				if(!recorte_listo){
1749
					editor.drawImage(imagen,0,0,ancho,alto);
1750
					editor.fillStyle="rgba(0,0,0,.2)"
1751
					editor.fillRect(0,0,ancho,alto);
8358 nelberth 1752
					editor.fillStyle="rgba(255,255,255,.2)"
6682 nelberth 1753
					editor.fillRect(x,y,xf,yf);
8358 nelberth 1754
					editor.fillStyle="rgba(255,255,255,0.8)"
8356 nelberth 1755
					editor.fillRect(x,y,cuadro_dimencion,cuadro_dimencion);
1756
					editor.fillRect((x+xf)-cuadro_dimencion,y,cuadro_dimencion,cuadro_dimencion);
1757
					editor.fillRect(x,y+yf-cuadro_dimencion,cuadro_dimencion,cuadro_dimencion);
1758
					editor.fillRect(x+xf-cuadro_dimencion,yf+y-cuadro_dimencion,cuadro_dimencion,cuadro_dimencion);
6682 nelberth 1759
					esta=true;
1760
				}else{
1761
					var pxf=0,pyf=0;
1762
 
1763
					editor.fillStyle="rgba(255,255,255,1)"
1764
					editor.fillRect(0,0,ancho,alto);
1765
					if(xf>=(yf/recorte)){
1766
						pxf=xf/ancho;
1767
						pyf=yf/pxf;
1768
						py=(alto/2)-(pyf/2);
1769
						editor.drawImage(imagen,x,y,xf,yf,0,py,ancho,pyf);
1770
					}else{
1771
						pyf=yf/alto;
1772
						pxf=xf/pyf;
1773
						px=(ancho/2)-(pxf/2);
1774
						editor.drawImage(imagen,x,y,xf,yf,px,0,pxf,alto);
1775
				}
1776
 
1777
				}
1778
			})
1779
		}
6966 nelberth 1780
	var imagenOriginal
6956 nelberth 1781
	var x,y,xf=pw,yf =ph, elemento,elemento2,editor,centro, total,scale,dimencionesTexto,ancho_imaNoti,
6682 nelberth 1782
	recorte_listo=false,alto,ancho,tx,ty,txf,tyf,cuatro=true,texto_actualizar=false,cinco=true,seis=true,cuatro;
6970 nelberth 1783
	var  mitadY,mitadX, uno=true,dos=false, recorte=ph/pw, imagen_noticias, scale_noticia, tres=true,rotar=false, cortar=false;;
8356 nelberth 1784
	var translateX, cuadro_dimencion;
6682 nelberth 1785
 
1786
	$(document).on("click", ".recortar10", function(e){
1787
 
1788
		e.preventDefault();
1789
		recorte_listo=false;
1790
		uno=true;
1791
		$(".fondo_oscuro").css("display","block");
7000 nelberth 1792
		$("#boton_recortar").addClass("recortar").text("LABEL_CUT").removeClass("info_noticia");
1793
		$("#boton_recortar3").addClass("recortar").text("LABEL_CUT").removeClass("info_noticia3");
6682 nelberth 1794
		$(".contenido_text").css("display", "none");
1795
		$(".contenido_filter").css("display", "none");
1796
		$(".recortar10").addClass("recortar");
1797
		$(".canvas").addClass("recortar")
1798
		$(".oa").removeClass("oa");
1799
		$("#normal").addClass("oa");
1800
		$(".b1").removeClass("paso");
1801
		$(".titulo_pasos").html("LABEL_STEP_2");
1802
		window.clearInterval(actualizar2);
1803
		actualizar();
1804
 
1805
	})
1806
 
1807
 
1808
	blockCelda=true;
1809
	$(document).on("click", "#blockCelda", function(e){
1810
		e.preventDefault();
1811
		if(blockCelda){
1812
			$(this).html('<span class="fa fa-unlock"></span>')
1813
 
1814
			blockCelda=false;
1815
		}else{
1816
			$(this).html('<span class="fa fa-lock"></span>')
1817
			blockCelda=true;
1818
		}
1819
		t4=true;
1820
 
1821
	})
1822
	var imagen
1823
	function editorNoticia(img){
1824
		 cortar=true;
1825
		imagen= new Image();
1826
		$(".canvas").html(canvas);
1827
		elemento = document.getElementById("editorNoticia");
1828
		editor = elemento.getContext("2d");
1829
		elemento2 = document.getElementById("imagen_noticias");
1830
		noticia = elemento2.getContext("2d");
1831
 
1832
		$(document).on("click", ".boton_marino.recortar",function(e){
1833
			e.preventDefault();
1834
			recorte_listo=true;
1835
			$(".fondo_oscuro").css("display","none");
6863 nelberth 1836
			if(fileToggle){
7000 nelberth 1837
				$("#boton_recortar").removeClass("recortar").text("LABEL_ATTACH_IMAGE").addClass("info_noticia");
6863 nelberth 1838
			}else{
1839
				$("#boton_recortar").removeClass("recortar").text("LABEL_SEND").addClass("info_noticia").attr('type','submit');
1840
			}
6682 nelberth 1841
			$(".recortar10").removeClass("recortar");
1842
			$(".canvas").removeClass("recortar");
1843
			$(".b1").addClass("paso");
1844
			$(".titulo_pasos").html("LABEL_STEP_3");
1845
			if(texto!=""){
1846
				seis=true;
1847
				siete=true;
1848
			}
1849
			cinco=true;
1850
			dos=true;
1851
			cuatro=true;
1852
			actualizar();
1853
		})
1854
 
1855
		var cli = false, t1= false, t2=false,t3=false,t4=false,tcli=false;
1856
		var mouse =[];
1857
 
1858
 
1859
		function raton(elemento, e){
1860
			return {
1861
				x:((e.pageX - elemento.offsetLeft - ((ancho/2)-((ancho*scale)/2)))/scale),
1862
				y:((e.pageY - elemento.offsetTop - ((alto/2)-((alto*scale)/2)))/scale)
1863
			}
1864
		}
1865
 
1866
		imagen.src=img;
1867
		$(".recortar10").addClass("recortar");
1868
		$("#boton_recortar").removeClass("boton_normal").addClass("recortar boton_marino").text("LABEL_CUT")
1869
		actualizar();
1870
 
1871
		$(elemento).mousemove(function(e){
1872
			mouse = raton(this, e);
1873
			//console.log("raton x: "+mouse.x+ " raton Y: " +mouse.y+ " tx: "+tx+" ty: "+ty+" txf:"+(txf+tx)+" tyf:"+(tyf+ty) )
1874
			if(!recorte_listo){
8356 nelberth 1875
				if(x<mouse.x &&(xf+x)>mouse.x && y<mouse.y && (y+yf)>mouse.y){
1876
					if((xf+x-cuadro_dimencion)<mouse.x &&(xf+x)>mouse.x && (y+yf-cuadro_dimencion)<mouse.y && (y+yf)>mouse.y){
1877
			 			$(elemento).css("cursor","nw-resize");
1878
			 		}else if((xf+x-cuadro_dimencion)<mouse.x &&(xf+x)>mouse.x && y<mouse.y && (y+cuadro_dimencion)>mouse.y){
1879
			 			$(elemento).css("cursor","ne-resize");
1880
			 		}else if(x<mouse.x &&(cuadro_dimencion+x)>mouse.x && y<mouse.y && (y+cuadro_dimencion)>mouse.y){
1881
			 			$(elemento).css("cursor","se-resize");
1882
			 		}else if(x<mouse.x &&(cuadro_dimencion+x)>mouse.x && (y+yf-cuadro_dimencion)<mouse.y &&(y+yf)>mouse.y){
1883
			 			$(elemento).css("cursor","sw-resize");
1884
			 		}else{
1885
						$(elemento).css("cursor","move");
1886
					}
6682 nelberth 1887
			 	}else{
1888
			 		$(elemento).css("cursor","default");
1889
			 	}
1890
			}else if(texto_listo){
1891
				if(tx-10<mouse.x && tx-10+txf>mouse.x && ty-10<mouse.y && ty-10+tyf>mouse.y){
1892
			 		$(elemento).css("cursor","move");
1893
			 	}else if((txf+tx-10)<mouse.x &&(txf+tx-10+20)>mouse.x && (ty-10+tyf)<mouse.y && (ty-10+tyf+20)>mouse.y){
1894
			 		$(elemento).css("cursor","pointer");
1895
			 	}else{
1896
			 		$(elemento).css("cursor","default");
1897
			 	}
1898
			}
1899
			else{
1900
				$(elemento).css("cursor","default");
1901
			}
1902
		})
1903
		$(elemento).mousedown(function(e){
1904
			mouse = raton(this, e);
1905
			if(!recorte_listo){
8356 nelberth 1906
				if(x<mouse.x &&(xf+x)>mouse.x && y<mouse.y && (y+yf)>mouse.y){
1907
 
1908
					 if((xf+x-cuadro_dimencion)<mouse.x &&(xf+x)>mouse.x && (y+yf-cuadro_dimencion)<mouse.y && (y+yf)>mouse.y){
1909
						 t4 = true;
1910
					 }else if((xf+x-cuadro_dimencion)<mouse.x &&(xf+x)>mouse.x && y<mouse.y && (y+cuadro_dimencion)>mouse.y){
1911
						 t3 = true;
1912
					 }else if(x<mouse.x &&(cuadro_dimencion+x)>mouse.x && y<mouse.y && (y+cuadro_dimencion)>mouse.y){
1913
						 t1 = true;
1914
					 }else if(x<mouse.x &&(cuadro_dimencion+x)>mouse.x && (y+yf-cuadro_dimencion)<mouse.y &&(y+yf)>mouse.y){
1915
						 t2 = true;
1916
					 }else{
1917
						 cli = true;
1918
					 }
1919
				  }
6682 nelberth 1920
			}else if(texto_listo){
1921
				if(tx-10<mouse.x && tx-10+txf>mouse.x && ty-10<mouse.y && ty-10+tyf>mouse.y){
1922
			 		tcli=true;
1923
			 	}else if((txf+tx-10)<mouse.x &&(txf+tx-10+20)>mouse.x && (ty-10+tyf)<mouse.y && (ty-10+tyf+20)>mouse.y){
1924
			 		rotar=true;
1925
			 	}
1926
			}
1927
 
1928
		 })
1929
 
11033 nelberth 1930
		 $('.editorNoticia').mousemove(function(e){
6682 nelberth 1931
		 	mouse = raton(this, e);
1932
		 	if(!recorte_listo){
1933
			 	if(cli){
1934
			 		if((mouse.y-(yf/2))>=0&&(mouse.y+(yf/2))<=alto){
1935
				 		y = (mouse.y-(yf/2));
1936
			 		}else{
1937
			 			if((mouse.y-(yf/2))<0){
1938
			 				y=0;
1939
			 			}
1940
			 			if((mouse.y+(yf/2))>alto){
1941
			 				y=alto-yf;
1942
			 			}
1943
			 		}
1944
			 		if((mouse.x-(xf/2))>=0&&(mouse.x+(xf/2))<=ancho){
1945
			 			x = (mouse.x-(xf/2));
1946
			 		}else{
1947
			 			if((mouse.x-(xf/2))<0){
1948
			 				x=0;
1949
			 			}
1950
			 			if((mouse.x+(xf/2))>ancho){
1951
			 				x=(ancho)-xf;
1952
			 			}
1953
			 		}
1954
			 	}
11038 nelberth 1955
				 if(blockCelda){
6682 nelberth 1956
			 	if(t4){
11032 nelberth 1957
					cal1=mouse.y-y;
1958
			 		cal2=cal1/recorte;
1959
					cal3=x+cal2;
1960
					if(cal2>50){
1961
						if(cal3<=ancho&&mouse.y<=alto){
1962
							yf=cal1;
1963
				 			xf=cal2;
1964
						}else if(cal3<=ancho&&mouse.y>alto){
1965
							yf=alto-y;
1966
							xf=yf/recorte
1967
						}else if(cal3>=ancho&&mouse.y<=alto){
1968
							xf=ancho-x;
1969
							yf=xf*recorte;
6682 nelberth 1970
						}
11032 nelberth 1971
				 	}
6682 nelberth 1972
			 	}
1973
			 	if(t3){
11032 nelberth 1974
					cal1=yf+(y-mouse.y);
1975
			 		cal2=cal1/recorte;
1976
					cal3=x+cal2;
1977
					if(cal2>50){
1978
						if(cal3<=ancho&&mouse.y>=0){
1979
							yf=cal1;
1980
				 			xf=cal2;
1981
							y=mouse.y;
1982
						}else if(cal3<=ancho&&mouse.y<0){
1983
							yf=yf+y;
1984
							xf=yf/recorte
1985
							y=0;
11038 nelberth 1986
						}else if(cal3>=ancho&&mouse.y>=0){
11032 nelberth 1987
							xf=ancho-x;
1988
							y=y+(yf-xf*recorte);
1989
							yf=xf*recorte;
1990
						}
1991
 
1992
				 	}
1993
 
6682 nelberth 1994
			 	}
1995
			 	if(t2){
11032 nelberth 1996
 
1997
					cal1=mouse.y-y;
1998
			 		cal2=cal1/recorte;
1999
					cal3=x+(yf-cal1)/recorte;cal2;
2000
					if(cal2>50){
2001
						if(cal3>=0&&mouse.y<=alto){
2002
							x=cal3;
2003
							yf=cal1;
2004
				 			xf=cal2;
11038 nelberth 2005
						}else if(cal3<0&&mouse.y>alto){
11032 nelberth 2006
							yf=alto-y;
2007
							x=x+(xf-yf/recorte);
2008
							xf=yf/recorte
11038 nelberth 2009
						}else if(cal3<0&&mouse.y<=alto){
11032 nelberth 2010
							xf=xf+x;
2011
							yf=xf*recorte;
2012
							x=0;
2013
						}
2014
				 	}
2015
 
6682 nelberth 2016
			 	}
2017
			 	if(t1){
11032 nelberth 2018
					cal0=y-mouse.y;
2019
					cal1=yf+cal0;
2020
			 		cal2=cal1/recorte;
2021
					cal3=x-cal0/recorte;
2022
					if(cal2>50){
2023
						if(cal3>=0&&mouse.y>=0){
2024
							yf=cal1;
2025
					 		xf=cal2;
2026
					 		x=cal3;
2027
					 		y=mouse.y;
2028
						}else if(mouse.y<0||cal3<0&&mouse.y<0){
2029
							yf=yf+y;
2030
							x=x+(xf-yf/recorte);
2031
							xf=yf/recorte
2032
							y=0;
11038 nelberth 2033
						}else if(cal3<0&&mouse.y>=0){
11032 nelberth 2034
							xf=xf+x;
2035
							y=y+(yf-xf*recorte);
2036
							yf=xf*recorte;
2037
							x=0;
2038
						}
2039
				 	}
2040
 
2041
				}
6682 nelberth 2042
				}else{
11032 nelberth 2043
				if(t4){
2044
 
2045
					cal1=mouse.y-y;
2046
					cal2=mouse.x-x;
2047
					if(cal1>50){
2048
						yf=mouse.y<=alto?cal1:alto-y;
2049
				 	}
2050
					if(cal2>50){
2051
						xf=mouse.x<=ancho?cal2:ancho-x;
2052
					}
6682 nelberth 2053
			 	}
11032 nelberth 2054
 
6682 nelberth 2055
			 	if(t3){
11032 nelberth 2056
					cal1=yf-(mouse.y-y);
2057
					cal2=mouse.x-x;
2058
					if(cal1>50){
2059
 
2060
						if(mouse.y>=0){
2061
							yf=cal1;
2062
							y=mouse.y;
2063
						}else{
2064
							yf=yf+y;
6682 nelberth 2065
							y=0;
2066
						}
11032 nelberth 2067
				 	}
2068
					if(cal2>50){
2069
						xf=mouse.x<=ancho?cal2:ancho-x;
2070
					}
6682 nelberth 2071
			 	}
2072
				/* Izquierda abajo */
2073
			 	if(t2){
11032 nelberth 2074
					cal1=mouse.y-y;
2075
					cal2=xf-(mouse.x-x);
2076
					if(cal1>50){
2077
						yf=yf=mouse.y<=alto?cal1:alto-y;
2078
					}
2079
					if(cal2>50){
2080
						if(mouse.x>=0){
2081
							xf=cal2;
2082
							x=mouse.x;
2083
						}else{
2084
							xf=xf+x;
2085
							x=0;
2086
						}
2087
					}
6682 nelberth 2088
			 	}
2089
				/* izquierda arriba */
2090
			 	if(t1){
11032 nelberth 2091
 
2092
					cal1=yf-(mouse.y-y);
2093
					cal2=xf-(mouse.x-x);
2094
					if(cal1>50){
2095
 
2096
						if(mouse.y>=0){
2097
							yf=cal1;
2098
							y=mouse.y;
2099
						}else{
2100
							yf=yf+y;
6682 nelberth 2101
							y=0;
2102
						}
11032 nelberth 2103
				 	}
2104
					if(cal2>50){
2105
						if(mouse.x>=0){
2106
							xf=cal2;
2107
							x=mouse.x;
2108
						}else{
2109
							xf=xf+x;
2110
							x=0;
2111
						}
2112
					}
2113
 
6682 nelberth 2114
			 	}
11032 nelberth 2115
				}
6682 nelberth 2116
 
2117
		 	actualizar();
2118
		 	}else if(texto_listo){
2119
		 		if(tcli){
2120
		 			tx=mouse.x-(txf/2)
2121
		 			ty=mouse.y-(tyf/2)
2122
		 		}else if(rotar){
2123
 
2124
		 		}
2125
 
2126
		 		actualizar2();
2127
		 	}
2128
		 })
11034 nelberth 2129
		 $('body').mouseup(function(e){
6682 nelberth 2130
		 	if(!recorte_listo){
2131
			 	cli=false;
2132
			 	t1=false;
2133
			 	t2=false;
2134
			 	t3=false;
2135
			 	t4=false;
2136
		 	}else if (texto_listo) {
2137
		 		tcli=false;
2138
		 	}
2139
		 })
2140
 
2141
 
2142
	}
2143
	/* Titulo */
2144
 
2145
var titulo_noticia, censor_titulo = true, numero_titulo=0;
2146
	$(document).on("keyup change", "#name", function(e){
2147
	console.log(numero_titulo)
2148
	titulo_noticia = $(this).val();
2149
	titulo_elemento= $(".titulo_topico");
2150
	if(titulo_noticia!=""){
2151
		if(censor_titulo){
2152
			titulo_elemento.html(titulo_noticia);
2153
			if(titulo_elemento.height()>38){
2154
				var titulo_noticia2 = "";
2155
				for(var i =0; i <titulo_noticia.length;i++){
2156
					titulo_noticia2 = titulo_noticia2 + titulo_noticia.split("")[i];
2157
					titulo_elemento.html(titulo_noticia2);
2158
					if(titulo_elemento.height()>38){
2159
						titulo_noticia2 = titulo_noticia2.slice(0,-5) + "...";
2160
						titulo_elemento.html(titulo_noticia2);
2161
						numero_titulo = titulo_noticia2.length;
2162
						censor_titulo=false;
2163
						break;
2164
					}
2165
 
2166
				}
2167
			}else{
2168
				numero_titulo=0;
2169
			}
2170
		}else{
2171
			if(numero_titulo+1>=titulo_noticia.length){
2172
				titulo_elemento.html(titulo_noticia);
2173
				censor_titulo=true;
2174
			}
2175
		}
2176
	}else{
2177
		titulo_elemento.html("LABEL_TITLE");
2178
		censor_titulo = true;
2179
	}
2180
})
2181
 
1 www 2182
});
2183
JS;
2184
$this->inlineScript()->captureEnd();
2185
?>
2186
 
2187
 
2188
 
2189
<!-- Content Header (Page header) -->
2190
<section class="content-header">
2191
	<div class="container-fluid">
2192
    	<div class="row mb-2">
2193
        	<div class="col-sm-12">
2194
            	<h1>LABEL_CAPSULES</h1>
2195
			</div>
2196
		</div>
2197
	</div><!-- /.container-fluid -->
2198
</section>
2199
 
6704 nelberth 2200
<section class="content" id="content1">
1 www 2201
	<div class="container-fluid">
2202
    	<div class="row">
2203
        	<div class="col-12">
2204
				<div class="card">
2205
					<div class="card-header">
2206
						<?php
2207
                        $form = $this->form;
2208
            	        $form->setAttributes([
2209
                            'name'    => 'form-filter',
2210
                            'id'      => 'form-filter',
2211
                        ]);
2212
 
2213
                        $form->prepare();
2214
                        echo $this->form()->openTag($form);
2215
                        ?>
2216
                        <div class="form-group">
2217
                            <?php
2218
                            $element = $form->get('topic_uuid');
2219
 
2220
                            $element->setAttributes(['class' => 'form-control']);
2221
                            $element->setLabel('LABEL_TOPIC');
2222
                            echo $this->formLabel($element);
2223
                            echo $this->formSelect($element);
2224
                            ?>
2225
                        </div>
2226
						<?php echo $this->form()->closeTag($form); ?>
2227
					</div>
2228
					<div class="card-body">
20 steven 2229
        	    		<table id="gridTable" class="table   table-hover">
1 www 2230
                      		<thead>
2231
        						<tr>
2232
                                	<th>LABEL_NAME</th>
2233
                                  	<th>LABEL_DETAILS</th>
2234
                                  	<th>LABEL_IMAGES</th>
2235
                                  	<th>LABEL_ACTIONS</th>
2236
                                </tr>
2237
                       		</thead>
2238
                         	<tbody>
2239
                         	</tbody>
2240
                    	</table>
2241
                   	</div>
2242
                   	<div class="card-footer clearfix">
2243
                   		<div style="float:right;">
2244
							<button type="button" class="btn btn-info btn-refresh"><i class="fa fa-refresh"></i> LABEL_REFRESH  </button>
2245
							<?php if($allowAdd) : ?>
2246
							<button type="button" class="btn btn-primary btn-add"><i class="fa fa-plus"></i> LABEL_ADD </button>
2247
							<?php endif; ?>
2248
						</div>
2249
                 	</div>
2250
          		</div>
2251
           	</div>
2252
        </div>
2253
 	</div>
2254
</section>
2255
 
2256
 
2257
<!-- The Modal -->
6694 nelberth 2258
<div id="modalCapsuleAdd" style='display:none'>
1 www 2259
 
6694 nelberth 2260
 
1 www 2261
            <!-- Modal Header -->
2262
 
6701 nelberth 2263
              <div class="d-flex justify-content-center tituloEditor">
2264
              <h4>LABEL_ADD_CAPSULE</h4>
2265
 
2266
             </div>
1 www 2267
            <!-- Modal body -->
6701 nelberth 2268
      		<div class="grid-padre">
1 www 2269
       			 <?php
2270
       			 $form = $this->formAdd;
2271
            		$form->setAttributes([
2272
                        'method'  => 'post',
2273
            		    'action'  => '',
2274
                        'name'    => 'form-capsule-add',
2275
                        'id'      => 'form-capsule-add',
2276
                    ]);
2277
 
2278
                    $form->prepare();
2279
                    echo $this->form()->openTag($form);
2280
                    ?>
6701 nelberth 2281
    				<div class="form-group grid-1-2">
1 www 2282
    				<?php
2283
                        $element = $form->get('name');
2284
 
2285
                        $element->setAttributes(['class' => 'form-control']);
2286
                        $element->setOptions(['label' => 'LABEL_NAME']);
2287
                        echo $this->formLabel($element);
2288
                        echo $this->formText($element);
2289
                    ?>
2290
				</div>
6701 nelberth 2291
                <div class="form-group grid-1-2">
1 www 2292
                	<?php
2293
                    $element = $form->get('description');
2294
                    $element->setAttributes(['id' => 'description_add', 'class' => 'form-control', 'rows' => '2','class' => 'form-control']);
2295
                    $element->setOptions(['label' => 'LABEL_DESCRIPTION']);
2296
                    echo $this->formLabel($element);
2297
                    echo $this->formTextArea($element);
2298
                    ?>
2299
   				</div>
6701 nelberth 2300
				<div class="form-group grid-1-2">
1 www 2301
    				<?php
2302
                        $element = $form->get('order');
2303
                        $element->setAttributes(['class' => 'form-control']);
2304
                        $element->setOptions(['label' => 'LABEL_ORDER']);
2305
                        echo $this->formLabel($element);
2306
                        echo $this->formText($element);
2307
                    ?>
2308
				</div>
6854 nelberth 2309
 
6701 nelberth 2310
          		<div class="form-group grid-1-2">
1 www 2311
    				<?php
2312
                        $element = $form->get('status');
2313
                        $element->setAttributes(['class' => 'form-control']);
2314
                        $element->setOptions(['label' => 'LABEL_STATUS']);
2315
                        echo $this->formLabel($element);
2316
                        echo $this->formSelect($element);
2317
                    ?>
2318
				</div>
6701 nelberth 2319
				<div class="form-group grid-1-2">
1 www 2320
    				<?php
2321
                        $element = $form->get('privacy');
2322
                        $element->setAttributes(['class' => 'form-control']);
2323
                        $element->setOptions(['label' => 'LABEL_PRIVACY']);
2324
                        echo $this->formLabel($element);
2325
                        echo $this->formSelect($element);
2326
                    ?>
2327
				</div>
6701 nelberth 2328
				<div class="form-group grid-1-2">
1 www 2329
    				<?php
2330
                        $element = $form->get('type');
2331
                        $element->setAttributes(['class' => 'form-control']);
2332
                        $element->setOptions(['label' => 'LABEL_TYPE']);
2333
                        echo $this->formLabel($element);
2334
                        echo $this->formSelect($element);
2335
                    ?>
2336
				</div>
6701 nelberth 2337
				<div class="form-group grid-1-2" id="form-row-cost">
1 www 2338
    				<?php
2339
                        $element = $form->get('cost');
2340
                        $element->setAttributes(['class' => 'form-control']);
2341
                        $element->setOptions(['label' => 'LABEL_COST']);
2342
                        echo $this->formLabel($element);
2343
                        echo $this->formText($element);
2344
                    ?>
2345
				</div>
6861 nelberth 2346
 
2347
				<?php
1 www 2348
                    $element = $form->get('marketplace');
6861 nelberth 2349
					$element->setAttributes([ 'class' => 'marketplace']);
2350
                    echo $this->formHidden($element);
2351
                ?>
2352
                <?php
6854 nelberth 2353
                    $element = $form->get('file');
2354
					$element->setAttributes([ 'class' => 'file']);
2355
                    echo $this->formHidden($element);
2356
                ?>
6907 nelberth 2357
				<div class="form-group grid-1-2 ">
2358
					<div class="imagen-contaner">
7000 nelberth 2359
						<label for="marketplaceImg">LABEL_IMAGE_MARKETPLACE</label>
6997 nelberth 2360
						<img class='marketplaceImg' src='' class="img img-responsive" style="width: 100px; height: auto"></img>
6907 nelberth 2361
					</div>
6903 nelberth 2362
				</div>
7000 nelberth 2363
				<h5 style="text-align:center " class="form-group grid-1-2" id='titleTypeImage'>LABEL_IMAGE_MARKETPLACE</h5>
6854 nelberth 2364
          		<div class="contenido form-group " id="contenido"></div>
6823 nelberth 2365
 
1 www 2366
     	      		<?php echo $this->form()->closeTag($form); ?>
2367
      		</div>
2368
 
2369
 
6694 nelberth 2370
 
1 www 2371
</div>
2372
 
2373
 
2374
<!-- The Modal -->
6977 nelberth 2375
<div  id="modalCapsuleEdit" style='display:none'>
1 www 2376
 
6976 nelberth 2377
 
1 www 2378
            <!-- Modal Header -->
2379
 
6976 nelberth 2380
			<div class="d-flex justify-content-center tituloEditor">
2381
              <h4>LABEL_EDIT_CAPSULE</h4>
2382
 
2383
             </div>
1 www 2384
            <!-- Modal body -->
6976 nelberth 2385
      		<div class="grid-padre">
2386
			  <?php
1 www 2387
       			  $form = $this->formEdit;
2388
            		$form->setAttributes([
2389
                        'method'    => 'post',
2390
                        'name'      => 'form-capsule-edit',
2391
                        'id'        => 'form-capsule-edit'
2392
                    ]);
2393
 
2394
                    $form->prepare();
2395
                    echo $this->form()->openTag($form);
6976 nelberth 2396
                ?>
2397
    				<div class="form-group grid-1-2">
1 www 2398
    				<?php
2399
                        $element = $form->get('name');
6976 nelberth 2400
 
1 www 2401
                        $element->setAttributes(['class' => 'form-control']);
2402
                        $element->setOptions(['label' => 'LABEL_NAME']);
2403
                        echo $this->formLabel($element);
2404
                        echo $this->formText($element);
2405
                    ?>
2406
				</div>
6976 nelberth 2407
                <div class="form-group grid-1-2">
1 www 2408
                	<?php
2409
                    $element = $form->get('description');
6978 nelberth 2410
                    $element->setAttributes(['id' => 'description_edit', 'class' => 'form-control', 'rows' => '2','class' => 'form-control']);
1 www 2411
                    $element->setOptions(['label' => 'LABEL_DESCRIPTION']);
2412
                    echo $this->formLabel($element);
2413
                    echo $this->formTextArea($element);
2414
                    ?>
2415
   				</div>
6976 nelberth 2416
				<div class="form-group grid-1-2">
1 www 2417
    				<?php
2418
                        $element = $form->get('order');
2419
                        $element->setAttributes(['class' => 'form-control']);
2420
                        $element->setOptions(['label' => 'LABEL_ORDER']);
2421
                        echo $this->formLabel($element);
2422
                        echo $this->formText($element);
2423
                    ?>
2424
				</div>
6976 nelberth 2425
 
2426
          		<div class="form-group grid-1-2">
1 www 2427
    				<?php
2428
                        $element = $form->get('status');
2429
                        $element->setAttributes(['class' => 'form-control']);
2430
                        $element->setOptions(['label' => 'LABEL_STATUS']);
2431
                        echo $this->formLabel($element);
2432
                        echo $this->formSelect($element);
2433
                    ?>
2434
				</div>
6976 nelberth 2435
				<div class="form-group grid-1-2">
1 www 2436
    				<?php
2437
                        $element = $form->get('privacy');
2438
                        $element->setAttributes(['class' => 'form-control']);
2439
                        $element->setOptions(['label' => 'LABEL_PRIVACY']);
2440
                        echo $this->formLabel($element);
2441
                        echo $this->formSelect($element);
2442
                    ?>
2443
				</div>
6976 nelberth 2444
				<div class="form-group grid-1-2">
1 www 2445
    				<?php
2446
                        $element = $form->get('type');
2447
                        $element->setAttributes(['class' => 'form-control']);
2448
                        $element->setOptions(['label' => 'LABEL_TYPE']);
2449
                        echo $this->formLabel($element);
2450
                        echo $this->formSelect($element);
2451
                    ?>
2452
				</div>
6976 nelberth 2453
				<div class="form-group grid-1-2" id="form-row-cost">
1 www 2454
    				<?php
2455
                        $element = $form->get('cost');
2456
                        $element->setAttributes(['class' => 'form-control']);
2457
                        $element->setOptions(['label' => 'LABEL_COST']);
2458
                        echo $this->formLabel($element);
2459
                        echo $this->formText($element);
2460
                    ?>
2461
				</div>
6976 nelberth 2462
 
2463
				<?php
2464
                    $element = $form->get('marketplace');
2465
					$element->setAttributes([ 'class' => 'marketplace']);
2466
                    echo $this->formHidden($element);
2467
                ?>
2468
                <?php
2469
                    $element = $form->get('file');
2470
					$element->setAttributes([ 'class' => 'file']);
2471
                    echo $this->formHidden($element);
2472
                ?>
2473
				<div class="form-group grid-1-2 ">
2474
					<div class="imagen-contaner">
7000 nelberth 2475
						<label for="marketplaceImg">LABEL_IMAGE_MARKETPLACE</label>
6997 nelberth 2476
						<img class='marketplaceImg' src='' class="img img-responsive" style="width: 100px; height: auto"></img>
6976 nelberth 2477
					</div>
2478
				</div>
7000 nelberth 2479
				<h5 style="text-align:center " class="form-group grid-1-2" id='titleTypeImage'>LABEL_IMAGE_MARKETPLACE</h5>
6976 nelberth 2480
          		<div class="contenido form-group " id="contenido"></div>
2481
 
1 www 2482
     	      		<?php echo $this->form()->closeTag($form); ?>
2483
      		</div>
2484
 
6976 nelberth 2485
 
1 www 2486
</div>
2487
 
2488
 
2489
 
2490
<!-- The Modal -->
2491
<div class="modal" id="modalAppMarkeplate">
2492
	<div class="modal-dialog">
2493
		<div class="modal-content">
2494
        	<!-- Modal Header -->
2495
        	<div class="modal-header">
2496
           		<h4 class="modal-title">LABEL_IMAGE_MARKETPLACE</h4>
2497
        		<button type="button" class="close" data-dismiss="modal">&times;</button>
2498
      		</div>
2499
 
2500
           	<!-- Modal body -->
2501
           	<div class="modal-body text-center">
2502
    			<img src="" class="img img-responsive" style="width: 300px; height: auto" id="image-marketplace" />
2503
          	</div>
2504
 
2505
            <!-- Modal footer -->
2506
  			<div class="modal-footer">
2507
    			<button type="button" class="btn btn-danger" data-dismiss="modal">LABEL_CLOSE</button>
2508
      		</div>
2509
      	</div>
2510
	</div>
2511
</div>
2512
 
2513
 
2514
<!-- The Modal -->
2515
<div class="modal" id="modalImageApp">
2516
	<div class="modal-dialog ">
2517
    	<div class="modal-content">
2518
 
2519
            <!-- Modal Header -->
2520
      		<div class="modal-header">
2521
        		<h4 class="modal-title">LABEL_IMAGE</h4>
2522
        		<button type="button" class="close" data-dismiss="modal">&times;</button>
2523
      		</div>
2524
 
2525
            <!-- Modal body -->
2526
            <div class="modal-body text-center">
2527
				<img src="" class="img img-responsive" style="width: 300px; height: auto" id="image-app" />
2528
      		</div>
2529
 
2530
            <!-- Modal footer -->
2531
      		<div class="modal-footer">
2532
        		<button type="button" class="btn btn-danger" data-dismiss="modal">LABEL_CLOSE</button>
2533
          	</div>
2534
         </div>
2535
	</div>
2536
</div>
2537
 
2538
 
2539
 
2540
 
2541
 
2542
 
2543
<!-- The Modal -->
2544
<div class="modal" id="notificationUsersModal">
2545
	<div class="modal-dialog modal-xl">
2546
    	<div class="modal-content">
2547
 
2548
            <!-- Modal Header -->
2549
      		<div class="modal-header">
2550
        		<h4 class="modal-title">LABEL_USERS</h4>
2551
        		<button type="button" class="close" data-dismiss="modal">&times;</button>
2552
      		</div>
2553
 
2554
            <!-- Modal body -->
2555
      		<div class="modal-body">
2556
      			<form>
2557
      				<div class="form-group">
2558
      					<label>LABEL_TOPIC</label>
2559
      					<input type="text" readonly="readonly" id="table-users-topic" class="form-control" >
2560
      				</div>
2561
      				<div class="form-group">
2562
      					<label>LABEL_CAPSULE</label>
2563
      					<input type="text" readonly="readonly" id="table-users-capsule" class="form-control" >
2564
      				</div>
2565
      			</form>
2566
      			<div style="height: 300px;overflow: scroll;">
20 steven 2567
				<table id="gridTableUsers" style="width: 100%" class="table   table-hover">
1 www 2568
            		<thead>
2569
            			<tr>
2570
                      		<th>LABEL_FIRST_NAME</th>
2571
                     		<th>LABEL_LAST_NAME</th>
2572
                         	<th>LABEL_EMAIL</th>
2573
                       		<th>LABEL_DETAILS</th>
2574
             			</tr>
2575
                  	</thead>
2576
               		<tbody>
2577
               		</tbody>
2578
         		</table>
2579
         		</div>
2580
 
2581
      		</div>
2582
 
2583
            <!-- Modal footer -->
2584
      		<div class="modal-footer">
2585
        		<button type="button" class="btn btn-danger" data-dismiss="modal">LABEL_CLOSE</button>
2586
      		</div>
2587
 
2588
    	</div>
2589
	</div>
2590
</div>
2591
 
2592
 
2593
 
2594
 
2595
 
2596
 
2597
 
2598