Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 8335 | Rev 8337 | 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
$routeAdd       = $this->url('microlearning/content/topics/add');
9
$routeDatatable = $this->url('microlearning/content/topics');
10
 
11
$allowAdd               = $acl->isAllowed($roleName, 'microlearning/content/topics/add') ? 1 : 0;
12
$allowEdit              = $acl->isAllowed($roleName, 'microlearning/content/topics/edit') ? 1 : 0;
13
$allowDelete            = $acl->isAllowed($roleName, 'microlearning/content/topics/delete') ? 1 : 0;
14
 
15
 
16
$this->headLink()->appendStylesheet($this->basePath('plugins/nprogress/nprogress.css'));
17
$this->inlineScript()->appendFile($this->basePath('plugins/nprogress/nprogress.js'));
18
 
19
$this->inlineScript()->appendFile($this->basePath('plugins/ckeditor/ckeditor.js'));
20
 
21
 
22
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-fileinput/css/fileinput.min.css'));
23
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-fileinput/themes/explorer-fas/theme.css'));
24
 
25
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/js/plugins/piexif.js'));
26
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/js/plugins/sortable.js'));
27
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/js/fileinput.js'));
28
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/js/locales/es.js'));
29
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/themes/fas/theme.js'));
30
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-fileinput/themes/explorer-fas/theme.js'));
31
 
32
 
33
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/jquery.validate.js'));
34
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/additional-methods.js'));
35
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-validation/localization/messages_es.js'));
36
 
37
$this->headLink()->appendStylesheet($this->basePath('plugins/datatables-bs4/css/dataTables.bootstrap4.min.css'));
38
$this->headLink()->appendStylesheet($this->basePath('plugins/datatables-responsive/css/responsive.bootstrap4.min.css'));
4797 nelberth 39
$this->headLink()->appendStylesheet($this->basePath('plugins/nelberth-editor/style.css'));
1 www 40
$this->inlineScript()->appendFile($this->basePath('plugins/datatables/jquery.dataTables.min.js'));
41
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-bs4/js/dataTables.bootstrap4.min.js'));
42
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-responsive/js/dataTables.responsive.min.js'));
43
$this->inlineScript()->appendFile($this->basePath('plugins/datatables-responsive/js/responsive.bootstrap4.min.js'));
44
 
45
 
46
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap4-toggle/css/bootstrap4-toggle.min.css'));
47
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap4-toggle/js/bootstrap4-toggle.min.js'));
48
 
49
$this->inlineScript()->appendFile($this->basePath('plugins/bootstrap-confirmation/dist/bootstrap-confirmation.js'));
50
$this->headLink()->appendStylesheet($this->basePath('plugins/bootstrap-checkbox/awesome-bootstrap-checkbox.css'));
51
 
52
 
53
$this->inlineScript()->appendFile($this->basePath('plugins/jquery-input-number/input-number-format.jquery.js'));
54
 
55
 
56
$status_active = \LeadersLinked\Model\Degree::STATUS_ACTIVE;
57
 
4697 nelberth 58
 
59
 
4737 nelberth 60
 
1 www 61
$this->inlineScript()->captureStart();
62
echo <<<JS
63
    jQuery( document ).ready(function( $ ) {
64
 
65
        $.validator.setDefaults({
66
            debug: true,
67
            highlight: function(element) {
68
                $(element).addClass('is-invalid');
69
            },
70
            unhighlight: function(element) {
71
                $(element).removeClass('is-invalid');
72
            },
73
            errorElement: 'span',
74
            errorClass: 'error invalid-feedback',
75
            errorPlacement: function(error, element) {
76
                if(element.parent('.btn-file').length) {
77
                    error.insertAfter(element.parent().parent());
78
                } else if(element.parent('.toggle').length) {
79
                    error.insertAfter(element.parent().parent());
80
                } else {
81
                    error.insertAfter(element.parent());
82
                }
83
            }
84
        });
85
 
86
 
87
        $.fn.showFormErrorValidator = function(fieldname, errors) {
88
            var field = $(fieldname);
89
            if(field) {
90
                $(field).addClass('is-invalid');
91
 
92
 
93
                var error = $('<span id="' + fieldname +'-error" class="error invalid-feedback">' + errors + '</div>');
5541 nelberth 94
              /*  if(element.parent('.btn-file').length) {
5539 nelberth 95
                    error.insertAfter(element.parent().parent());
96
                } else if(element.parent('.toggle').length) {
97
                    error.insertAfter(element.parent().parent());
98
                } else {
99
                    error.insertAfter(element.parent());
5541 nelberth 100
                }*/
1 www 101
            }
102
        };
103
 
104
 
105
 
106
 
107
        var allowEdit   = $allowEdit;
108
        var allowDelete = $allowDelete;
109
 
110
        var gridTable = $('#gridTable').dataTable( {
111
            'processing': true,
112
            'serverSide': true,
113
            'searching': true,
114
            'order': [[ 0, 'asc' ]],
115
            'ordering':  true,
116
            'ordenable' : true,
117
            'responsive': true,
118
            'select' : false,
119
        	'paging': true,
120
            'pagingType': 'simple_numbers',
121
    		'ajax': {
122
    			'url' : '$routeDatatable',
123
    			'type' : 'get',
124
                'beforeSend': function (request) {
125
                  NProgress.start();
126
                },
127
                'dataFilter': function(response) {
128
                    var response = jQuery.parseJSON( response );
129
 
130
                    var json                = {};
131
                    json.recordsTotal       = 0;
132
                    json.recordsFiltered    = 0;
133
                    json.data               = [];
134
 
135
 
136
                    if(response.success) {
137
                        json.recordsTotal       = response.data.total;
138
                        json.recordsFiltered    = response.data.total;
139
                        json.data               = response.data.items;
140
                    } else {
141
                        $.fn.showError(response.data)
142
                    }
143
 
144
                    return JSON.stringify( json );
145
                }
146
    		},
147
            'language' : {
148
                'sProcessing':     'LABEL_DATATABLE_SPROCESSING',
149
                'sLengthMenu':     'LABEL_DATATABLE_SLENGTHMENU',
150
                'sZeroRecords':    'LABEL_DATATABLE_SZERORECORDS',
151
                'sEmptyTable':     'LABEL_DATATABLE_SEMPTYTABLE',
152
                'sInfo':           'LABEL_DATATABLE_SINFO',
153
                'sInfoEmpty':      'LABEL_DATATABLE_SINFOEMPTY',
154
                'sInfoFiltered':   'LABEL_DATATABLE_SINFOFILTERED',
155
                'sInfoPostFix':    '',
156
                'sSearch':         'LABEL_DATATABLE_SSEARCH',
157
                'sUrl':            '',
158
                'sInfoThousands':  ',',
159
                'sLoadingRecords': 'LABEL_DATATABLE_SLOADINGRECORDS',
160
                'oPaginate': {
161
                    'sFirst':    'LABEL_DATATABLE_SFIRST',
162
                    'sLast':     'LABEL_DATATABLE_SLAST',
163
                    'sNext':     'LABEL_DATATABLE_SNEXT',
164
                    'sPrevious': 'LABEL_DATATABLE_SPREVIOUS'
165
                },
166
                'oAria': {
167
                    'sSortAscending':  ': LABEL_DATATABLE_SSORTASCENDING',
168
                    'sSortDescending': ':LABEL_DATATABLE_SSORTDESCENDING'
169
                },
170
            },
171
            'drawCallback': function( settings ) {
172
                NProgress.done();
173
                $('button.btn-delete').confirmation({
174
                    rootSelector: 'button.btn-delete',
175
                    title : 'LABEL_ARE_YOU_SURE',
176
                    singleton : true,
177
                    btnOkLabel: 'LABEL_YES',
178
                    btnCancelLabel: 'LABEL_NO',
179
                    onConfirm: function(value) {
180
                        action = $(this).data('href');
181
                        NProgress.start();
182
                        $.ajax({
183
                            'dataType'  : 'json',
184
                            'accept'    : 'application/json',
185
                            'method'    : 'post',
186
                            'url'       :  action,
187
                        }).done(function(response) {
188
                            if(response['success']) {
189
                                $.fn.showSuccess(response['data']);
190
                                gridTable.api().ajax.reload(null, false);
191
                            } else {
192
                                $.fn.showError(response['data']);
193
                            }
194
                        }).fail(function( jqXHR, textStatus, errorThrown) {
195
                            $.fn.showError(textStatus);
196
                        }).always(function() {
197
                            NProgress.done();
198
                        });
199
                    },
200
                });
201
            },
202
            'aoColumns': [
203
                { 'mDataProp': 'name' },
204
                { 'mDataProp': 'status' },
205
                { 'mDataProp': 'image' },
206
                { 'mDataProp': 'actions' },
207
    	    ],
208
            'columnDefs': [
209
                {
210
                    'targets': 0,
211
                    'className' : 'text-vertical-middle',
212
                },
213
                {
214
                    'targets': -2,
215
                    'orderable': false,
216
                    'render' : function ( data, type, row ) {
217
                        s = '&nbsp;';
218
 
219
                        if( data )  {
220
                            s = s + '&nbsp;<img class="btn-view-image-app" data-href="' + data + '" data-toggle="tooltip" src="'+data+'" title="LABEL_VIEW" style="width: 40px; object-fit: cover; height: 40px;" /> '
221
                        }  else {
222
                            s = s + '&nbsp;LABEL_IMAGE: <br>';
223
                        }
224
 
225
 
226
                        return s;
227
                    }
228
                },
229
 
230
 
231
                {
232
                    'targets': -1,
233
                    'orderable': false,
234
                    'render' : function ( data, type, row ) {
235
                        s = '';
236
 
237
                        if(allowEdit && data['link_edit']  ) {
238
                            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;';
239
                        }
240
                        if(allowDelete && data['link_delete']  ) {
241
                            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;';
242
                        }
243
                        return s;
244
                    }
245
                }
246
              ],
247
        });
248
 
249
 
250
    var validatorAdd = $('#form-topic-add').validate({
251
        debug: true,
252
        onclick: false,
253
        onkeyup: false,
254
        ignore: [],
255
        rules: {
256
            'name': {
257
                required: true,
258
                maxlength: 128,
259
            },
260
            'description': {
261
                updateCkeditor:function() {
262
                        CKEDITOR.instances.description_add.updateElement();
263
                },
264
                required: true
265
            },
266
           'file': {
267
                required: true,
268
            },
269
            'order' : {
270
                required: true,
271
                digits: true,
272
                min: 1,
273
                max: 250
274
            },
275
            'status' : {
276
                required: true,
277
            },
278
        },
279
        submitHandler: function(form)
280
        {
281
            var formdata = false;
282
            if (window.FormData){
283
                formdata = new FormData(form); //form[0]);
284
            }
5709 nelberth 285
 
286
 
287
			$('.info_noticia').prop('disabled', true);
5703 nelberth 288
			NProgress.start();
1 www 289
            $.ajax({
290
                'dataType'  : 'json',
291
                'accept'    : 'application/json',
292
                'method'    : 'post',
293
                'url'       :  $('#form-topic-add').attr('action'),
294
                'data'      :  formdata,
295
                'processData': false,
296
                'contentType': false,
297
            }).done(function(response) {
5542 nelberth 298
				console.log(response)
299
				if(response['success']) {
1 www 300
                    $.fn.showSuccess(response['data']);
5708 nelberth 301
                    $('body, html').animate({scrollTop: '0px'}, 300);
5703 nelberth 302
					$('#content1').css('display','block');
303
            		$('#addImage').css('display','none');
1 www 304
                    gridTable.api().ajax.reload(null, false);
305
                } else {
306
                    validatorAdd.resetForm();
307
                    if(jQuery.type(response['data']) == 'string') {
308
                        $.fn.showError(response['data']);
309
                    } else  {
310
                        $.each(response['data'], function( fieldname, errors ) {
311
                            $.fn.showFormErrorValidator('#form-topic-add #' + fieldname, errors);
312
                        });
313
                    }
314
                }
315
            }).fail(function( jqXHR, textStatus, errorThrown) {
5709 nelberth 316
 
5575 nelberth 317
				console.log(jqXHR)
1 www 318
                $.fn.showError(textStatus);
319
            }).always(function() {
5709 nelberth 320
				$('.info_noticia').prop('disabled', false);
1 www 321
                NProgress.done();
322
            });
323
            return false;
324
        },
325
        invalidHandler: function(form, validator) {
326
 
327
        }
328
    });
329
 
330
    var validatorEdit  = $('#form-topic-edit').validate({
331
        debug: true,
332
        onclick: false,
333
        onkeyup: false,
334
        ignore: [],
335
        rules: {
336
            'name': {
337
                required: true,
338
                maxlength: 128,
339
            },
340
            'description': {
341
                updateCkeditor:function() {
342
                        CKEDITOR.instances.description_edit.updateElement();
343
                },
344
                required: true
345
            },
346
           'file': {
5982 nelberth 347
                required: true,
1 www 348
            },
349
            'order' : {
350
                required: true,
351
                digits: true,
352
                min: 1,
353
                max: 250
354
            },
355
            'status' : {
356
                required: true,
357
            },
358
 
359
        },
360
        submitHandler: function(form)
361
        {
362
            var formdata = false;
363
            if (window.FormData){
364
                formdata = new FormData(form); //form[0]);
365
            }
366
 
7060 nelberth 367
            $('.info_noticia').prop('disabled', true);
5982 nelberth 368
			NProgress.start();
1 www 369
            $.ajax({
370
                'dataType'  : 'json',
371
                'accept'    : 'application/json',
372
                'method'    : 'post',
373
                'url'       :  $('#form-topic-edit').attr('action'),
374
                'data'      :  formdata,
375
                'processData': false,
376
                'contentType': false,
377
            }).done(function(response) {
378
                if(response['success']) {
379
                    $.fn.showSuccess(response['data']);
380
 
5994 nelberth 381
                    $('body, html').animate({scrollTop: '0px'}, 300);
5898 nelberth 382
					$('#content1').css('display','block');
383
            		$('#topicEdit').css('display','none');
1 www 384
                    gridTable.api().ajax.reload(null, false);
385
                } else {
386
                    validatorAdd.resetForm();
387
                    if(jQuery.type(response['data']) == 'string') {
388
                        $.fn.showError(response['data']);
389
                    } else  {
390
                        $.each(response['data'], function( fieldname, errors ) {
391
                            $.fn.showFormErrorValidator('#form-topic-edit #' + fieldname, errors);
392
                        });
393
                    }
394
                }
395
            }).fail(function( jqXHR, textStatus, errorThrown) {
396
                $.fn.showError(textStatus);
397
            }).always(function() {
7060 nelberth 398
 
399
				$('.info_noticia').prop('disabled', false);
1 www 400
                NProgress.done();
401
            });
402
            return false;
403
        },
404
        invalidHandler: function(form, validator) {
405
 
406
        }
407
    });
408
 
409
 
410
 
411
        $('body').on('click', '.btn-view-image-app', function(e) {
412
            e.preventDefault();
413
 
414
            $('#image-app').attr('src', $(this).data('href'));
415
            $('#modalImageApp').modal('show');
416
            return false;
417
        });
418
 
419
        $('#form-topic-add #order').inputNumberFormat({decimal: 0});
5741 nelberth 420
 
1 www 421
 
422
 
423
        $('body').on('click', 'button.btn-add', function(e) {
424
            e.preventDefault();
6015 nelberth 425
 
1 www 426
            $('#form-topic-add #name').val('');
427
            $('#form-topic-add #order').val('1');
5536 nelberth 428
            $('#form-topic-add #name').val('');
1 www 429
 
430
            $('#form-topic-add #status').val('');
431
 
432
 
433
            CKEDITOR.instances.description_add.setData('');
434
            validatorAdd.resetForm();
4693 nelberth 435
            $('#content1').css('display','none');
436
            $('#addImage').css('display','block');
4829 nelberth 437
			iniciarEditor()
4693 nelberth 438
 
1 www 439
            return false;
440
        });
5646 nelberth 441
		$('body').on('click', '#ir_atras', function(e) {
442
            e.preventDefault();
443
 
444
 
5710 nelberth 445
			$('body, html').animate({scrollTop: '0px'}, 300);
5646 nelberth 446
            $('#content1').css('display','block');
447
            $('#addImage').css('display','none');
5910 nelberth 448
			$('#topicEdit').css('display','none');
1 www 449
 
5646 nelberth 450
 
451
            return false;
452
        });
453
 
1 www 454
 
455
        $('#form-topic-edit #order').inputNumberFormat({decimal: 0});
456
 
5902 nelberth 457
       /* $('#form-topic-edit #file').fileinput({
1 www 458
            theme: 'fas',
459
            language: 'es',
460
            showUpload: false,
461
            dropZoneEnabled: false,
462
            maxFileCount: 1,
463
            allowedFileExtensions: ['jpeg', 'jpg', 'png'],
464
            msgPlaceholder: 'LABEL_RECOMMENDED_SIZE $image_size',
5902 nelberth 465
        });*/
1 www 466
 
467
 
468
        $('body').on('click', 'button.btn-edit', function(e) {
469
            e.preventDefault();
6015 nelberth 470
 
1 www 471
            var url = $(this).data('href');
5900 nelberth 472
			NProgress.start();
1 www 473
            $.ajax({
474
                'dataType'  : 'json',
475
                'accept'    : 'application/json',
476
                'method'    : 'get',
477
                'url'       :  url,
478
            }).done(function(response) {
479
                if(response['success']) {
5913 nelberth 480
					console.log(response['data'])
1 www 481
                    $('#form-topic-edit')[0].reset();
482
 
483
                    $('#form-topic-edit').attr('action',url);
6078 nelberth 484
                    $('#form-topic-edit #name').val(response['data']['name']);
1 www 485
                    $('#form-topic-edit #order').val(response['data']['order']);
486
 
5919 nelberth 487
					 $('#form-topic-edit #status').val(response['data']['status']);
1 www 488
 
489
                    CKEDITOR.instances.description_edit.setData(response['data']['description']);
490
                    validatorEdit.resetForm();
5898 nelberth 491
					$('#content1').css('display','none');
492
            		$('#topicEdit').css('display','block');
6015 nelberth 493
					iniciarEditor(false,response['data']['image']);
1 www 494
                } else {
495
                    validatorEdit.resetForm();
496
                    if(jQuery.type(response['data']) == 'string') {
497
                        $.fn.showError(response['data']);
498
                    } else  {
499
                        $.each(response['data'], function( fieldname, errors ) {
500
                            $.fn.showFormErrorValidator('#form-topic-edit #' + fieldname, errors);
501
                        });
502
                    }
503
                }
504
            }).fail(function( jqXHR, textStatus, errorThrown) {
505
                $.fn.showError(textStatus);
506
            }).always(function() {
507
                NProgress.done();
508
            });
509
        });
510
 
511
        $('body').on('click', 'button.btn-cancel', function(e) {
512
            e.preventDefault();
513
            $('#modalTopicAdd').modal('hide');
5895 nelberth 514
            $('#topicEdit').modal('hide');
1 www 515
        });
516
 
517
        $('body').on('click', 'button.btn-refresh', function(e) {
518
            e.preventDefault();
519
            gridTable.api().ajax.reload(null, false);
520
        });
521
 
8290 stevensc 522
        CKEDITOR.replace('description_add', {
523
			toolbar: [
524
                    { name: 'editing', items: ['Scayt'] },
525
                    { name: 'links', items: ['Link', 'Unlink'] },
526
                    { name: 'paragraph', items: ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote'] },
527
                    { name: 'basicstyles', items: ['Bold', 'Italic', 'Strike', 'RemoveFormat'] },
528
                    '/',
529
                    { name: 'insert', items: ['Image', 'Table', 'HorizontalRule', 'SpecialChar'] },
530
                    { name: 'styles', items: ['Styles', 'Format'] },
531
                    { name: 'tools', items: ['Maximize'] }
532
                ],
533
                removePlugins: 'elementspath,Anchor',
534
                heigth: 100
535
		});
536
        CKEDITOR.replace('description_edit', {
537
			toolbar: [
538
                    { name: 'editing', items: ['Scayt'] },
539
                    { name: 'links', items: ['Link', 'Unlink'] },
540
                    { name: 'paragraph', items: ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote'] },
541
                    { name: 'basicstyles', items: ['Bold', 'Italic', 'Strike', 'RemoveFormat'] },
542
                    '/',
543
                    { name: 'insert', items: ['Image', 'Table', 'HorizontalRule', 'SpecialChar'] },
544
                    { name: 'styles', items: ['Styles', 'Format'] },
545
                    { name: 'tools', items: ['Maximize'] }
546
                ],
547
                removePlugins: 'elementspath,Anchor',
548
                heigth: 100
549
		});
1 www 550
 
4798 nelberth 551
 
552
 
553
		/*Script del editor (Aqui comienza el cielo y la tierra) */
4803 nelberth 554
		var imagenServidorNoticia;
555
		var scroll_altura,viente;
556
		var nombre_user = $(".perfil_u_nombre").text();
557
		var primer_nombre = nombre_user.split(" ")[0];
5963 nelberth 558
		var nuevoHtmlImagen='<div class="articulo_noticia animated fadeIn"><div class="pasos"><div class="titulo_pasos animated fadeInDown delay-04 fast">LABEL_STEP_1</div><div class="paso_opcion"><div class="responsing_cut"><div class="icon_cut"><span class="fa fa-scissors"></span></div><div class="contenido_cut"><div class="animated fadeInRight delay-04 fast"><div><div class="titulo_cut"><div>LABEL_CUT</div><div class="fa fa-times" id="cerrar_cut_modal"></div></div><div class="opcion_editor recortar10"><div>LABEL_CUT</div><div id="blockCelda"><span class="fa fa-lock"></span></div></div></div></div></div></div><div class="responsing_text"><div class="icon_text"><span class="fa fa-text-width"></span></div><div class="contenido_text"><div class="animated fadeInRight delay-04 fast"><div class="texto"><div class="titulo_text"><div>LABEL_ADD_TEXT</div><div class="fa fa-times" id="cerrar_text_modal"></div></div><input id="texto_input" type="text" name="texto" placeholder="LABEL_ADD_TEXT_HERE"><div class="fonts"><div class="font" id="negritas" data-tooltip="Negritas"><i class="fa fa-bold" aria-hidden="true"></i></div><div class="font" id="italic" data-tooltip="Letra Cursiva"><i class="fa fa-italic" aria-hidden="true"></i></div><input type="color" class="" data-tooltip="Color de la letra" name="" id="color" value="#ffffff"> <input type="number" class="" data-tooltip="Tamaño de la letra" name="" id="font-size" max="500" min="1" step="1" value="48"></div><div class="fonts"><div class="font fa" data-tooltip="Sombra de la letra" id="shadow">A</div><div class="font" id="rectangulo" data-tooltip="Fondo de la letra"><div class="rectangulo">C</div></div><input type="color" name="" id="colorrect" value="#000000" class="" data-tooltip="Color del fondo"> <input type="number" name="" id="opacidad" max="100" min="1" step="1" value="100" class="" data-tooltip="Transparensia del fondo"></div><div class="fonts_style"><div class="fs at" id="arial">LABEL_FONT_ARIAL</div><div class="fs" id="calibri">LABEL_FONT_CALIBRI</div><div class="fs" id="forte">LABEL_FONT_FORTE</div><div class="fs" id="impact">LABEL_FONT_IMPACT</div><div class="fs" id="jokerman">LABEL_FONT_JOKERMAN</div><div class="fs" id="mb">LABEL_FONT_MV_BOLI</div><div class="fs" id="tnr">LABEL_FONT_TIMES_NEW_ROMAN</div><div class="fs" id="verdana">LABEL_FONT_VERDANA</div><div class="fs" id="vivaldi">LABEL_FONT_VIVALDI</div></div></div></div></div></div><div class="responsing_filtros"><div class="icon_filter"><span class="fa fa-eyedropper"></span></div><div class="contenido_filter"><div class="titulo_filtro"><div>LABEL_FILTERS</div><div class="fa fa-times" id="cerrar_filter_modal"></div></div><div class="opciones_imagen"><div class="opcion_editor oa" id="normal">LABEL_FILTER_NORMAL</div><div class="opcion_editor" id="noche">LABEL_FILTER_NIGHT</div><div class="opcion_editor" id="sa">LABEL_FILTER_SAINT_ANA</div><div class="opcion_editor" id="crema">LABEL_FILTER_CREAM</div><div class="opcion_editor" id="magia">LABEL_FILTER_MAGIC</div><div class="opcion_editor" id="relieve">LABEL_FILTER_RELIEF</div><div class="opcion_editor" id="luz">LABEL_FILTER_LIGHT</div><div class="opcion_editor" id="saturacion">LABEL_FILTER_SATURATION</div><div class="opcion_editor" id="retoque">LABEL_FILTER_RETOUCH</div><div class="opcion_editor" id="orange">LABEL_FILTER_ORANGE</div><div class="opcion_editor" id="setenta">LABEL_FILTER_WIND</div><div class="opcion_editor" id="desierto">LABEL_FILTER_DESERT</div><div class="opcion_editor" id="bosque">LABEL_FILTER_FOREST</div><div class="opcion_editor" id="villa">LABEL_FILTER_TOWN</div><div class="opcion_editor" id="rosa">LABEL_FILTER_PINK</div><div class="opcion_editor" id="historia">LABEL_FILTER_HISTORY</div><div class="opcion_editor" id="gris">LABEL_FILTER_GRAY</div><div class="opcion_editor" id="lhs">LABEL_FILTER_OLD_PICTURE</div><div class="opcion_editor" id="encantador">LABEL_FILTER_CHARMING</div><div class="opcion_editor" id="emocion">LABEL_FILTER_EMOTION</div><div class="opcion_editor" id="beige">LABEL_FILTER_BEIGE</div><div class="opcion_editor" id="fine">LABEL_FILTER_FINE</div><div class="opcion_editor" id="lord">LABEL_FILTER_LORD</div><div class="opcion_editor" id="70">LABEL_FILTER_70S</div><div class="opcion_editor" id="arbol">LABEL_FILTER_TREE</div><div class="opcion_editor" id="verano">LABEL_FILTER_SUMMER</div><div class="opcion_editor" id="cf">LABEL_FILTER_COLD_WEATHER</div><div class="opcion_editor" id="angeles">LABEL_FILTER_ANGELS</div><div class="opcion_editor" id="caliente">LABEL_FILTER_HOT</div><div class="opcion_editor" id="otono">LABEL_FILTER_FALL</div><div class="opcion_editor" id="marzo">LABEL_FILTER_MARCH</div><div class="opcion_editor" id="pera">LABEL_FILTER_PEAR</div><div class="opcion_editor" id="comun">LABEL_FILTER_COMMON</div><div class="opcion_editor" id="oro">LABEL_FILTER_GOLD</div><div class="opcion_editor" id="gotico">LABEL_FILTER_GOTHIC</div><div class="opcion_editor" id="forestal">LABEL_FILTER_FORESTRY</div><div class="opcion_editor" id="luna">LABEL_FILTER_MOON</div><div class="opcion_editor" id="fiesta">LABEL_FILTER_PARTY</div></div></div></div><div class="volver"><span class="icon-undo"></span>LABEL_START_OVER</div><div class="paso_1 paso animated bounceInDown delay-04 fast">1</div><div class="paso_2 a1 animated bounceInDown delay-06 fast">2</div><div class="paso_2 b1 animated bounceInDown delay-08 fast">3</div></div></div><div class="editor_imagenes"><div class="fondo_oscuro"></div><div class="editor_imagenes2"><div class="filtros animated fadeInLeft delay-04 fast"><div class="titulo_filtro"><span class="icon-eyedropper fa fa-eyedropper"></span>LABEL_FILTERS</div><div class="opciones_imagen"><div class="opcion_editor oa" id="normal">LABEL_FILTER_NORMAL</div><div class="opcion_editor" id="noche">LABEL_FILTER_NIGHT</div><div class="opcion_editor" id="sa">LABEL_FILTER_SAINT_ANA</div><div class="opcion_editor" id="crema">LABEL_FILTER_CREAM</div><div class="opcion_editor" id="magia">LABEL_FILTER_MAGIC</div><div class="opcion_editor" id="relieve">LABEL_FILTER_RELIEF</div><div class="opcion_editor" id="luz">LABEL_FILTER_LIGHT</div><div class="opcion_editor" id="saturacion">LABEL_FILTER_SATURATION</div><div class="opcion_editor" id="retoque">LABEL_FILTER_RETOUCH</div><div class="opcion_editor" id="orange">LABEL_FILTER_ORANGE</div><div class="opcion_editor" id="setenta">LABEL_FILTER_WIND</div><div class="opcion_editor" id="desierto">LABEL_FILTER_DESERT</div><div class="opcion_editor" id="bosque">LABEL_FILTER_FOREST</div><div class="opcion_editor" id="villa">LABEL_FILTER_TOWN</div><div class="opcion_editor" id="rosa">LABEL_FILTER_PINK</div><div class="opcion_editor" id="historia">LABEL_FILTER_HISTORY</div><div class="opcion_editor" id="gris">LABEL_FILTER_GRAY</div><div class="opcion_editor" id="lhs">LABEL_FILTER_OLD_PICTURE</div><div class="opcion_editor" id="encantador">LABEL_FILTER_CHARMING</div><div class="opcion_editor" id="emocion">LABEL_FILTER_EMOTION</div><div class="opcion_editor" id="beige">LABEL_FILTER_BEIGE</div><div class="opcion_editor" id="fine">LABEL_FILTER_FINE</div><div class="opcion_editor" id="lord">LABEL_FILTER_LORD</div><div class="opcion_editor" id="70">LABEL_FILTER_70S</div><div class="opcion_editor" id="arbol">LABEL_FILTER_TREE</div><div class="opcion_editor" id="verano">LABEL_FILTER_SUMMER</div><div class="opcion_editor" id="cf">LABEL_FILTER_COLD_WEATHER</div><div class="opcion_editor" id="angeles">LABEL_FILTER_ANGELS</div><div class="opcion_editor" id="caliente">LABEL_FILTER_HOT</div><div class="opcion_editor" id="otono">LABEL_FILTER_FALL</div><div class="opcion_editor" id="marzo">LABEL_FILTER_MARCH</div><div class="opcion_editor" id="pera">LABEL_FILTER_PEAR</div><div class="opcion_editor" id="comun">LABEL_FILTER_COMMON</div><div class="opcion_editor" id="oro">LABEL_FILTER_GOLD</div><div class="opcion_editor" id="gotico">LABEL_FILTER_GOTHIC</div><div class="opcion_editor" id="forestal">LABEL_FILTER_FORESTRY</div><div class="opcion_editor" id="luna">LABEL_FILTER_MOON</div><div class="opcion_editor" id="fiesta">LABEL_FILTER_PARTY</div></div></div><div class="canvas_imagen"><div class="canvas recortar"><div class="canvas_subir" id="imagen_noticia"><span class="icon-plus fa fa-plus"></span>LABEL_DRAG_IMAGE_HERE</div></div></div><div class="modificar animated fadeInRight delay-04 fast"><div><div class="titulo_recortar"><span class="icon-ungroup fa fa-scissors"></span>LABEL_CUT</div><div class="opcion_editor recortar10"><div>LABEL_CUT</div><div id="blockCelda"><span class="fa fa-lock"></span></div></div></div><div class="texto"><div class="titulo_texto"><span class="icon-plus fa fa-text-width"></span>LABEL_ADD_TEXT</div><input id="texto_input" type="text" name="texto" placeholder="LABEL_ADD_TEXT_HERE"><div class="fonts"><div class="font" id="negritas" data-tooltip="Negritas"><i class="fa fa-bold" aria-hidden="true"></i></div><div class="font" id="italic" data-tooltip="Letra Cursiva"><i class="fa fa-italic" aria-hidden="true"></i></div><input type="color" class="" data-tooltip="Color de la letra" name="" id="color" value="#ffffff"> <input type="number" class="" data-tooltip="Tamaño de la letra" name="" id="font-size" max="500" min="1" step="1" value="48"></div><div class="fonts"><div class="font fa" data-tooltip="Sombra de la letra" id="shadow">A</div><div class="font" id="rectangulo" data-tooltip="Fondo de la letra"><div class="rectangulo">C</div></div><input type="color" name="" id="colorrect" value="#000000" class="" data-tooltip="Color del fondo"> <input type="number" name="" id="opacidad" max="100" min="1" step="1" value="100" class="" data-tooltip="Transparensia del fondo"></div><div class="fonts_style"><div class="fs at" id="arial">LABEL_FONT_ARIAL</div><div class="fs" id="calibri">LABEL_FONT_CALIBRI</div><div class="fs" id="forte">LABEL_FONT_FORTE</div><div class="fs" id="impact">LABEL_FONT_IMPACT</div><div class="fs" id="jokerman">LABEL_FONT_JOKERMAN</div><div class="fs" id="mb">LABEL_FONT_MV_BOLI</div><div class="fs" id="tnr">LABEL_FONT_TIMES_NEW_ROMAN</div><div class="fs" id="verdana">LABEL_FONT_VERDANA</div><div class="fs" id="vivaldi">LABEL_FONT_VIVALDI</div></div></div></div></div><div class="botones_dimenciones"><div class="scale"><div class="dimenciones"><div id="ancho">1240px</div><div>x</div><div id="alto">720px</div></div><div class="porciento"><div id="menos_scale"><span class="icon-minus fa fa-minus"></span></div><div class="ps"><ul class="cantidades_scale"><li data-scale="2" class="as">200%</li><li data-scale="1" class="as">100%</li><li data-scale="0.75" class="as">75%</li><li data-scale="0.5" class="as">50%</li><li data-scale="0.25" class="as">25%</li></ul><div id="porciento_scale">50%</div></div><div id="mas_scale"><span class="icon-plus fa fa-plus"></span></div></div></div><div class="botones"><button class="boton_normal" id="ir_atras">LABEL_GO_BACK</button><button class="boton_normal" id="boton_recortar">LABEL_DATATABLE_SNEXT</button></div></div></div></div><dav class="fixed_noticia"></dav><dav class="cuadro_noticias animated bounceInUp delay-04" id="cuadro_noticias"><dav class="relative"><div class="titulo_topico">LABEL_TITLE_TOPIC</div><canvas class="imagen_noticias" id="imagen_noticias" width="320" height="480"></canvas></dav><div class="progreso d-flex align-items-center justify-content-between"><progress value="0" max="100"></progress><span class="ml-2">0.0%</span></div></dav>'
5983 nelberth 559
 
5207 nelberth 560
		$(document).on("click", ".info_noticia", function(e){
5709 nelberth 561
			imagenServidorNoticia = elemento.toDataURL("image/jpeg", 1.0);
562
			console.log(imagenServidorNoticia.split(','))
5989 nelberth 563
			$('.file').val(imagenServidorNoticia.split(',')[1]);
564
			console.log($('.file').val())
5709 nelberth 565
			$(".c1").addClass("paso");
5703 nelberth 566
 
5513 nelberth 567
 
5709 nelberth 568
		})
6045 nelberth 569
		var edit;
6015 nelberth 570
		function iniciarEditor(add=true, image=''){
5864 nelberth 571
		 cortar=false;
4803 nelberth 572
		recorte_listo=false;
573
		texto="";
574
		seis=true;
575
		color="#ffffff";
576
		texto_listo=false,siete=false;
577
		uno=true;
578
		size=48;
6850 nelberth 579
		blockCelda=true;
4803 nelberth 580
		cinco=true;
4944 nelberth 581
		xf=320,yf =480;
4803 nelberth 582
		negritas=false, bold="";
583
		shadow = true, nueve=true;
584
		italic=false, ita="";
585
		rectangulo=false, diez=false;
586
     	fontfamily="Arial";
587
     	r=0,g=0,b=0,a=1;
6049 nelberth 588
		 edit=add;
6046 nelberth 589
		console.log(edit)
4806 nelberth 590
		window.clearInterval(editorNoticia);
5202 nelberth 591
		setTimeout(function(){
592
			scroll_altura=$(".articulo_noticia").offset().top-110;
4821 nelberth 593
			anchoFondoOscuro = $(".articulo_noticia").width();
4823 nelberth 594
			altoFondoOscuro = $(".editor_imagenes").height();
4821 nelberth 595
			$(".fondo_oscuro").css("width",""+anchoFondoOscuro+"px");
4825 nelberth 596
			$(".fondo_oscuro").css("height",""+altoFondoOscuro+"px");
5202 nelberth 597
 
6022 nelberth 598
		},navegacion(nuevoHtmlImagen,edit,image));
5202 nelberth 599
 
4829 nelberth 600
		}
4798 nelberth 601
 
4801 nelberth 602
		$(document).on("click", ".volver", function(){
603
		var nombre_user = $(".perfil_u_nombre").text();
604
		var primer_nombre = nombre_user.split(" ")[0];
5864 nelberth 605
		 cortar=false;
4801 nelberth 606
		cinco=true;
607
		recorte_listo=false;
608
		texto="";
609
		seis=true;
610
		color="#ffffff";
611
		texto_listo=false,siete=false;
612
		uno=true;
6850 nelberth 613
		blockCelda=true;
4801 nelberth 614
		size=48;
4944 nelberth 615
		xf=320,yf =480;
4801 nelberth 616
		negritas=false, bold="";
617
		shadow = true, nueve=true;
618
		italic=false, ita="";
619
		rectangulo=false, diez=false;
620
     	fontfamily="Arial";
621
     	r=0,g=0,b=0,a=1;
4804 nelberth 622
		 var imagenServidorNoticia;
6048 nelberth 623
		 console.log(edit)
4801 nelberth 624
		window.clearInterval(editorNoticia);
625
		setTimeout(function(){
626
			scroll_altura=$(".articulo_noticia").offset().top-110;
627
			anchoFondoOscuro = $(".articulo_noticia").width();
4823 nelberth 628
			altoFondoOscuro = $(".editor_imagenes").height();
4801 nelberth 629
			$(".fondo_oscuro").css("width",""+anchoFondoOscuro+"px");
4825 nelberth 630
			$(".fondo_oscuro").css("height",""+altoFondoOscuro+"px");
4801 nelberth 631
 
6022 nelberth 632
		},navegacion(nuevoHtmlImagen,edit,'',false));
4815 nelberth 633
 
4816 nelberth 634
		})
4801 nelberth 635
 
6018 nelberth 636
		function navegacion(nuevoHtmlImagen,add,image,reload=true){
5908 nelberth 637
			if(add){
6001 nelberth 638
				$('#contenido2').html('')
639
				$('#contenido').html(nuevoHtmlImagen)
640
 
5908 nelberth 641
			}else{
6017 nelberth 642
				if(reload){
643
					$('#contenido').html('')
644
					const getBase64FromUrl = async (url) => {
645
						const data = await fetch(url);
646
						const blob = await data.blob();
647
						return new Promise((resolve) => {
648
							const reader = new FileReader();
649
							reader.readAsDataURL(blob);
650
							reader.onloadend = function() {
651
							const base64data = reader.result;
652
							resolve(base64data);
653
							}
654
						});
655
					}
656
 
657
					getBase64FromUrl(image).then(function(e){
6080 nelberth 658
						$('#form-topic-edit #name').trigger('change');
6017 nelberth 659
						$(".volver").css("display","block")
660
						$(".a1").addClass("paso");
661
						$(".titulo_pasos").html("LABEL_STEP_2");
662
						setTimeout(function(){
663
							recorte_listo=true;
664
							$(".fondo_oscuro").css("display","none");
665
							$("#boton_recortar").removeClass("recortar").text("LABEL_SEND").addClass("info_noticia").attr('type','submit');
666
							$(".recortar10").removeClass("recortar");
667
							$(".canvas").removeClass("recortar");
668
							$(".b1").addClass("paso");
669
							$(".titulo_pasos").html("LABEL_STEP_3");
670
							if(texto!=""){
671
								seis=true;
672
								siete=true;
673
							}
674
							cinco=true;
675
							dos=true;
676
							cuatro=true;
677
							actualizar();
5979 nelberth 678
 
6017 nelberth 679
						},editorNoticia(e));
680
 
681
 
682
					})
6021 nelberth 683
 
684
					setTimeout(function(){
6017 nelberth 685
						$(".canvas_subir").html('<span class="icon-plus fa fa-spinner"></span> Cargando...')
6081 nelberth 686
						$('#form-topic-edit #name').trigger('change');
6017 nelberth 687
					},$('#contenido2').html(nuevoHtmlImagen));
688
				}else{
689
					$('#contenido').html('')
6082 nelberth 690
					setTimeout(function(){
691
						$('#form-topic-edit #name').trigger('change');
692
					},$('#contenido2').html(nuevoHtmlImagen));
6017 nelberth 693
				}
5978 nelberth 694
			}
695
		}
4816 nelberth 696
 
4798 nelberth 697
		$(window).on("scroll", function(){
5132 nelberth 698
			console.log(scroll_altura)
4798 nelberth 699
		if($(window).scrollTop()>scroll_altura){
700
			$("#cuadro_noticias").addClass("fixed");
701
		}else{
702
			$("#cuadro_noticias").removeClass("fixed");
703
		}
704
	})
5129 nelberth 705
 
4798 nelberth 706
	$(document).on("dragover", "#imagen_noticia", function(e){
707
		e.preventDefault();
708
		e.stopPropagation();
709
		$(this).css({"background":"rgba(0,0,0,.2)"})
710
	})
711
	$(document).on("drop", "#imagen_noticia", function(e){
712
		e.preventDefault();
713
		e.stopPropagation();
714
		$(this).css("background", "none");
715
		var archivo = e.originalEvent.dataTransfer.files;
716
		var img=archivo[0];
5926 nelberth 717
		if(img.type =="image/jpeg"||img.type =="image/png"){
4798 nelberth 718
			$(".modificar").removeClass("animated");
719
			var render = new FileReader();
720
			render.readAsDataURL(img);
721
			render.onload = function(e){
722
				$(".volver").css("display","block")
723
				$(".a1").addClass("paso");
5740 nelberth 724
				$(".titulo_pasos").html("LABEL_STEP_2");
5929 nelberth 725
				console.log(e.target.result)
4798 nelberth 726
				editorNoticia(e.target.result)
727
			}
5926 nelberth 728
		}
4798 nelberth 729
	})
730
	$(document).on("dragover", "body", function(e){
731
		e.preventDefault();
732
		e.stopPropagation();
733
	})
734
	$(document).on("drop", "body", function(e){
735
		e.preventDefault();
736
		e.stopPropagation();
737
	})
738
 
5741 nelberth 739
	var canvas='<div class="editorNoticia"><canvas id="editorNoticia">LABEL_NOT_SUPPORTED</canvas></div>';
4798 nelberth 740
	$(document).on("mouseover", ".editorNoticia", function(){
741
		$("body").css({"overflow": "hidden"});
5707 nelberth 742
		$(".cuadro_noticias, .fixed_noticia,.tituloEditor,.grid-padre").css("margin-right", "17px")
5146 nelberth 743
		$(".barra,.footer").css("padding-right","17px")
4798 nelberth 744
 
745
 
746
	})
747
	$(document).on("mouseover", "#editorNoticia", function(){
748
		if(recorte_listo){
749
			ocho=true;
750
		}
751
	})
752
	$(document).on("mouseout", "#editorNoticia", function(){
753
		if(recorte_listo){
754
			ocho=false;
755
			actualizar2()
756
		}
757
	})
758
	$(document).on("mouseout", ".editorNoticia",function(){
759
		$("body").css({"overflow": "auto"})
5707 nelberth 760
		$(".cuadro_noticias, .fixed_noticia,.tituloEditor,.grid-padre").css("margin-right", "0px")
4798 nelberth 761
		$(".barra,.footer").css("padding-right","0px")
762
 
763
	})
764
	$(document).on('mousewheel', ".editorNoticia",function(e){
765
		var ruedita = e.originalEvent.wheelDelta
766
		if(ruedita>0){
767
			scale = scale+(scale/10);
768
			$("#porciento_scale").html((scale*100).toFixed(2)+"%")
769
		}else{
770
			scale = scale-(scale/10);
771
			$("#porciento_scale").html((scale*100).toFixed(2)+"%")
772
		}
773
		$("#editorNoticia").css({"transform": "scale("+scale+")"});
774
	})
775
	$(document).on("click", ".as", function(e){
776
		e.preventDefault();
777
		 scale = $(this).data("scale");
778
		 $("#porciento_scale").html((scale*100).toFixed(2)+"%")
779
		 $("#editorNoticia").css({"transform": "scale("+scale+")"});
780
 
781
	})
782
	$(document).on("click", ".ps", function(e){
783
		e.preventDefault();
784
		$(".cantidades_scale").slideToggle(200).css("display", "block");
785
	})
5789 nelberth 786
	$(document).on("click", "#cerrar_filter_modal, .icon_filter", function(e){
787
		e.preventDefault();
5854 nelberth 788
		if(recorte_listo){
5789 nelberth 789
		$(".contenido_filter").slideToggle(200).css("display", "block");
5854 nelberth 790
		}
5789 nelberth 791
	})
5805 nelberth 792
	$(document).on("click", "#cerrar_text_modal, .icon_text", function(e){
793
		e.preventDefault();
5854 nelberth 794
		if(recorte_listo){
5855 nelberth 795
			$(".contenido_text").slideToggle(200).css("display", "block");
5854 nelberth 796
		}
5805 nelberth 797
	})
5865 nelberth 798
 
5816 nelberth 799
	$(document).on("click", "#cerrar_cut_modal, .icon_cut", function(e){
800
		e.preventDefault();
5861 nelberth 801
		if(cortar){
5854 nelberth 802
			$(".contenido_cut").slideToggle(200).css("display", "block");
5861 nelberth 803
		}
5854 nelberth 804
 
5816 nelberth 805
	})
4798 nelberth 806
	$(document).on("click", "#menos_scale", function(e){
807
		e.preventDefault();
808
		scale = scale-(scale/10);
809
		 $("#porciento_scale").html((scale*100).toFixed(2)+"%")
810
		 $("#editorNoticia").css({"transform": "scale("+scale+")"});
811
	})
812
 
813
	$(document).on("click", "#mas_scale", function(e){
814
		e.preventDefault();
815
		scale = scale+(scale/10);
816
		 $("#porciento_scale").html((scale*100).toFixed(2)+"%")
817
		 $("#editorNoticia").css({"transform": "scale("+scale+")"});
818
	})
819
	$(document).on("click", "#noche", function(){
820
		$(".oa").removeClass("oa")
821
		filter( .5,1.3,1.31,1.33,1.38);
822
		$(this).addClass("oa")
823
	})
824
	$(document).on("click", "#sa", function(){
825
		$(".oa").removeClass("oa")
826
		filter( .7,1.1,1.64,1.66,1.50);
827
		$(this).addClass("oa")
828
	})
829
	$(document).on("click", "#crema", function(){
830
		$(".oa").removeClass("oa")
831
		filter( .75,1,1.66,1.60,1.51);
832
		$(this).addClass("oa")
833
	})
834
	$(document).on("click", "#setenta", function(){
835
		$(".oa").removeClass("oa")
836
		filter( .8,.75,1.60,1.66,1.58);
837
		$(this).addClass("oa")
838
	})
839
	$(document).on("click", "#orange", function(){
840
		$(".oa").removeClass("oa")
841
		filter( .8,1,1.6,1.45,1.49);
842
		$(this).addClass("oa")
843
	})
844
	$(document).on("click", "#relieve", function(){
845
		$(".oa").removeClass("oa")
846
		filter( .7,1.2,1.60,1.66,1.58);
847
		$(this).addClass("oa")
848
	})
849
	$(document).on("click", "#bosque", function(){
850
		$(".oa").removeClass("oa")
851
		filter( .85,.75,1.47,1.66,1.54);
852
		$(this).addClass("oa")
853
	})
854
	$(document).on("click", "#desierto", function(){
855
		$(".oa").removeClass("oa")
856
		filter( .8,.9,1.66,1.43,1.28);
857
		$(this).addClass("oa")
858
	})
859
	$(document).on("click", "#villa", function(){
860
		$(".oa").removeClass("oa")
861
		filter( .8,.8,1.71,1.64,1.58);
862
		$(this).addClass("oa")
863
	})
864
	$(document).on("click", "#magia", function(){
865
		$(".oa").removeClass("oa")
866
		filter( .7,1.2,1.49,1.49,1.6);
867
		$(this).addClass("oa")
868
	})
869
	$(document).on("click", "#luz", function(){
870
		$(".oa").removeClass("oa")
871
		filter( .9,.9,1.45,1.54,1.54);
872
		$(this).addClass("oa")
873
	})
874
	$(document).on("click", "#retoque", function(){
875
		$(".oa").removeClass("oa")
876
		filter( .9,1.3,1,1,1);
877
		$(this).addClass("oa")
878
	})
879
	$(document).on("click", "#saturacion", function(){
880
		$(".oa").removeClass("oa")
881
		filter( 1,1.5,1,1,1);
882
		$(this).addClass("oa")
883
	})
884
	$(document).on("click", "#rosa", function(){
885
		$(".oa").removeClass("oa")
886
		filter( .8,1.2,1.24,.99,1);
887
		$(this).addClass("oa")
888
	})
889
	$(document).on("click", "#historia", function(){
890
		$(".oa").removeClass("oa")
891
		filter( .9,1.1,1.33,1.19,.91);
892
		$(this).addClass("oa")
893
	})
894
	$(document).on("click", "#encantador", function(){
895
		$(".oa").removeClass("oa")
896
		filter( .9,1.2,26,-12,0,2);
897
		$(this).addClass("oa")
898
	})
899
	$(document).on("click", "#emocion", function(){
900
		$(".oa").removeClass("oa")
901
		filter( 1.1,1.4,40,12,-6,2);
902
		$(this).addClass("oa")
903
	})
904
	$(document).on("click", "#beige", function(){
905
		$(".oa").removeClass("oa")
4943 nelberth 906
		filter( .9,1.32,56,47,17,2);
4798 nelberth 907
		$(this).addClass("oa")
908
	})
909
	$(document).on("click", "#fine", function(){
910
		$(".oa").removeClass("oa")
911
		filter( .87,1.19,55,37,23,2);
912
		$(this).addClass("oa")
913
	})
914
	$(document).on("click", "#lord", function(){
915
		$(".oa").removeClass("oa")
916
		filter( 1.2,.9,67,13,-23,2);
917
		$(this).addClass("oa")
918
	})
919
	$(document).on("click", "#70", function(){
920
		$(".oa").removeClass("oa")
921
		filter( 1.2,1.2,35,7,18,2);
922
		$(this).addClass("oa")
923
	})
924
	$(document).on("click", "#arbol", function(){
925
		$(".oa").removeClass("oa")
926
		filter(.92,1.23,-11,11,11,2);
927
		$(this).addClass("oa")
928
	})
929
	$(document).on("click", "#verano", function(){
930
		$(".oa").removeClass("oa")
931
		filter( 1,1.4,-3,-1,-12,2);
932
		$(this).addClass("oa")
933
	})
934
	$(document).on("click", "#cf", function(){
935
		$(".oa").removeClass("oa")
936
		filter( .85,1.26,-15,2,-1,2);
937
		$(this).addClass("oa")
938
	})
939
	$(document).on("click", "#angeles", function(){
940
		$(".oa").removeClass("oa")
941
		filter( 1,1.4,5,12,1,2);
942
		$(this).addClass("oa")
943
	})
944
	$(document).on("click", "#caliente", function(){
945
		$(".oa").removeClass("oa")
946
		filter( .9,1.2,43,-17,-55,2);
947
		$(this).addClass("oa")
948
	})
949
	$(document).on("click", "#otono", function(){
950
		$(".oa").removeClass("oa")
951
		filter( 1,1.29,29,26,17,2);
952
		$(this).addClass("oa")
953
	})
954
	$(document).on("click", "#marzo", function(){
955
		$(".oa").removeClass("oa")
956
		filter( .85,1.3,43,25,-11,2);
957
		$(this).addClass("oa")
958
	})
959
	$(document).on("click", "#pera", function(){
960
		$(".oa").removeClass("oa")
961
		filter( .8,1.25,31,41,12,2);
962
		$(this).addClass("oa")
963
	})
964
	$(document).on("click", "#comun", function(){
965
		$(".oa").removeClass("oa")
966
		filter( 1,1.36,4,5,1,2);
967
		$(this).addClass("oa")
968
	})
969
	$(document).on("click", "#oro", function(){
970
		$(".oa").removeClass("oa")
971
		filter( .9,1.3,37,-25,1,2);
972
		$(this).addClass("oa")
973
	})
974
	$(document).on("click", "#gotico", function(){
975
		$(".oa").removeClass("oa")
976
		filter( 1.1,1.3,-47,-42,-30,2);
977
		$(this).addClass("oa")
978
	})
979
	$(document).on("click", "#forestal", function(){
980
		$(".oa").removeClass("oa")
981
		filter( 1,1.4,-5,42,11,2);
982
		$(this).addClass("oa")
983
	})
984
	$(document).on("click", "#luna", function(){
985
		$(".oa").removeClass("oa")
986
		filter( .9,1.2,-5,-7,4,2);
987
		$(this).addClass("oa")
988
	})
989
	$(document).on("click", "#fiesta", function(){
990
		$(".oa").removeClass("oa")
991
		filter( 1.1,1.3,-1,-1,26,2);
992
		$(this).addClass("oa")
993
	})
994
	$(document).on("click", "#gris", function(){
995
		$(".oa").removeClass("oa")
996
		filtergris(1,1)
997
		$(this).addClass("oa")
998
	})
999
	$(document).on("click", "#lhs", function(){
1000
		$(".oa").removeClass("oa")
1001
		filtergris(.8,1.5);
1002
		$(this).addClass("oa")
1003
	})
5786 nelberth 1004
	$(document).on("click", "#normal", function(){
4798 nelberth 1005
		$(".oa").removeClass("oa")
1006
		$(this).addClass("oa")
1007
		filter();
1008
	})
1009
	var texto_listo=false,siete=false;
1010
	var texto;
1011
	$(document).on("keyup", "#texto_input", function(e){
1012
		e.preventDefault();
1013
		texto = $(this).val();
1014
		if(texto_actualizar){
1015
			siete=true;
1016
		}
1017
		if(texto!=""){
1018
			texto_actualizar=true;
1019
			actualizar2();
1020
		}else{
1021
			actualizar2();
1022
		}
1023
 
1024
	})
1025
	var color="#ffffff";
1026
	$(document).on("change", "#color", function(){
1027
    	color=$(this).val();
1028
    	seis=true;
1029
    	actualizar2();
1030
    })
1031
    var size=48;
1032
    $(document).on("keyup change", "#font-size", function(){
1033
    	size=$(this).val();
1034
    	size = parseInt(size);
1035
    	seis=true;
1036
    	siete=true;
1037
    	actualizar2();
1038
    })
1039
    var negritas=false, bold="";
1040
    $(document).on("click", "#negritas", function(e){
1041
    	e.preventDefault();
1042
    	if(!negritas){
1043
    		bold="bold";
1044
    		$(this).addClass("fa");
1045
    		seis=true;
1046
    		siete=true;
1047
    		actualizar2();
1048
    		negritas=true;
1049
    	}else{
1050
    		bold="";
1051
    		$(this).removeClass("fa");
1052
    		seis=true;
1053
    		siete=true;
1054
    		actualizar2();
1055
    		negritas=false;
1056
    	}
1057
    })
1058
    var italic=false, ita="";
1059
     $(document).on("click", "#italic", function(e){
1060
    	e.preventDefault();
1061
    	if(!italic){
1062
    		ita="italic";
1063
    		$(this).addClass("fa");
1064
    		seis=true;
1065
    		siete=true;
1066
    		actualizar2();
1067
    		italic=true;
1068
    	}else{
1069
    		ita="";
1070
    		$(this).removeClass("fa");
1071
    		seis=true;
1072
    		siete=true;
1073
    		actualizar2();
1074
    		italic=false;
1075
    	}
1076
    })
1077
     var fontfamily="Arial";
5149 nelberth 1078
     $(document).on("click", ".fs", function(e){
4798 nelberth 1079
    	e.preventDefault();
1080
    	$(".at").removeClass("at");
1081
    	$(this).addClass("at");
1082
    	fontfamily= $(this).text();
1083
    	seis=true;
1084
    	siete=true;
1085
    	actualizar2();
1086
 
5149 nelberth 1087
    })
4798 nelberth 1088
     var shadow = true, nueve=true;
5149 nelberth 1089
     $(document).on("click","#shadow", function(e){
4798 nelberth 1090
     	e.preventDefault();
1091
     	if(shadow){
1092
     		$(this).removeClass("fa");
1093
     		seis=true;
1094
     		nueve=false;
1095
     		actualizar2();
1096
     		shadow=false;
1097
     	}else{
1098
     		$(this).addClass("fa");
1099
     		seis=true;
1100
     		nueve=true;
1101
     		actualizar2();
1102
     		shadow=true;
1103
     	}
1104
 
5149 nelberth 1105
     })
4798 nelberth 1106
     var rectangulo=false, diez=false, colorrect="#000000";
5149 nelberth 1107
     $(document).on("click", "#rectangulo", function(e){
4798 nelberth 1108
     	e.preventDefault();
1109
     	if(!rectangulo){
1110
     		$(this).addClass("fa");
1111
     		diez=true;
1112
     		actualizar2();
1113
     		rectangulo=true;
1114
     	}else{
1115
     		$(this).removeClass("fa");
1116
     		diez=false;
1117
     		actualizar2();
1118
     		rectangulo=false;
1119
     	}
1120
 
5149 nelberth 1121
     })
4798 nelberth 1122
     var r=0,g=0,b=0;
1123
    $(document).on("change", "#colorrect", function(){
1124
    	colorrect=$(this).val();
8315 nelberth 1125
    	r=parseInt(colorrect.slice(1,3),16);
1126
    	g=parseInt(colorrect.slice(3,5),16);
1127
    	b=parseInt(colorrect.slice(5,7),16);
4798 nelberth 1128
    	seis=true;
1129
    	actualizar2();
1130
    })
1131
    var a=1;
5149 nelberth 1132
 
4798 nelberth 1133
    $(document).on("keyup change", "#opacidad", function(){
1134
    	a=$(this).val();
1135
    	a=a/100;
1136
    	seis=true;
1137
    	actualizar2();
5149 nelberth 1138
    })
4798 nelberth 1139
	var imaNoti = new Image();
1140
	function filter(brillo=1, contraste=1, rojo=1, verde=1, azul=1, valor=1){
5073 nelberth 1141
		cuatro=false;
5414 nelberth 1142
		restaurar(brillo, contraste);
4798 nelberth 1143
		datos=imagenOriginal.data;
1144
		if(valor==2){
1145
			for (var i =  0; i <datos.length; i+=4) {
1146
				datos[i]=datos[i]+rojo;
1147
				datos[i+1]=datos[i+1]+verde;
1148
				datos[i+2]=datos[i+2]+azul;
1149
			}
1150
		}else{
1151
			for (var i =  0; i <datos.length; i+=4) {
1152
				datos[i]=datos[i]*rojo;
1153
				datos[i+1]=datos[i+1]*verde;
1154
				datos[i+2]=datos[i+2]*azul
1155
			}
1156
		}
1157
		editor.putImageData(imagenOriginal,0,0)
1158
		var imagenNoticia = elemento.toDataURL("image/jpeg", 1.0);
1159
	    imaNoti.src = imagenNoticia;
1160
		actualizar2();
1161
	}
1162
	function filtergris(brillo=1, contraste=1){
1163
		cuatro=false;
1164
		restaurar(brillo, contraste);
1165
		datos=imagenOriginal.data;
1166
		var auxiliar;
1167
		for (var i =  0; i <datos.length; i+=4) {
8315 nelberth 1168
			auxiliar = 0.34 * datos[i] + 0.5 *datos[i+1] + 0.16 * datos[i+2];
4798 nelberth 1169
			datos[i]=auxiliar;
1170
			datos[i+1]=auxiliar;
1171
			datos[i+2]=auxiliar;
1172
		}
5429 nelberth 1173
 
4798 nelberth 1174
		editor.putImageData(imagenOriginal,0,0)
1175
		var imagenNoticia = elemento.toDataURL("image/jpeg", 1.0);
1176
	    imaNoti.src = imagenNoticia;
1177
		actualizar2();
1178
	}
1179
	function restaurar(brillo = 1, contraste=1){
1180
		editor.filter = "none"
1181
		editor.filter = 'contrast('+contraste+') brightness('+brillo+') saturate(1) sepia(0)';
5429 nelberth 1182
		editor.fillStyle="rgba(255,255,255,1)"
1183
		editor.fillRect(0,0,ancho,alto);
5458 nelberth 1184
		editor.fillStyle=""+color+"";
5414 nelberth 1185
		var pxf=0,pyf=0;
1186
			if(xf>=(yf/recorte)){
5459 nelberth 1187
				pxf=xf/ancho;
1188
				pyf=yf/pxf;
1189
				py=(alto/2)-(pyf/2);
1190
				editor.drawImage(imagen,x,y,xf,yf,0,py,ancho,pyf);
1191
			}else{
1192
				pyf=yf/alto;
5461 nelberth 1193
				pxf=xf/pyf;
5459 nelberth 1194
				px=(ancho/2)-(pxf/2);
1195
				editor.drawImage(imagen,x,y,xf,yf,px,0,pxf,alto);
1196
			}
4798 nelberth 1197
		imagenOriginal = editor.getImageData(0,0,ancho,alto)
1198
	}
1199
	var ocho=false;
1200
	function actualizar2(){
1201
		if(recorte_listo){
1202
		if(cuatro){
1203
			imagenOriginal = editor.getImageData(0,0,ancho,alto)
1204
			var imagenNoticia = elemento.toDataURL("image/jpeg", 1.0);
1205
	    	imaNoti.src = imagenNoticia;
1206
	    	cuatro=false;
1207
		}
1208
		editor.filter = "none"
5428 nelberth 1209
		$(imaNoti).ready(function(e){
5433 nelberth 1210
			noticia.drawImage(imaNoti,0,0,320,480);
5394 nelberth 1211
			editor.drawImage(imaNoti,0,0,ancho,alto)
4798 nelberth 1212
			if(texto_actualizar){
1213
				if(texto!=""){
1214
					if(seis){
1215
						ancho_imaNoti = imaNoti.width;
5439 nelberth 1216
 
1217
						scale_noticia = -(((ancho_imaNoti-320)/ancho_imaNoti)-1);
4798 nelberth 1218
						editor.fillStyle=""+color+"";
1219
						editor.strokeStyle="rgb(255,255,255)";
1220
						if(nueve){
1221
							editor.shadowColor="rgba(0,0,0,.5)";
1222
							editor.shadowOffsetX=6;
1223
							editor.shadowOffsetY=6;
1224
							editor.shadowBlur=6;
1225
							noticia.shadowColor="rgba(0,0,0,.5)";
1226
							noticia.shadowOffsetX=6*scale_noticia;
1227
							noticia.shadowOffsetY=6*scale_noticia;
1228
							noticia.shadowBlur=6*scale_noticia;
1229
						}else{
1230
							editor.shadowColor="rgba(0,0,0,0)";
1231
							noticia.shadowColor="rgba(0,0,0,0)";
1232
						}
1233
						editor.font=""+ita+" "+bold+" "+size+"px "+fontfamily+"";
1234
						editor.textAlign="start";
1235
						editor.textBaseline="top";
1236
 
1237
						var sizeNoticia = size*scale_noticia;
1238
						noticia.fillStyle=""+color+"";
1239
						noticia.font=""+ita+" "+bold+" "+sizeNoticia+"px "+fontfamily+"";
1240
						noticia.textAlign="start";
1241
						noticia.textBaseline="top";
1242
						seis=false;
1243
					}
1244
					if(siete){
1245
						dimencionesTexto = editor.measureText(texto);
1246
						txf=dimencionesTexto.width+20;
1247
						tyf= (20+size);
1248
						siete=false;
1249
					}
5443 nelberth 1250
					if(cinco){
4798 nelberth 1251
						dimencionesTexto = editor.measureText(texto);
5441 nelberth 1252
						if(xf>=(yf/recorte)){
1253
							tx=(xf/2)-(dimencionesTexto.width/2);
1254
							ty=(xf*recorte/2)-(size/2);
1255
						}else{
1256
							tx=(yf/recorte/2)-(dimencionesTexto.width/2);
1257
							ty=(yf/2)-(size/2);
1258
						}
1259
 
4798 nelberth 1260
						txf=dimencionesTexto.width+20;
1261
						tyf= size+20;
1262
						cinco=false;
5443 nelberth 1263
					}
4798 nelberth 1264
					if(diez){
1265
						editor.fillStyle="rgba("+r+","+g+","+b+","+a+")";
1266
						noticia.fillStyle="rgba("+r+","+g+","+b+","+a+")";
1267
						editor.fillRect(tx-10,ty-10,txf,tyf);
5387 nelberth 1268
						noticia.fillRect(((tx-10)*scale_noticia),((ty-10)*scale_noticia),txf*scale_noticia,tyf*scale_noticia);
4798 nelberth 1269
						editor.fillStyle=""+color+"";
1270
						noticia.fillStyle=""+color+"";
1271
 
1272
					}
1273
					editor.fillText(texto,tx,ty);
5440 nelberth 1274
					noticia.fillText(texto,(tx*scale_noticia),ty*scale_noticia);
4798 nelberth 1275
					if(ocho){
1276
						editor.strokeRect(tx-10,ty-10,txf,tyf)
1277
						editor.arc(tx+txf,ty+tyf,10,0,Math.PI*2,false);
1278
						editor.fill();
1279
						editor.beginPath();
1280
					}
1281
					texto_listo=true;
1282
				}
1283
			}
1284
		})
1285
 
1286
	}
1287
	}
1288
	function actualizar(){
1289
			$(imagen).ready(function(e){
1290
				if(uno){
1291
					ancho=imagen.width, alto = imagen.height;
5388 nelberth 1292
					elemento.width = ancho;
1293
					elemento.height = alto;
8309 nelberth 1294
 
4798 nelberth 1295
					$(".scale").css("display","flex");
1296
					if(ancho<=alto){
1297
					 scale = -(((alto-450)/alto)-1);
8332 nelberth 1298
					 xf=ancho*0.80;
8336 nelberth 1299
					 yf=xf*recorte;
8329 nelberth 1300
 
1301
					}else{
1302
					 scale = -(((ancho-500)/ancho)-1);
8330 nelberth 1303
					 yf=alto*0.80;
8332 nelberth 1304
					 xf=yf/recorte;
4798 nelberth 1305
					}
8332 nelberth 1306
					cuadro_dimencion=Math.round(14/scale);
8328 nelberth 1307
 
8308 nelberth 1308
					if(xf<50||yf<50){
1309
						xf=50;
1310
						yf=xf*recorte;
1311
					}
8304 nelberth 1312
					console.log(xf+' '+yf)
8301 nelberth 1313
					mitadX=ancho/2;
1314
					mitadY=alto/2;
1315
					x=mitadX-xf/2;
1316
					y=mitadY-yf/2;
1317
 
4798 nelberth 1318
					$("#porciento_scale").html((scale*100).toFixed(2)+"%")
1319
					$("#ancho").html(ancho+"px");
1320
					$("#alto").html(alto+"px");
1321
					uno=false;
1322
				}
1323
				if(dos){
5402 nelberth 1324
 
1325
					if(xf>=(yf/recorte)){
5405 nelberth 1326
						alto=xf*recorte;
5404 nelberth 1327
						ancho=xf;
5402 nelberth 1328
					}else{
5435 nelberth 1329
						ancho=yf/recorte;
5404 nelberth 1330
						alto=yf;
1331
 
5402 nelberth 1332
					}
1333
					elemento.width = ancho;
1334
					elemento.height = alto;
5451 nelberth 1335
					if(xf<=yf){
5411 nelberth 1336
					 scale = -(((yf-450)/yf)-1);
5433 nelberth 1337
 
4798 nelberth 1338
					}else{
5411 nelberth 1339
					 scale = -(((xf-500)/xf)-1);
4798 nelberth 1340
					}
1341
 
1342
					$("#porciento_scale").html((scale*100).toFixed(2)+"%")
5411 nelberth 1343
					$("#ancho").html(Math.round(xf)+"px");
1344
					$("#alto").html(Math.round(yf)+"px");
4798 nelberth 1345
					dos=false;
1346
				}
5235 nelberth 1347
 
5408 nelberth 1348
					var pxf=0,pyf=0;
1349
					noticia.fillStyle="rgba(255,255,255,1)"
1350
					noticia.fillRect(0,0,320,480);
1351
				if(xf>=(yf/recorte)){
1352
					pxf=xf/320;
1353
					pyf=yf/pxf;
1354
					py=(480/2)-(pyf/2);
1355
					noticia.drawImage(imagen,x,y,xf,yf,0,py,320,pyf);
5409 nelberth 1356
				}else{
5408 nelberth 1357
					pyf=yf/480;
1358
					pxf=xf/pyf;
1359
					px=(320/2)-(pxf/2);
1360
					noticia.drawImage(imagen,x,y,xf,yf,px,0,pxf,480);
5409 nelberth 1361
				}
5407 nelberth 1362
 
4840 nelberth 1363
				$("#editorNoticia").css({"transform": "scale("+scale+")"});
4798 nelberth 1364
				if(!recorte_listo){
1365
					editor.drawImage(imagen,0,0,ancho,alto);
8320 nelberth 1366
					editor.fillStyle="rgba(0,0,0,.2)"
4798 nelberth 1367
					editor.fillRect(0,0,ancho,alto);
8320 nelberth 1368
					editor.fillStyle="rgba(255,255,255,.2)"
4798 nelberth 1369
					editor.fillRect(x,y,xf,yf);
8324 nelberth 1370
					editor.fillStyle="rgba(255,255,255,0.8)"
8315 nelberth 1371
					editor.fillRect(x,y,cuadro_dimencion,cuadro_dimencion);
1372
					editor.fillRect((x+xf)-cuadro_dimencion,y,cuadro_dimencion,cuadro_dimencion);
1373
					editor.fillRect(x,y+yf-cuadro_dimencion,cuadro_dimencion,cuadro_dimencion);
1374
					editor.fillRect(x+xf-cuadro_dimencion,yf+y-cuadro_dimencion,cuadro_dimencion,cuadro_dimencion);
4798 nelberth 1375
					esta=true;
1376
				}else{
5406 nelberth 1377
					var pxf=0,pyf=0;
5427 nelberth 1378
 
5428 nelberth 1379
					editor.fillStyle="rgba(255,255,255,1)"
1380
					editor.fillRect(0,0,ancho,alto);
5406 nelberth 1381
					if(xf>=(yf/recorte)){
1382
						pxf=xf/ancho;
1383
						pyf=yf/pxf;
1384
						py=(alto/2)-(pyf/2);
1385
						editor.drawImage(imagen,x,y,xf,yf,0,py,ancho,pyf);
1386
					}else{
1387
						pyf=yf/alto;
1388
						pxf=xf/pyf;
1389
						px=(ancho/2)-(pxf/2);
1390
						editor.drawImage(imagen,x,y,xf,yf,px,0,pxf,alto);
4798 nelberth 1391
				}
5406 nelberth 1392
 
1393
				}
4798 nelberth 1394
			})
1395
		}
1396
	var imagenOriginal;
8309 nelberth 1397
	var x,y,xf=320,yf =480,mxf=(xf/2), myf=(yf/2), elemento,editor,centro, total,scale,dimencionesTexto,ancho_imaNoti,
4798 nelberth 1398
	recorte_listo=false,alto,ancho,tx,ty,txf,tyf,cuatro=true,texto_actualizar=false,cinco=true,seis=true,cuatro;
5865 nelberth 1399
	var  mitadY,mitadX, uno=true,dos=false, recorte=480/320, imagen_noticias, scale_noticia, tres=true,rotar=false, cortar=false;;
8317 nelberth 1400
	var translateX, cuadro_dimencion;
4798 nelberth 1401
 
5822 nelberth 1402
	$(document).on("click", ".recortar10", function(e){
5540 nelberth 1403
 
4798 nelberth 1404
		e.preventDefault();
1405
		recorte_listo=false;
1406
		uno=true;
1407
		$(".fondo_oscuro").css("display","block");
1408
		$("#boton_recortar").addClass("recortar").text("Recortar").removeClass("info_noticia");
1409
		$("#boton_recortar3").addClass("recortar").text("Recortar").removeClass("info_noticia3");
5855 nelberth 1410
		$(".contenido_text").css("display", "none");
1411
		$(".contenido_filter").css("display", "none");
5822 nelberth 1412
		$(".recortar10").addClass("recortar");
4798 nelberth 1413
		$(".canvas").addClass("recortar")
1414
		$(".oa").removeClass("oa");
1415
		$("#normal").addClass("oa");
1416
		$(".b1").removeClass("paso");
5741 nelberth 1417
		$(".titulo_pasos").html("LABEL_STEP_2");
4798 nelberth 1418
		window.clearInterval(actualizar2);
1419
		actualizar();
1420
 
1421
	})
5789 nelberth 1422
 
1423
 
5490 nelberth 1424
	blockCelda=true;
5488 nelberth 1425
	$(document).on("click", "#blockCelda", function(e){
1426
		e.preventDefault();
5490 nelberth 1427
		if(blockCelda){
1428
			$(this).html('<span class="fa fa-unlock"></span>')
5495 nelberth 1429
 
5490 nelberth 1430
			blockCelda=false;
1431
		}else{
1432
			$(this).html('<span class="fa fa-lock"></span>')
1433
			blockCelda=true;
1434
		}
5495 nelberth 1435
		t4=true;
5488 nelberth 1436
 
1437
	})
4798 nelberth 1438
	var imagen
1439
	function editorNoticia(img){
5865 nelberth 1440
		 cortar=true;
4798 nelberth 1441
		imagen= new Image();
1442
		$(".canvas").html(canvas);
1443
		elemento = document.getElementById("editorNoticia");
1444
		editor = elemento.getContext("2d");
1445
		elemento2 = document.getElementById("imagen_noticias");
1446
		noticia = elemento2.getContext("2d");
1447
 
1448
		$(document).on("click", ".boton_marino.recortar",function(e){
1449
			e.preventDefault();
1450
			recorte_listo=true;
1451
			$(".fondo_oscuro").css("display","none");
5741 nelberth 1452
			$("#boton_recortar").removeClass("recortar").text("LABEL_SEND").addClass("info_noticia").attr('type','submit');
5822 nelberth 1453
			$(".recortar10").removeClass("recortar");
4798 nelberth 1454
			$(".canvas").removeClass("recortar");
1455
			$(".b1").addClass("paso");
5741 nelberth 1456
			$(".titulo_pasos").html("LABEL_STEP_3");
4798 nelberth 1457
			if(texto!=""){
1458
				seis=true;
1459
				siete=true;
1460
			}
1461
			cinco=true;
1462
			dos=true;
1463
			cuatro=true;
1464
			actualizar();
1465
		})
1466
 
1467
		var cli = false, t1= false, t2=false,t3=false,t4=false,tcli=false;
1468
		var mouse =[];
1469
 
1470
 
1471
		function raton(elemento, e){
1472
			return {
1473
				x:((e.pageX - elemento.offsetLeft - ((ancho/2)-((ancho*scale)/2)))/scale),
1474
				y:((e.pageY - elemento.offsetTop - ((alto/2)-((alto*scale)/2)))/scale)
1475
			}
1476
		}
1477
 
1478
		imagen.src=img;
5822 nelberth 1479
		$(".recortar10").addClass("recortar");
5741 nelberth 1480
		$("#boton_recortar").removeClass("boton_normal").addClass("recortar boton_marino").text("LABEL_CUT")
4798 nelberth 1481
		actualizar();
1482
 
1483
		$(elemento).mousemove(function(e){
1484
			mouse = raton(this, e);
5540 nelberth 1485
			//console.log("raton x: "+mouse.x+ " raton Y: " +mouse.y+ " tx: "+tx+" ty: "+ty+" txf:"+(txf+tx)+" tyf:"+(tyf+ty) )
4798 nelberth 1486
			if(!recorte_listo){
8335 nelberth 1487
				if(x<mouse.x &&(xf+x)>mouse.x && y<mouse.y && (y+yf)>mouse.y){
1488
					if((xf+x-cuadro_dimencion)<mouse.x &&(xf+x)>mouse.x && (y+yf-cuadro_dimencion)<mouse.y && (y+yf)>mouse.y){
1489
			 			$(elemento).css("cursor","nw-resize");
1490
			 		}else if((xf+x-cuadro_dimencion)<mouse.x &&(xf+x)>mouse.x && y<mouse.y && (y+cuadro_dimencion)>mouse.y){
1491
			 			$(elemento).css("cursor","ne-resize");
1492
			 		}else if(x<mouse.x &&(cuadro_dimencion+x)>mouse.x && y<mouse.y && (y+cuadro_dimencion)>mouse.y){
1493
			 			$(elemento).css("cursor","se-resize");
1494
			 		}else if(x<mouse.x &&(cuadro_dimencion+x)>mouse.x && (y+yf-cuadro_dimencion)<mouse.y &&(y+yf)>mouse.y){
1495
			 			$(elemento).css("cursor","sw-resize");
1496
			 		}else{
1497
						$(elemento).css("cursor","move");
1498
					}
4798 nelberth 1499
			 	}else{
1500
			 		$(elemento).css("cursor","default");
1501
			 	}
1502
			}else if(texto_listo){
1503
				if(tx-10<mouse.x && tx-10+txf>mouse.x && ty-10<mouse.y && ty-10+tyf>mouse.y){
1504
			 		$(elemento).css("cursor","move");
1505
			 	}else if((txf+tx-10)<mouse.x &&(txf+tx-10+20)>mouse.x && (ty-10+tyf)<mouse.y && (ty-10+tyf+20)>mouse.y){
1506
			 		$(elemento).css("cursor","pointer");
1507
			 	}else{
1508
			 		$(elemento).css("cursor","default");
1509
			 	}
1510
			}
1511
			else{
1512
				$(elemento).css("cursor","default");
1513
			}
1514
		})
1515
		$(elemento).mousedown(function(e){
1516
			mouse = raton(this, e);
1517
			if(!recorte_listo){
8334 nelberth 1518
				if(x<mouse.x &&(xf+x)>mouse.x && y<mouse.y && (y+yf)>mouse.y){
8333 nelberth 1519
 
1520
					if((xf+x-cuadro_dimencion)<mouse.x &&(xf+x)>mouse.x && (y+yf-cuadro_dimencion)<mouse.y && (y+yf)>mouse.y){
1521
						t4 = true;
1522
					}else if((xf+x-cuadro_dimencion)<mouse.x &&(xf+x)>mouse.x && y<mouse.y && (y+cuadro_dimencion)>mouse.y){
1523
						t3 = true;
1524
					}else if(x<mouse.x &&(cuadro_dimencion+x)>mouse.x && y<mouse.y && (y+cuadro_dimencion)>mouse.y){
1525
						t1 = true;
1526
					}else if(x<mouse.x &&(cuadro_dimencion+x)>mouse.x && (y+yf-cuadro_dimencion)<mouse.y &&(y+yf)>mouse.y){
1527
						t2 = true;
1528
					}else{
1529
						cli = true;
1530
					}
4798 nelberth 1531
			 	}
8333 nelberth 1532
 
4798 nelberth 1533
			}else if(texto_listo){
1534
				if(tx-10<mouse.x && tx-10+txf>mouse.x && ty-10<mouse.y && ty-10+tyf>mouse.y){
1535
			 		tcli=true;
1536
			 	}else if((txf+tx-10)<mouse.x &&(txf+tx-10+20)>mouse.x && (ty-10+tyf)<mouse.y && (ty-10+tyf+20)>mouse.y){
1537
			 		rotar=true;
1538
			 	}
1539
			}
1540
 
1541
		 })
1542
 
1543
		 $(elemento).mousemove(function(e){
1544
		 	mouse = raton(this, e);
1545
		 	if(!recorte_listo){
1546
			 	if(cli){
1547
			 		if((mouse.y-(yf/2))>=0&&(mouse.y+(yf/2))<=alto){
1548
				 		y = (mouse.y-(yf/2));
1549
			 		}else{
1550
			 			if((mouse.y-(yf/2))<0){
1551
			 				y=0;
1552
			 			}
1553
			 			if((mouse.y+(yf/2))>alto){
1554
			 				y=alto-yf;
1555
			 			}
1556
			 		}
1557
			 		if((mouse.x-(xf/2))>=0&&(mouse.x+(xf/2))<=ancho){
1558
			 			x = (mouse.x-(xf/2));
1559
			 		}else{
1560
			 			if((mouse.x-(xf/2))<0){
1561
			 				x=0;
1562
			 			}
1563
			 			if((mouse.x+(xf/2))>ancho){
1564
			 				x=(ancho)-xf;
1565
			 			}
1566
			 		}
1567
			 	}
5492 nelberth 1568
				if(blockCelda){
1569
			 	if(t4){
4798 nelberth 1570
			 		if(mouse.y<(alto-10)&&(x+xf)<=(ancho)){
4976 nelberth 1571
				 		if(Math.round(xf)>=50){
4984 nelberth 1572
							if(((mouse.y-y)/recorte)>50){
4981 nelberth 1573
				 				yf=mouse.y-y;
1574
				 				xf=(yf/recorte);
1575
				 			}
1576
						}
4798 nelberth 1577
			 		}else{
1578
			 			if(mouse.y>=(alto-10)){
1579
			 				yf=alto-y;
1580
				 			xf=(yf/recorte);
1581
				 			t4=false;
1582
			 			}
1583
			 			if(x+xf>(ancho)){
1584
			 				xf=(ancho)-x;
1585
				 			yf=(xf*recorte);
1586
				 			t4=false;
1587
			 			}
1588
			 		}
1589
			 	}
1590
			 	if(t3){
1591
			 		if(mouse.y>0&&(x+xf)<=(ancho)){
4976 nelberth 1592
				 		if(Math.round(xf)>=50){
4981 nelberth 1593
							if(((yf+(y-mouse.y))/recorte)>50){
1594
					 			yf=yf+(y-mouse.y);
1595
					 			xf=(yf/recorte);
1596
					 			y=mouse.y;
1597
				 			}
4798 nelberth 1598
				 		}
1599
 
1600
			 		}else{
1601
			 			if(mouse.y<=0) {
1602
			 				yf=yf+(y-mouse.y);
1603
				 			xf=(yf/recorte);
1604
			 				y=0;
1605
			 				t3=false;
1606
			 			}
1607
			 			if(x+xf>(ancho)){
1608
			 				xf=(ancho)-x;
1609
				 			yf=xf*recorte;
1610
				 			t3=false;
1611
			 			}
1612
			 		}
1613
			 	}
1614
			 	if(t2){
1615
			 		if(mouse.y<(alto-10)&&x>=0){
4976 nelberth 1616
				 		if(Math.round(xf)>=50){
4984 nelberth 1617
							if(((mouse.y-y)/recorte)>50){
4978 nelberth 1618
					 			x=(x+(yf-(mouse.y-y))/recorte);
1619
					 			yf=mouse.y-y;
1620
					 			xf=(yf/recorte);
1621
				 			}
4980 nelberth 1622
					 	}
4798 nelberth 1623
 
1624
			 		}else{
5215 nelberth 1625
			 			if(mouse.y>=(alto-10)) {
1626
			 				yf=alto-y;
1627
				 			xf=(yf/recorte);
1628
				 			t2=false;
1629
			 			}
1630
			 			if(0>x){
1631
			 				x=0;
1632
			 				xf=mouse.y-y;
1633
				 			yf=(xf*recorte);
1634
				 			t2=false;
1635
			 			}
1636
			 		}
1637
			 	}
1638
			 	if(t1){
1639
			 		if(mouse.y>0&&x>=0){
1640
				 		if(Math.round(xf)>=50){
1641
							if(((yf+(y-mouse.y))/recorte)>50){
1642
								yf=yf+(y-mouse.y);
1643
					 			xf=(yf/recorte);
1644
					 			x=(x-(y-mouse.y)/recorte);
1645
					 			y=mouse.y;
1646
							}
1647
				 		}
1648
			 		}else{
1649
			 			if(mouse.y<=0) {
1650
			 				yf=yf+(y-mouse.y);
1651
				 			xf=(yf/recorte);
1652
			 				y=0;
1653
			 				t1=false;
1654
			 			}
1655
			 			if(0>x){
1656
			 				x=0;
1657
			 				xf=yf+(y-mouse.y);
1658
				 			yf=(xf*recorte);
1659
				 			t1=false;
1660
			 			}
1661
			 		}
5492 nelberth 1662
			 	}
1663
				}else{
5215 nelberth 1664
				 if(t4){
5286 nelberth 1665
			 		if(mouse.y<(alto-10-(2/scale))&&mouse.x<=(ancho-(2/scale))){
5290 nelberth 1666
 
5217 nelberth 1667
							if((mouse.y-y)>50){
5215 nelberth 1668
				 				yf=mouse.y-y;
1669
				 			}
5217 nelberth 1670
							if((mouse.x-x)>50){
1671
								xf=mouse.x-x;
1672
							}
5290 nelberth 1673
 
5215 nelberth 1674
			 		}else{
5286 nelberth 1675
			 			if(mouse.y>=(alto-10-(2/scale))){
5215 nelberth 1676
			 				yf=alto-y;
1677
			 			}
5286 nelberth 1678
			 			if(mouse.x>(ancho-(2/scale))){
5215 nelberth 1679
			 				xf=(ancho)-x;
1680
			 			}
5286 nelberth 1681
						 t4=false;
5215 nelberth 1682
			 		}
1683
			 	}
1684
			 	if(t3){
5285 nelberth 1685
			 		if(mouse.y>(2/scale)&&mouse.x<=(ancho-(2/scale))){
5293 nelberth 1686
 
5263 nelberth 1687
							if((yf-(mouse.y-y))>50){
1688
				 				yf=yf-(mouse.y-y);
5256 nelberth 1689
								y=mouse.y;
5248 nelberth 1690
				 			}
1691
							if((mouse.x-x)>50){
1692
								xf=mouse.x-x;
1693
							}
5293 nelberth 1694
 
5215 nelberth 1695
 
1696
			 		}else{
5283 nelberth 1697
						if(mouse.x>(ancho-(2/scale))){
5282 nelberth 1698
							xf=ancho-x;
1699
						}
5286 nelberth 1700
						if(mouse.y<=(2/scale)){
5338 nelberth 1701
							yf=yf-(mouse.y-y);
5285 nelberth 1702
							y=0;
1703
						}
5286 nelberth 1704
			 			t3=false;
5215 nelberth 1705
			 		}
1706
			 	}
5332 nelberth 1707
				/* Izquierda abajo */
5215 nelberth 1708
			 	if(t2){
5332 nelberth 1709
			 		if(mouse.y<(alto-10-(2/scale))&&mouse.x>=(2/scale)){
5293 nelberth 1710
							 if((mouse.y-y)>50){
1711
								yf=mouse.y-y;
5215 nelberth 1712
				 			}
5311 nelberth 1713
							if((xf-(mouse.x-x))>50){
5308 nelberth 1714
								xf=xf-(mouse.x-x);
5299 nelberth 1715
								x=mouse.x
5296 nelberth 1716
							}
5336 nelberth 1717
 
5215 nelberth 1718
			 		}else{
5333 nelberth 1719
			 			if(mouse.y>=(alto-10-(2/scale))) {
5335 nelberth 1720
							yf=alto-y;
4798 nelberth 1721
			 			}
5338 nelberth 1722
 
5333 nelberth 1723
			 			if(mouse.x<(2/scale)){
1724
							xf=xf-(mouse.x-x);
4798 nelberth 1725
			 				x=0;
1726
			 			}
5338 nelberth 1727
						 t2=false;
4798 nelberth 1728
			 		}
1729
			 	}
5332 nelberth 1730
				/* izquierda arriba */
4798 nelberth 1731
			 	if(t1){
5336 nelberth 1732
			 		if(mouse.y>(2/scale)&&mouse.x>=(2/scale)){
1733
 
1734
							if((yf-(mouse.y-y))>50){
1735
				 				yf=yf-(mouse.y-y);
1736
								y=mouse.y;
1737
				 			}
1738
							if((xf-(mouse.x-x))>50){
1739
								xf=xf-(mouse.x-x);
1740
								x=mouse.x
4966 nelberth 1741
							}
5332 nelberth 1742
 
4798 nelberth 1743
			 		}else{
5337 nelberth 1744
						if(mouse.y<=(2/scale)){
1745
							yf=yf-(mouse.y-y);
1746
							y=0;
1747
						}
1748
						 if(mouse.x<(2/scale)){
1749
							xf=xf-(mouse.x-x);
4898 nelberth 1750
			 				x=0;
5337 nelberth 1751
 
4798 nelberth 1752
			 			}
5337 nelberth 1753
						 t1=false;
4798 nelberth 1754
			 		}
1755
			 	}
5492 nelberth 1756
			}
4798 nelberth 1757
 
1758
		 	actualizar();
1759
		 	}else if(texto_listo){
1760
		 		if(tcli){
1761
		 			tx=mouse.x-(txf/2)
1762
		 			ty=mouse.y-(tyf/2)
1763
		 		}else if(rotar){
1764
 
1765
		 		}
1766
 
1767
		 		actualizar2();
1768
		 	}
1769
		 })
1770
		 $(elemento).mouseup(function(e){
1771
		 	if(!recorte_listo){
1772
			 	cli=false;
1773
			 	t1=false;
1774
			 	t2=false;
1775
			 	t3=false;
1776
			 	t4=false;
1777
		 	}else if (texto_listo) {
1778
		 		tcli=false;
1779
		 	}
1780
		 })
1781
 
5129 nelberth 1782
 
4798 nelberth 1783
	}
5500 nelberth 1784
	/* Titulo */
5501 nelberth 1785
 
6073 nelberth 1786
var titulo_noticia, censor_titulo = true, numero_titulo=0;
5500 nelberth 1787
	$(document).on("keyup change", "#name", function(e){
5501 nelberth 1788
	console.log(numero_titulo)
5500 nelberth 1789
	titulo_noticia = $(this).val();
1790
	titulo_elemento= $(".titulo_topico");
1791
	if(titulo_noticia!=""){
5505 nelberth 1792
		if(censor_titulo){
5500 nelberth 1793
			titulo_elemento.html(titulo_noticia);
1794
			if(titulo_elemento.height()>38){
5508 nelberth 1795
				var titulo_noticia2 = "";
5500 nelberth 1796
				for(var i =0; i <titulo_noticia.length;i++){
1797
					titulo_noticia2 = titulo_noticia2 + titulo_noticia.split("")[i];
1798
					titulo_elemento.html(titulo_noticia2);
1799
					if(titulo_elemento.height()>38){
1800
						titulo_noticia2 = titulo_noticia2.slice(0,-5) + "...";
1801
						titulo_elemento.html(titulo_noticia2);
1802
						numero_titulo = titulo_noticia2.length;
1803
						censor_titulo=false;
1804
						break;
1805
					}
4798 nelberth 1806
 
5500 nelberth 1807
				}
1808
			}else{
1809
				numero_titulo=0;
1810
			}
1811
		}else{
1812
			if(numero_titulo+1>=titulo_noticia.length){
1813
				titulo_elemento.html(titulo_noticia);
1814
				censor_titulo=true;
1815
			}
5505 nelberth 1816
		}
5500 nelberth 1817
	}else{
5741 nelberth 1818
		titulo_elemento.html("LABEL_TITLE_TOPIC");
5500 nelberth 1819
		censor_titulo = true;
1820
	}
1821
})
1 www 1822
    });
1823
JS;
1824
$this->inlineScript()->captureEnd();
1825
?>
1826
 
1827
 
1828
 
1829
<!-- Content Header (Page header) -->
1830
<section class="content-header">
1831
	<div class="container-fluid">
1832
    	<div class="row mb-2">
1833
        	<div class="col-sm-12">
1834
            	<h1>LABEL_TOPICS</h1>
1835
			</div>
1836
		</div>
1837
	</div><!-- /.container-fluid -->
1838
</section>
1839
 
4693 nelberth 1840
<section class="content" id='content1'>
1 www 1841
	<div class="container-fluid">
1842
    	<div class="row">
1843
        	<div class="col-12">
1844
				<div class="card">
1845
					<div class="card-body">
20 steven 1846
        	    		<table id="gridTable" class="table   table-hover">
1 www 1847
                      		<thead>
1848
        						<tr>
1849
                                	<th>LABEL_NAME</th>
1850
                                  	<th>LABEL_STATUS</th>
1851
                                  	<th>LABEL_DETAILS</th>
1852
                                  	<th>LABEL_ACTIONS</th>
1853
                                </tr>
1854
                       		</thead>
1855
                         	<tbody>
1856
                         	</tbody>
1857
                    	</table>
1858
                   	</div>
1859
                   	<div class="card-footer clearfix">
1860
                   		<div style="float:right;">
1861
							<button type="button" class="btn btn-info btn-refresh"><i class="fa fa-refresh"></i> LABEL_REFRESH  </button>
1862
							<?php if($allowAdd) : ?>
1863
							<button type="button" class="btn btn-primary btn-add"><i class="fa fa-plus"></i> LABEL_ADD </button>
1864
							<?php endif; ?>
1865
						</div>
1866
                 	</div>
1867
          		</div>
1868
           	</div>
1869
        </div>
1870
 	</div>
1871
</section>
5467 nelberth 1872
<section id="addImage" style='display:none' class="">
5463 nelberth 1873
<div class="d-flex justify-content-center tituloEditor">
5701 nelberth 1874
        <h4>LABEL_ADD_TOPIC</h4>
5463 nelberth 1875
 
1876
    </div>
5687 nelberth 1877
	<div class="grid-padre" >
5487 nelberth 1878
				<?php
5462 nelberth 1879
       			 $form = $this->formAdd;
1880
            		$form->setAttributes([
1881
                        'method'  => 'post',
1882
            		    'action'  => $routeAdd,
1883
                        'name'    => 'form-topic-add',
1884
                        'id'      => 'form-topic-add',
1885
                    ]);
1886
 
1887
                    $form->prepare();
1888
                    echo $this->form()->openTag($form);
1889
                    ?>
5684 nelberth 1890
    			<div class="form-group grid-1-2">
5462 nelberth 1891
    				<?php
1892
                        $element = $form->get('name');
1893
 
1894
                        $element->setAttributes(['class' => 'form-control']);
1895
                        $element->setOptions(['label' => 'LABEL_NAME']);
1896
                        echo $this->formLabel($element);
1897
                        echo $this->formText($element);
1898
                    ?>
1899
				</div>
5487 nelberth 1900
 
5684 nelberth 1901
                <div class="form-group grid-1-2">
5462 nelberth 1902
                	<?php
1903
                    $element = $form->get('description');
1904
                    $element->setAttributes(['id' => 'description_add', 'class' => 'form-control', 'rows' => '2','class' => 'form-control']);
1905
                    $element->setOptions(['label' => 'LABEL_DESCRIPTION']);
1906
                    echo $this->formLabel($element);
1907
                    echo $this->formTextArea($element);
1908
                    ?>
1909
   				</div>
5684 nelberth 1910
				<div class="form-group grid-1-2">
5462 nelberth 1911
    				<?php
1912
                        $element = $form->get('order');
1913
                        $element->setAttributes(['class' => 'form-control']);
1914
                        $element->setOptions(['label' => 'LABEL_ORDER']);
1915
                        echo $this->formLabel($element);
1916
                        echo $this->formText($element);
1917
                    ?>
1918
				</div>
5678 nelberth 1919
 
5462 nelberth 1920
               		<?php
5531 nelberth 1921
                    $element = $form->get('file');
5991 nelberth 1922
					$element->setAttributes([ 'class' => 'file']);
5653 nelberth 1923
                    echo $this->formHidden($element); ?>
5678 nelberth 1924
 
5684 nelberth 1925
          		<div class="form-group grid-1-2">
5462 nelberth 1926
    				<?php
1927
                        $element = $form->get('status');
1928
                        $element->setAttributes(['class' => 'form-control']);
1929
                        $element->setOptions(['label' => 'LABEL_STATUS']);
1930
                        echo $this->formLabel($element);
1931
                        echo $this->formSelect($element);
1932
                    ?>
1933
				</div>
1934
 
5747 nelberth 1935
				<div class="contenido form-group" id="contenido">
5812 nelberth 1936
 
5747 nelberth 1937
 
1938
				</div>
5916 nelberth 1939
 
5549 nelberth 1940
 
5462 nelberth 1941
     	      		<?php echo $this->form()->closeTag($form); ?>
1942
      		</div>
1943
 
5463 nelberth 1944
 
4691 nelberth 1945
</section>
1 www 1946
 
5895 nelberth 1947
<section id="topicEdit" style='display:none' class="">
1948
<div class="d-flex justify-content-center tituloEditor">
5912 nelberth 1949
        <h4>LABEL_EDIT_TOPIC</h4>
1 www 1950
 
5895 nelberth 1951
    </div>
1952
	<div class="grid-padre" >
5899 nelberth 1953
					<?php
1954
       			  $form = $this->formEdit;
1 www 1955
            		$form->setAttributes([
5899 nelberth 1956
                        'method'    => 'post',
1957
                        'name'      => 'form-topic-edit',
1958
                        'id'        => 'form-topic-edit'
1 www 1959
                    ]);
1960
 
1961
                    $form->prepare();
1962
                    echo $this->form()->openTag($form);
1963
                    ?>
5895 nelberth 1964
    			<div class="form-group grid-1-2">
1 www 1965
    				<?php
1966
                        $element = $form->get('name');
1967
 
1968
                        $element->setAttributes(['class' => 'form-control']);
1969
                        $element->setOptions(['label' => 'LABEL_NAME']);
1970
                        echo $this->formLabel($element);
1971
                        echo $this->formText($element);
1972
                    ?>
1973
				</div>
5904 nelberth 1974
				<div class="form-group grid-1-2">
1 www 1975
                	<?php
1976
                    $element = $form->get('description');
5904 nelberth 1977
                    $element->setAttributes(['id' => 'description_edit', 'rows' => '2', 'class' => 'form-control',   'class' => 'form-control']);
1 www 1978
                    $element->setOptions(['label' => 'LABEL_DESCRIPTION']);
1979
                    echo $this->formLabel($element);
1980
                    echo $this->formTextArea($element);
1981
                    ?>
1982
   				</div>
5895 nelberth 1983
				<div class="form-group grid-1-2">
1 www 1984
    				<?php
1985
                        $element = $form->get('order');
1986
                        $element->setAttributes(['class' => 'form-control']);
1987
                        $element->setOptions(['label' => 'LABEL_ORDER']);
1988
                        echo $this->formLabel($element);
1989
                        echo $this->formText($element);
1990
                    ?>
1991
				</div>
5895 nelberth 1992
 
1 www 1993
               		<?php
1994
                    $element = $form->get('file');
5990 nelberth 1995
					$element->setAttributes([ 'class' => 'file']);
1996
                    echo $this->formHidden($element);
1997
					?>
5895 nelberth 1998
 
1999
          		<div class="form-group grid-1-2">
1 www 2000
    				<?php
2001
                        $element = $form->get('status');
2002
                        $element->setAttributes(['class' => 'form-control']);
2003
                        $element->setOptions(['label' => 'LABEL_STATUS']);
2004
                        echo $this->formLabel($element);
2005
                        echo $this->formSelect($element);
2006
                    ?>
2007
				</div>
2008
 
5908 nelberth 2009
				<div class="contenido form-group" id="contenido2">
5895 nelberth 2010
				</div>
5981 nelberth 2011
 
1 www 2012
     	      		<?php echo $this->form()->closeTag($form); ?>
2013
      		</div>
2014
 
5895 nelberth 2015
 
2016
</section>
1 www 2017
 
2018
 
2019
 
2020
<!-- The Modal -->
2021
<div class="modal" id="modalImageApp">
2022
	<div class="modal-dialog ">
2023
    	<div class="modal-content">
2024
 
2025
            <!-- Modal Header -->
2026
      		<div class="modal-header">
2027
        		<h4 class="modal-title">LABEL_IMAGE</h4>
2028
        		<button type="button" class="close" data-dismiss="modal">&times;</button>
2029
      		</div>
2030
 
2031
            <!-- Modal body -->
2032
            <div class="modal-body text-center">
2033
				<img src="" class="img img-responsive" style="width: 300px; height: auto" id="image-app" />
2034
      		</div>
2035
 
2036
            <!-- Modal footer -->
2037
      		<div class="modal-footer">
2038
        		<button type="button" class="btn btn-danger" data-dismiss="modal">Cerrar</button>
2039
          	</div>
2040
         </div>
2041
	</div>
2042
</div>
2043
 
2044
 
2045
 
2046
 
2047
 
2048
 
2049
 
2050
 
2051
 
2052