Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 10863 | Rev 10866 | 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
 
8591 nelberth 467
 
1 www 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];
10815 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-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" style="display:none"><input type="color" name="" id="colorrect" value="#000000" class="w-25" data-tooltip="Color del fondo" class="mr-2"/><input type="range" id="opacidad" max="100" min="1" step="1" value="100" class="w-75"></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" id="imagen_noticia">LABEL_DRAG_IMAGE_HERE</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"> <div> <div class="titulo_recortar"><span class="icon-ungroup fa fa-scissors"></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" style="display:none"> <input type="color" name="" id="colorrect" value="#000000" class="w-25" data-tooltip="Color del fondo" class="mr-2"/><input type="range" id="opacidad" max="100" min="1" step="1" value="100" class="w-75"></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"><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></div>'
5207 nelberth 559
		$(document).on("click", ".info_noticia", function(e){
5709 nelberth 560
			imagenServidorNoticia = elemento.toDataURL("image/jpeg", 1.0);
561
			console.log(imagenServidorNoticia.split(','))
5989 nelberth 562
			$('.file').val(imagenServidorNoticia.split(',')[1]);
563
			console.log($('.file').val())
5709 nelberth 564
			$(".c1").addClass("paso");
5703 nelberth 565
 
5513 nelberth 566
 
5709 nelberth 567
		})
6045 nelberth 568
		var edit;
6015 nelberth 569
		function iniciarEditor(add=true, image=''){
5864 nelberth 570
		 cortar=false;
4803 nelberth 571
		recorte_listo=false;
572
		texto="";
573
		seis=true;
574
		color="#ffffff";
575
		texto_listo=false,siete=false;
576
		uno=true;
577
		size=48;
10804 nelberth 578
		blockCelda=false;
4803 nelberth 579
		cinco=true;
4944 nelberth 580
		xf=320,yf =480;
4803 nelberth 581
		negritas=false, bold="";
582
		shadow = true, nueve=true;
583
		italic=false, ita="";
584
		rectangulo=false, diez=false;
585
     	fontfamily="Arial";
586
     	r=0,g=0,b=0,a=1;
6049 nelberth 587
		 edit=add;
4806 nelberth 588
		window.clearInterval(editorNoticia);
5202 nelberth 589
		setTimeout(function(){
590
			scroll_altura=$(".articulo_noticia").offset().top-110;
4821 nelberth 591
			anchoFondoOscuro = $(".articulo_noticia").width();
4823 nelberth 592
			altoFondoOscuro = $(".editor_imagenes").height();
4821 nelberth 593
			$(".fondo_oscuro").css("width",""+anchoFondoOscuro+"px");
4825 nelberth 594
			$(".fondo_oscuro").css("height",""+altoFondoOscuro+"px");
5202 nelberth 595
 
6022 nelberth 596
		},navegacion(nuevoHtmlImagen,edit,image));
5202 nelberth 597
 
4829 nelberth 598
		}
4798 nelberth 599
 
4801 nelberth 600
		$(document).on("click", ".volver", function(){
601
		var nombre_user = $(".perfil_u_nombre").text();
602
		var primer_nombre = nombre_user.split(" ")[0];
5864 nelberth 603
		 cortar=false;
4801 nelberth 604
		cinco=true;
605
		recorte_listo=false;
606
		texto="";
607
		seis=true;
608
		color="#ffffff";
609
		texto_listo=false,siete=false;
610
		uno=true;
10803 nelberth 611
		blockCelda=false;
4801 nelberth 612
		size=48;
8591 nelberth 613
 
8593 nelberth 614
 
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){
8594 nelberth 638
				edit=true;
10862 nelberth 639
				//$('#contenido2').html('')
640
				//$('#contenido').html(nuevoHtmlImagen)
6001 nelberth 641
 
5908 nelberth 642
			}else{
6017 nelberth 643
				if(reload){
644
					$('#contenido').html('')
645
					const getBase64FromUrl = async (url) => {
646
						const data = await fetch(url);
647
						const blob = await data.blob();
648
						return new Promise((resolve) => {
649
							const reader = new FileReader();
650
							reader.readAsDataURL(blob);
651
							reader.onloadend = function() {
652
							const base64data = reader.result;
653
							resolve(base64data);
654
							}
655
						});
656
					}
657
 
658
					getBase64FromUrl(image).then(function(e){
6080 nelberth 659
						$('#form-topic-edit #name').trigger('change');
6017 nelberth 660
						$(".volver").css("display","block")
661
						$(".a1").addClass("paso");
662
						$(".titulo_pasos").html("LABEL_STEP_2");
663
						setTimeout(function(){
664
							recorte_listo=true;
665
							$(".fondo_oscuro").css("display","none");
666
							$("#boton_recortar").removeClass("recortar").text("LABEL_SEND").addClass("info_noticia").attr('type','submit');
667
							$(".recortar10").removeClass("recortar");
668
							$(".canvas").removeClass("recortar");
669
							$(".b1").addClass("paso");
670
							$(".titulo_pasos").html("LABEL_STEP_3");
671
							if(texto!=""){
672
								seis=true;
673
								siete=true;
674
							}
675
							cinco=true;
676
							dos=true;
677
							cuatro=true;
678
							actualizar();
5979 nelberth 679
 
6017 nelberth 680
						},editorNoticia(e));
681
 
682
 
683
					})
6021 nelberth 684
 
685
					setTimeout(function(){
6017 nelberth 686
						$(".canvas_subir").html('<span class="icon-plus fa fa-spinner"></span> Cargando...')
6081 nelberth 687
						$('#form-topic-edit #name').trigger('change');
6017 nelberth 688
					},$('#contenido2').html(nuevoHtmlImagen));
689
				}else{
8595 nelberth 690
 
8596 nelberth 691
					edit=true;
6017 nelberth 692
					$('#contenido').html('')
6082 nelberth 693
					setTimeout(function(){
694
						$('#form-topic-edit #name').trigger('change');
695
					},$('#contenido2').html(nuevoHtmlImagen));
6017 nelberth 696
				}
5978 nelberth 697
			}
698
		}
4816 nelberth 699
 
4798 nelberth 700
		$(window).on("scroll", function(){
5132 nelberth 701
			console.log(scroll_altura)
4798 nelberth 702
		if($(window).scrollTop()>scroll_altura){
703
			$("#cuadro_noticias").addClass("fixed");
704
		}else{
705
			$("#cuadro_noticias").removeClass("fixed");
706
		}
707
	})
10792 nelberth 708
	$(window).resize(function() {
709
		anchoFondoOscuro = $(".articulo_noticia").width();
710
		altoFondoOscuro = $(".editor_imagenes").height();
711
		$(".fondo_oscuro").css("width",""+anchoFondoOscuro+"px");
712
		$(".fondo_oscuro").css("height",""+altoFondoOscuro+"px");
10810 nelberth 713
		setTimeout(function(){
714
			anchoFondoOscuro = $(".articulo_noticia").width();
715
			altoFondoOscuro = $(".editor_imagenes").height();
716
			$(".fondo_oscuro").css("width",""+anchoFondoOscuro+"px");
717
			$(".fondo_oscuro").css("height",""+altoFondoOscuro+"px");
10814 nelberth 718
		},300)
10810 nelberth 719
 
10792 nelberth 720
	});
5129 nelberth 721
 
4798 nelberth 722
	$(document).on("dragover", "#imagen_noticia", function(e){
723
		e.preventDefault();
724
		e.stopPropagation();
725
		$(this).css({"background":"rgba(0,0,0,.2)"})
726
	})
727
	$(document).on("drop", "#imagen_noticia", function(e){
728
		e.preventDefault();
729
		e.stopPropagation();
730
		$(this).css("background", "none");
731
		var archivo = e.originalEvent.dataTransfer.files;
732
		var img=archivo[0];
5926 nelberth 733
		if(img.type =="image/jpeg"||img.type =="image/png"){
4798 nelberth 734
			$(".modificar").removeClass("animated");
735
			var render = new FileReader();
736
			render.readAsDataURL(img);
737
			render.onload = function(e){
8345 nelberth 738
				imagen2=new Image();
739
				imagen2.src=e.target.result;
8349 nelberth 740
 
741
				$(imagen2).ready(function(e){
8517 nelberth 742
					if(imagen2.width<200||imagen2.height<200){
8360 nelberth 743
						$.fn.showError('LABEL_MINIMUM_IMAGE_SIZE');
8349 nelberth 744
					}else{
745
						$(".volver").css("display","block")
746
						$(".a1").addClass("paso");
747
						$(".titulo_pasos").html("LABEL_STEP_2");
8351 nelberth 748
						editorNoticia(imagen2.src)
8349 nelberth 749
					}
8350 nelberth 750
				})
8349 nelberth 751
			}
8344 nelberth 752
		}else{
8360 nelberth 753
			$.fn.showError('LABEL_SUPPORTED_FORMATS');
5926 nelberth 754
		}
8346 nelberth 755
	})
8347 nelberth 756
 
4798 nelberth 757
	$(document).on("dragover", "body", function(e){
758
		e.preventDefault();
759
		e.stopPropagation();
760
	})
761
	$(document).on("drop", "body", function(e){
762
		e.preventDefault();
763
		e.stopPropagation();
764
	})
765
 
5741 nelberth 766
	var canvas='<div class="editorNoticia"><canvas id="editorNoticia">LABEL_NOT_SUPPORTED</canvas></div>';
4798 nelberth 767
	$(document).on("mouseover", ".editorNoticia", function(){
768
		$("body").css({"overflow": "hidden"});
5707 nelberth 769
		$(".cuadro_noticias, .fixed_noticia,.tituloEditor,.grid-padre").css("margin-right", "17px")
5146 nelberth 770
		$(".barra,.footer").css("padding-right","17px")
4798 nelberth 771
 
772
 
773
	})
774
	$(document).on("mouseover", "#editorNoticia", function(){
775
		if(recorte_listo){
776
			ocho=true;
777
		}
778
	})
779
	$(document).on("mouseout", "#editorNoticia", function(){
780
		if(recorte_listo){
781
			ocho=false;
782
			actualizar2()
783
		}
784
	})
785
	$(document).on("mouseout", ".editorNoticia",function(){
786
		$("body").css({"overflow": "auto"})
5707 nelberth 787
		$(".cuadro_noticias, .fixed_noticia,.tituloEditor,.grid-padre").css("margin-right", "0px")
4798 nelberth 788
		$(".barra,.footer").css("padding-right","0px")
789
 
790
	})
791
	$(document).on('mousewheel', ".editorNoticia",function(e){
792
		var ruedita = e.originalEvent.wheelDelta
793
		if(ruedita>0){
794
			scale = scale+(scale/10);
795
			$("#porciento_scale").html((scale*100).toFixed(2)+"%")
796
		}else{
797
			scale = scale-(scale/10);
798
			$("#porciento_scale").html((scale*100).toFixed(2)+"%")
799
		}
800
		$("#editorNoticia").css({"transform": "scale("+scale+")"});
801
	})
802
	$(document).on("click", ".as", function(e){
803
		e.preventDefault();
804
		 scale = $(this).data("scale");
805
		 $("#porciento_scale").html((scale*100).toFixed(2)+"%")
806
		 $("#editorNoticia").css({"transform": "scale("+scale+")"});
807
 
808
	})
809
	$(document).on("click", ".ps", function(e){
810
		e.preventDefault();
811
		$(".cantidades_scale").slideToggle(200).css("display", "block");
812
	})
5789 nelberth 813
	$(document).on("click", "#cerrar_filter_modal, .icon_filter", function(e){
814
		e.preventDefault();
5854 nelberth 815
		if(recorte_listo){
5789 nelberth 816
		$(".contenido_filter").slideToggle(200).css("display", "block");
5854 nelberth 817
		}
5789 nelberth 818
	})
5805 nelberth 819
	$(document).on("click", "#cerrar_text_modal, .icon_text", function(e){
820
		e.preventDefault();
5854 nelberth 821
		if(recorte_listo){
5855 nelberth 822
			$(".contenido_text").slideToggle(200).css("display", "block");
5854 nelberth 823
		}
5805 nelberth 824
	})
5865 nelberth 825
 
5816 nelberth 826
	$(document).on("click", "#cerrar_cut_modal, .icon_cut", function(e){
827
		e.preventDefault();
5861 nelberth 828
		if(cortar){
5854 nelberth 829
			$(".contenido_cut").slideToggle(200).css("display", "block");
5861 nelberth 830
		}
5854 nelberth 831
 
5816 nelberth 832
	})
4798 nelberth 833
	$(document).on("click", "#menos_scale", function(e){
834
		e.preventDefault();
835
		scale = scale-(scale/10);
836
		 $("#porciento_scale").html((scale*100).toFixed(2)+"%")
837
		 $("#editorNoticia").css({"transform": "scale("+scale+")"});
838
	})
839
 
840
	$(document).on("click", "#mas_scale", function(e){
841
		e.preventDefault();
842
		scale = scale+(scale/10);
843
		 $("#porciento_scale").html((scale*100).toFixed(2)+"%")
844
		 $("#editorNoticia").css({"transform": "scale("+scale+")"});
845
	})
10747 nelberth 846
	$(document).on('change', '#selectFiltro', function(e){
10770 nelberth 847
 
10747 nelberth 848
		data=$(this).val()
10786 nelberth 849
		if(data=="normal"){
850
			filter();
10788 nelberth 851
		}else{
852
			data=data.split(',');
10805 nelberth 853
			if(data[2]=='gris'){
10788 nelberth 854
				filtergris(data[0],data[1]);
10805 nelberth 855
			}else{
10788 nelberth 856
				filter(Number(data[0]),Number(data[1]),Number(data[2]),Number(data[3]),Number(data[4]),Number(data[5]));
857
			}
10770 nelberth 858
		}
859
 
10783 nelberth 860
 
10788 nelberth 861
 
10747 nelberth 862
	})
10764 nelberth 863
 
10789 nelberth 864
 
4798 nelberth 865
	var texto_listo=false,siete=false;
866
	var texto;
867
	$(document).on("keyup", "#texto_input", function(e){
868
		e.preventDefault();
869
		texto = $(this).val();
870
		if(texto_actualizar){
871
			siete=true;
872
		}
873
		if(texto!=""){
874
			texto_actualizar=true;
875
			actualizar2();
876
		}else{
877
			actualizar2();
878
		}
879
 
880
	})
881
	var color="#ffffff";
10734 nelberth 882
 
4798 nelberth 883
	$(document).on("change", "#color", function(){
884
    	color=$(this).val();
885
    	seis=true;
886
    	actualizar2();
887
    })
888
    var size=48;
10858 nelberth 889
	$(document).on("keypress", "#font-size, #texto_input", function(e){
10857 nelberth 890
    	if(e.which == 13){
891
      		return false;
892
    	}
893
  	});
894
    $(document).on("keyup change", "#font-size", function(e){
10855 nelberth 895
		e.preventDefault();
4798 nelberth 896
    	size=$(this).val();
897
    	size = parseInt(size);
898
    	seis=true;
899
    	siete=true;
900
    	actualizar2();
901
    })
902
    var negritas=false, bold="";
903
    $(document).on("click", "#negritas", function(e){
904
    	e.preventDefault();
905
    	if(!negritas){
906
    		bold="bold";
907
    		$(this).addClass("fa");
908
    		seis=true;
909
    		siete=true;
910
    		actualizar2();
911
    		negritas=true;
912
    	}else{
913
    		bold="";
914
    		$(this).removeClass("fa");
915
    		seis=true;
916
    		siete=true;
917
    		actualizar2();
918
    		negritas=false;
919
    	}
920
    })
921
    var italic=false, ita="";
922
     $(document).on("click", "#italic", function(e){
923
    	e.preventDefault();
924
    	if(!italic){
925
    		ita="italic";
926
    		$(this).addClass("fa");
927
    		seis=true;
928
    		siete=true;
929
    		actualizar2();
930
    		italic=true;
931
    	}else{
932
    		ita="";
933
    		$(this).removeClass("fa");
934
    		seis=true;
935
    		siete=true;
936
    		actualizar2();
937
    		italic=false;
938
    	}
939
    })
940
     var fontfamily="Arial";
10616 nelberth 941
     $(document).on("change", "#selectFuente", function(e){
4798 nelberth 942
    	e.preventDefault();
10618 nelberth 943
    	fontfamily= $(this).val();
4798 nelberth 944
    	seis=true;
945
    	siete=true;
946
    	actualizar2();
947
 
5149 nelberth 948
    })
4798 nelberth 949
     var shadow = true, nueve=true;
5149 nelberth 950
     $(document).on("click","#shadow", function(e){
4798 nelberth 951
     	e.preventDefault();
952
     	if(shadow){
953
     		$(this).removeClass("fa");
954
     		seis=true;
955
     		nueve=false;
956
     		actualizar2();
957
     		shadow=false;
958
     	}else{
959
     		$(this).addClass("fa");
960
     		seis=true;
961
     		nueve=true;
962
     		actualizar2();
963
     		shadow=true;
964
     	}
965
 
5149 nelberth 966
     })
4798 nelberth 967
     var rectangulo=false, diez=false, colorrect="#000000";
5149 nelberth 968
     $(document).on("click", "#rectangulo", function(e){
4798 nelberth 969
     	e.preventDefault();
970
     	if(!rectangulo){
971
     		$(this).addClass("fa");
10691 nelberth 972
			$('.color_fondo_cuadro').css('display','flex')
4798 nelberth 973
     		diez=true;
974
     		actualizar2();
975
     		rectangulo=true;
976
     	}else{
977
     		$(this).removeClass("fa");
10689 nelberth 978
			 $('.color_fondo_cuadro').css('display','none')
4798 nelberth 979
     		diez=false;
980
     		actualizar2();
981
     		rectangulo=false;
982
     	}
983
 
5149 nelberth 984
     })
4798 nelberth 985
     var r=0,g=0,b=0;
986
    $(document).on("change", "#colorrect", function(){
987
    	colorrect=$(this).val();
8315 nelberth 988
    	r=parseInt(colorrect.slice(1,3),16);
989
    	g=parseInt(colorrect.slice(3,5),16);
990
    	b=parseInt(colorrect.slice(5,7),16);
4798 nelberth 991
    	seis=true;
992
    	actualizar2();
993
    })
994
    var a=1;
5149 nelberth 995
 
4798 nelberth 996
    $(document).on("keyup change", "#opacidad", function(){
997
    	a=$(this).val();
998
    	a=a/100;
999
    	seis=true;
1000
    	actualizar2();
5149 nelberth 1001
    })
4798 nelberth 1002
	var imaNoti = new Image();
1003
	function filter(brillo=1, contraste=1, rojo=1, verde=1, azul=1, valor=1){
5073 nelberth 1004
		cuatro=false;
5414 nelberth 1005
		restaurar(brillo, contraste);
4798 nelberth 1006
		datos=imagenOriginal.data;
10783 nelberth 1007
		if(valor==2){
4798 nelberth 1008
			for (var i =  0; i <datos.length; i+=4) {
1009
				datos[i]=datos[i]+rojo;
1010
				datos[i+1]=datos[i+1]+verde;
1011
				datos[i+2]=datos[i+2]+azul;
1012
			}
1013
		}else{
1014
			for (var i =  0; i <datos.length; i+=4) {
1015
				datos[i]=datos[i]*rojo;
1016
				datos[i+1]=datos[i+1]*verde;
1017
				datos[i+2]=datos[i+2]*azul
1018
			}
1019
		}
1020
		editor.putImageData(imagenOriginal,0,0)
1021
		var imagenNoticia = elemento.toDataURL("image/jpeg", 1.0);
1022
	    imaNoti.src = imagenNoticia;
1023
		actualizar2();
1024
	}
1025
	function filtergris(brillo=1, contraste=1){
1026
		cuatro=false;
1027
		restaurar(brillo, contraste);
1028
		datos=imagenOriginal.data;
1029
		var auxiliar;
1030
		for (var i =  0; i <datos.length; i+=4) {
8315 nelberth 1031
			auxiliar = 0.34 * datos[i] + 0.5 *datos[i+1] + 0.16 * datos[i+2];
4798 nelberth 1032
			datos[i]=auxiliar;
1033
			datos[i+1]=auxiliar;
1034
			datos[i+2]=auxiliar;
1035
		}
5429 nelberth 1036
 
4798 nelberth 1037
		editor.putImageData(imagenOriginal,0,0)
1038
		var imagenNoticia = elemento.toDataURL("image/jpeg", 1.0);
1039
	    imaNoti.src = imagenNoticia;
1040
		actualizar2();
1041
	}
1042
	function restaurar(brillo = 1, contraste=1){
1043
		editor.filter = "none"
1044
		editor.filter = 'contrast('+contraste+') brightness('+brillo+') saturate(1) sepia(0)';
5429 nelberth 1045
		editor.fillStyle="rgba(255,255,255,1)"
1046
		editor.fillRect(0,0,ancho,alto);
5458 nelberth 1047
		editor.fillStyle=""+color+"";
5414 nelberth 1048
		var pxf=0,pyf=0;
1049
			if(xf>=(yf/recorte)){
5459 nelberth 1050
				pxf=xf/ancho;
1051
				pyf=yf/pxf;
1052
				py=(alto/2)-(pyf/2);
1053
				editor.drawImage(imagen,x,y,xf,yf,0,py,ancho,pyf);
1054
			}else{
1055
				pyf=yf/alto;
5461 nelberth 1056
				pxf=xf/pyf;
5459 nelberth 1057
				px=(ancho/2)-(pxf/2);
1058
				editor.drawImage(imagen,x,y,xf,yf,px,0,pxf,alto);
1059
			}
4798 nelberth 1060
		imagenOriginal = editor.getImageData(0,0,ancho,alto)
1061
	}
1062
	var ocho=false;
1063
	function actualizar2(){
1064
		if(recorte_listo){
1065
		if(cuatro){
1066
			imagenOriginal = editor.getImageData(0,0,ancho,alto)
1067
			var imagenNoticia = elemento.toDataURL("image/jpeg", 1.0);
1068
	    	imaNoti.src = imagenNoticia;
1069
	    	cuatro=false;
1070
		}
1071
		editor.filter = "none"
5428 nelberth 1072
		$(imaNoti).ready(function(e){
5433 nelberth 1073
			noticia.drawImage(imaNoti,0,0,320,480);
5394 nelberth 1074
			editor.drawImage(imaNoti,0,0,ancho,alto)
4798 nelberth 1075
			if(texto_actualizar){
1076
				if(texto!=""){
1077
					if(seis){
1078
						ancho_imaNoti = imaNoti.width;
5439 nelberth 1079
 
1080
						scale_noticia = -(((ancho_imaNoti-320)/ancho_imaNoti)-1);
4798 nelberth 1081
						editor.fillStyle=""+color+"";
1082
						editor.strokeStyle="rgb(255,255,255)";
1083
						if(nueve){
1084
							editor.shadowColor="rgba(0,0,0,.5)";
1085
							editor.shadowOffsetX=6;
1086
							editor.shadowOffsetY=6;
1087
							editor.shadowBlur=6;
1088
							noticia.shadowColor="rgba(0,0,0,.5)";
1089
							noticia.shadowOffsetX=6*scale_noticia;
1090
							noticia.shadowOffsetY=6*scale_noticia;
1091
							noticia.shadowBlur=6*scale_noticia;
1092
						}else{
1093
							editor.shadowColor="rgba(0,0,0,0)";
1094
							noticia.shadowColor="rgba(0,0,0,0)";
1095
						}
1096
						editor.font=""+ita+" "+bold+" "+size+"px "+fontfamily+"";
1097
						editor.textAlign="start";
1098
						editor.textBaseline="top";
1099
 
1100
						var sizeNoticia = size*scale_noticia;
1101
						noticia.fillStyle=""+color+"";
1102
						noticia.font=""+ita+" "+bold+" "+sizeNoticia+"px "+fontfamily+"";
1103
						noticia.textAlign="start";
1104
						noticia.textBaseline="top";
1105
						seis=false;
1106
					}
1107
					if(siete){
1108
						dimencionesTexto = editor.measureText(texto);
1109
						txf=dimencionesTexto.width+20;
1110
						tyf= (20+size);
1111
						siete=false;
1112
					}
5443 nelberth 1113
					if(cinco){
4798 nelberth 1114
						dimencionesTexto = editor.measureText(texto);
5441 nelberth 1115
						if(xf>=(yf/recorte)){
1116
							tx=(xf/2)-(dimencionesTexto.width/2);
1117
							ty=(xf*recorte/2)-(size/2);
1118
						}else{
1119
							tx=(yf/recorte/2)-(dimencionesTexto.width/2);
1120
							ty=(yf/2)-(size/2);
1121
						}
1122
 
4798 nelberth 1123
						txf=dimencionesTexto.width+20;
1124
						tyf= size+20;
1125
						cinco=false;
5443 nelberth 1126
					}
4798 nelberth 1127
					if(diez){
1128
						editor.fillStyle="rgba("+r+","+g+","+b+","+a+")";
1129
						noticia.fillStyle="rgba("+r+","+g+","+b+","+a+")";
1130
						editor.fillRect(tx-10,ty-10,txf,tyf);
5387 nelberth 1131
						noticia.fillRect(((tx-10)*scale_noticia),((ty-10)*scale_noticia),txf*scale_noticia,tyf*scale_noticia);
4798 nelberth 1132
						editor.fillStyle=""+color+"";
1133
						noticia.fillStyle=""+color+"";
1134
 
1135
					}
1136
					editor.fillText(texto,tx,ty);
5440 nelberth 1137
					noticia.fillText(texto,(tx*scale_noticia),ty*scale_noticia);
4798 nelberth 1138
					if(ocho){
1139
						editor.strokeRect(tx-10,ty-10,txf,tyf)
1140
						editor.arc(tx+txf,ty+tyf,10,0,Math.PI*2,false);
1141
						editor.fill();
1142
						editor.beginPath();
1143
					}
1144
					texto_listo=true;
1145
				}
1146
			}
1147
		})
1148
 
1149
	}
1150
	}
1151
	function actualizar(){
1152
			$(imagen).ready(function(e){
1153
				if(uno){
1154
					ancho=imagen.width, alto = imagen.height;
5388 nelberth 1155
					elemento.width = ancho;
1156
					elemento.height = alto;
4798 nelberth 1157
					$(".scale").css("display","flex");
1158
					if(ancho<=alto){
1159
					 scale = -(((alto-450)/alto)-1);
8329 nelberth 1160
 
8339 nelberth 1161
 
8329 nelberth 1162
					}else{
1163
					 scale = -(((ancho-500)/ancho)-1);
8339 nelberth 1164
 
4798 nelberth 1165
					}
10598 nelberth 1166
					scale=scale*0.85;
8578 nelberth 1167
					if(edit){
8577 nelberth 1168
						if((ancho*recorte)<=alto){
1169
							xf=ancho*.70;
1170
							yf=xf*recorte;
1171
						}else{
1172
							yf=alto*.70;
1173
							xf=yf/recorte;
1174
						}
1175
					}
10597 nelberth 1176
 
8343 nelberth 1177
					cuadro_dimencion=Math.round(12/scale);
8328 nelberth 1178
 
8308 nelberth 1179
					if(xf<50||yf<50){
1180
						xf=50;
1181
						yf=xf*recorte;
1182
					}
8304 nelberth 1183
					console.log(xf+' '+yf)
8301 nelberth 1184
					mitadX=ancho/2;
1185
					mitadY=alto/2;
1186
					x=mitadX-xf/2;
1187
					y=mitadY-yf/2;
1188
 
4798 nelberth 1189
					$("#porciento_scale").html((scale*100).toFixed(2)+"%")
1190
					$("#ancho").html(ancho+"px");
1191
					$("#alto").html(alto+"px");
1192
					uno=false;
1193
				}
1194
				if(dos){
5402 nelberth 1195
 
1196
					if(xf>=(yf/recorte)){
5405 nelberth 1197
						alto=xf*recorte;
5404 nelberth 1198
						ancho=xf;
5402 nelberth 1199
					}else{
5435 nelberth 1200
						ancho=yf/recorte;
5404 nelberth 1201
						alto=yf;
1202
 
5402 nelberth 1203
					}
1204
					elemento.width = ancho;
1205
					elemento.height = alto;
5451 nelberth 1206
					if(xf<=yf){
5411 nelberth 1207
					 scale = -(((yf-450)/yf)-1);
5433 nelberth 1208
 
4798 nelberth 1209
					}else{
5411 nelberth 1210
					 scale = -(((xf-500)/xf)-1);
4798 nelberth 1211
					}
1212
 
1213
					$("#porciento_scale").html((scale*100).toFixed(2)+"%")
5411 nelberth 1214
					$("#ancho").html(Math.round(xf)+"px");
1215
					$("#alto").html(Math.round(yf)+"px");
4798 nelberth 1216
					dos=false;
1217
				}
5235 nelberth 1218
 
5408 nelberth 1219
					var pxf=0,pyf=0;
1220
					noticia.fillStyle="rgba(255,255,255,1)"
1221
					noticia.fillRect(0,0,320,480);
1222
				if(xf>=(yf/recorte)){
1223
					pxf=xf/320;
1224
					pyf=yf/pxf;
1225
					py=(480/2)-(pyf/2);
1226
					noticia.drawImage(imagen,x,y,xf,yf,0,py,320,pyf);
5409 nelberth 1227
				}else{
5408 nelberth 1228
					pyf=yf/480;
1229
					pxf=xf/pyf;
1230
					px=(320/2)-(pxf/2);
1231
					noticia.drawImage(imagen,x,y,xf,yf,px,0,pxf,480);
5409 nelberth 1232
				}
5407 nelberth 1233
 
4840 nelberth 1234
				$("#editorNoticia").css({"transform": "scale("+scale+")"});
4798 nelberth 1235
				if(!recorte_listo){
1236
					editor.drawImage(imagen,0,0,ancho,alto);
8320 nelberth 1237
					editor.fillStyle="rgba(0,0,0,.2)"
4798 nelberth 1238
					editor.fillRect(0,0,ancho,alto);
8320 nelberth 1239
					editor.fillStyle="rgba(255,255,255,.2)"
4798 nelberth 1240
					editor.fillRect(x,y,xf,yf);
8324 nelberth 1241
					editor.fillStyle="rgba(255,255,255,0.8)"
8315 nelberth 1242
					editor.fillRect(x,y,cuadro_dimencion,cuadro_dimencion);
1243
					editor.fillRect((x+xf)-cuadro_dimencion,y,cuadro_dimencion,cuadro_dimencion);
1244
					editor.fillRect(x,y+yf-cuadro_dimencion,cuadro_dimencion,cuadro_dimencion);
1245
					editor.fillRect(x+xf-cuadro_dimencion,yf+y-cuadro_dimencion,cuadro_dimencion,cuadro_dimencion);
4798 nelberth 1246
					esta=true;
1247
				}else{
5406 nelberth 1248
					var pxf=0,pyf=0;
5427 nelberth 1249
 
5428 nelberth 1250
					editor.fillStyle="rgba(255,255,255,1)"
1251
					editor.fillRect(0,0,ancho,alto);
5406 nelberth 1252
					if(xf>=(yf/recorte)){
1253
						pxf=xf/ancho;
1254
						pyf=yf/pxf;
1255
						py=(alto/2)-(pyf/2);
1256
						editor.drawImage(imagen,x,y,xf,yf,0,py,ancho,pyf);
1257
					}else{
1258
						pyf=yf/alto;
1259
						pxf=xf/pyf;
1260
						px=(ancho/2)-(pxf/2);
1261
						editor.drawImage(imagen,x,y,xf,yf,px,0,pxf,alto);
4798 nelberth 1262
				}
5406 nelberth 1263
 
1264
				}
4798 nelberth 1265
			})
1266
		}
1267
	var imagenOriginal;
8356 nelberth 1268
	var x,y,xf=320,yf =480, elemento,editor,centro, total,scale,dimencionesTexto,ancho_imaNoti,
4798 nelberth 1269
	recorte_listo=false,alto,ancho,tx,ty,txf,tyf,cuatro=true,texto_actualizar=false,cinco=true,seis=true,cuatro;
5865 nelberth 1270
	var  mitadY,mitadX, uno=true,dos=false, recorte=480/320, imagen_noticias, scale_noticia, tres=true,rotar=false, cortar=false;;
8317 nelberth 1271
	var translateX, cuadro_dimencion;
4798 nelberth 1272
 
5822 nelberth 1273
	$(document).on("click", ".recortar10", function(e){
5540 nelberth 1274
 
4798 nelberth 1275
		e.preventDefault();
1276
		recorte_listo=false;
1277
		uno=true;
1278
		$(".fondo_oscuro").css("display","block");
1279
		$("#boton_recortar").addClass("recortar").text("Recortar").removeClass("info_noticia");
1280
		$("#boton_recortar3").addClass("recortar").text("Recortar").removeClass("info_noticia3");
5855 nelberth 1281
		$(".contenido_text").css("display", "none");
1282
		$(".contenido_filter").css("display", "none");
5822 nelberth 1283
		$(".recortar10").addClass("recortar");
4798 nelberth 1284
		$(".canvas").addClass("recortar")
1285
		$(".oa").removeClass("oa");
1286
		$("#normal").addClass("oa");
1287
		$(".b1").removeClass("paso");
5741 nelberth 1288
		$(".titulo_pasos").html("LABEL_STEP_2");
4798 nelberth 1289
		window.clearInterval(actualizar2);
1290
		actualizar();
1291
 
1292
	})
5789 nelberth 1293
 
1294
 
10803 nelberth 1295
	blockCelda=false;
5488 nelberth 1296
	$(document).on("click", "#blockCelda", function(e){
1297
		e.preventDefault();
5490 nelberth 1298
		if(blockCelda){
1299
			$(this).html('<span class="fa fa-unlock"></span>')
5495 nelberth 1300
 
5490 nelberth 1301
			blockCelda=false;
1302
		}else{
1303
			$(this).html('<span class="fa fa-lock"></span>')
1304
			blockCelda=true;
1305
		}
5495 nelberth 1306
		t4=true;
5488 nelberth 1307
 
1308
	})
4798 nelberth 1309
	var imagen
1310
	function editorNoticia(img){
5865 nelberth 1311
		 cortar=true;
4798 nelberth 1312
		imagen= new Image();
1313
		$(".canvas").html(canvas);
1314
		elemento = document.getElementById("editorNoticia");
1315
		editor = elemento.getContext("2d");
1316
		elemento2 = document.getElementById("imagen_noticias");
1317
		noticia = elemento2.getContext("2d");
1318
 
1319
		$(document).on("click", ".boton_marino.recortar",function(e){
1320
			e.preventDefault();
1321
			recorte_listo=true;
1322
			$(".fondo_oscuro").css("display","none");
5741 nelberth 1323
			$("#boton_recortar").removeClass("recortar").text("LABEL_SEND").addClass("info_noticia").attr('type','submit');
5822 nelberth 1324
			$(".recortar10").removeClass("recortar");
4798 nelberth 1325
			$(".canvas").removeClass("recortar");
1326
			$(".b1").addClass("paso");
5741 nelberth 1327
			$(".titulo_pasos").html("LABEL_STEP_3");
4798 nelberth 1328
			if(texto!=""){
1329
				seis=true;
1330
				siete=true;
1331
			}
1332
			cinco=true;
1333
			dos=true;
1334
			cuatro=true;
1335
			actualizar();
1336
		})
1337
 
1338
		var cli = false, t1= false, t2=false,t3=false,t4=false,tcli=false;
1339
		var mouse =[];
1340
 
1341
 
1342
		function raton(elemento, e){
1343
			return {
1344
				x:((e.pageX - elemento.offsetLeft - ((ancho/2)-((ancho*scale)/2)))/scale),
1345
				y:((e.pageY - elemento.offsetTop - ((alto/2)-((alto*scale)/2)))/scale)
1346
			}
1347
		}
1348
 
1349
		imagen.src=img;
5822 nelberth 1350
		$(".recortar10").addClass("recortar");
5741 nelberth 1351
		$("#boton_recortar").removeClass("boton_normal").addClass("recortar boton_marino").text("LABEL_CUT")
4798 nelberth 1352
		actualizar();
1353
 
1354
		$(elemento).mousemove(function(e){
1355
			mouse = raton(this, e);
10535 nelberth 1356
 
4798 nelberth 1357
			if(!recorte_listo){
8335 nelberth 1358
				if(x<mouse.x &&(xf+x)>mouse.x && y<mouse.y && (y+yf)>mouse.y){
1359
					if((xf+x-cuadro_dimencion)<mouse.x &&(xf+x)>mouse.x && (y+yf-cuadro_dimencion)<mouse.y && (y+yf)>mouse.y){
1360
			 			$(elemento).css("cursor","nw-resize");
1361
			 		}else if((xf+x-cuadro_dimencion)<mouse.x &&(xf+x)>mouse.x && y<mouse.y && (y+cuadro_dimencion)>mouse.y){
1362
			 			$(elemento).css("cursor","ne-resize");
1363
			 		}else if(x<mouse.x &&(cuadro_dimencion+x)>mouse.x && y<mouse.y && (y+cuadro_dimencion)>mouse.y){
1364
			 			$(elemento).css("cursor","se-resize");
1365
			 		}else if(x<mouse.x &&(cuadro_dimencion+x)>mouse.x && (y+yf-cuadro_dimencion)<mouse.y &&(y+yf)>mouse.y){
1366
			 			$(elemento).css("cursor","sw-resize");
1367
			 		}else{
1368
						$(elemento).css("cursor","move");
1369
					}
4798 nelberth 1370
			 	}else{
1371
			 		$(elemento).css("cursor","default");
1372
			 	}
1373
			}else if(texto_listo){
1374
				if(tx-10<mouse.x && tx-10+txf>mouse.x && ty-10<mouse.y && ty-10+tyf>mouse.y){
1375
			 		$(elemento).css("cursor","move");
1376
			 	}else if((txf+tx-10)<mouse.x &&(txf+tx-10+20)>mouse.x && (ty-10+tyf)<mouse.y && (ty-10+tyf+20)>mouse.y){
1377
			 		$(elemento).css("cursor","pointer");
1378
			 	}else{
1379
			 		$(elemento).css("cursor","default");
1380
			 	}
1381
			}
1382
			else{
1383
				$(elemento).css("cursor","default");
1384
			}
1385
		})
1386
		$(elemento).mousedown(function(e){
1387
			mouse = raton(this, e);
1388
			if(!recorte_listo){
8334 nelberth 1389
				if(x<mouse.x &&(xf+x)>mouse.x && y<mouse.y && (y+yf)>mouse.y){
8333 nelberth 1390
 
1391
					if((xf+x-cuadro_dimencion)<mouse.x &&(xf+x)>mouse.x && (y+yf-cuadro_dimencion)<mouse.y && (y+yf)>mouse.y){
1392
						t4 = true;
1393
					}else if((xf+x-cuadro_dimencion)<mouse.x &&(xf+x)>mouse.x && y<mouse.y && (y+cuadro_dimencion)>mouse.y){
1394
						t3 = true;
1395
					}else if(x<mouse.x &&(cuadro_dimencion+x)>mouse.x && y<mouse.y && (y+cuadro_dimencion)>mouse.y){
1396
						t1 = true;
1397
					}else if(x<mouse.x &&(cuadro_dimencion+x)>mouse.x && (y+yf-cuadro_dimencion)<mouse.y &&(y+yf)>mouse.y){
1398
						t2 = true;
1399
					}else{
1400
						cli = true;
1401
					}
4798 nelberth 1402
			 	}
8333 nelberth 1403
 
4798 nelberth 1404
			}else if(texto_listo){
1405
				if(tx-10<mouse.x && tx-10+txf>mouse.x && ty-10<mouse.y && ty-10+tyf>mouse.y){
1406
			 		tcli=true;
1407
			 	}else if((txf+tx-10)<mouse.x &&(txf+tx-10+20)>mouse.x && (ty-10+tyf)<mouse.y && (ty-10+tyf+20)>mouse.y){
1408
			 		rotar=true;
1409
			 	}
1410
			}
1411
 
1412
		 })
1413
 
10515 nelberth 1414
		 $('.editorNoticia').mousemove(function(e){
4798 nelberth 1415
		 	mouse = raton(this, e);
10594 nelberth 1416
			//console.log("raton x: "+mouse.x+ " raton Y: " +mouse.y+ " xf: "+xf+" yf: "+yf)
10597 nelberth 1417
			//console.log('t1: '+t1+' t2: '+t2+' t3: '+t3+' t4: '+t4)
4798 nelberth 1418
		 	if(!recorte_listo){
1419
			 	if(cli){
1420
			 		if((mouse.y-(yf/2))>=0&&(mouse.y+(yf/2))<=alto){
1421
				 		y = (mouse.y-(yf/2));
1422
			 		}else{
1423
			 			if((mouse.y-(yf/2))<0){
1424
			 				y=0;
1425
			 			}
1426
			 			if((mouse.y+(yf/2))>alto){
1427
			 				y=alto-yf;
1428
			 			}
1429
			 		}
1430
			 		if((mouse.x-(xf/2))>=0&&(mouse.x+(xf/2))<=ancho){
1431
			 			x = (mouse.x-(xf/2));
1432
			 		}else{
1433
			 			if((mouse.x-(xf/2))<0){
1434
			 				x=0;
1435
			 			}
1436
			 			if((mouse.x+(xf/2))>ancho){
1437
			 				x=(ancho)-xf;
1438
			 			}
1439
			 		}
1440
			 	}
5492 nelberth 1441
				if(blockCelda){
1442
			 	if(t4){
10494 nelberth 1443
					cal1=mouse.y-y;
1444
			 		cal2=cal1/recorte;
10571 nelberth 1445
					cal3=x+cal2;
10564 nelberth 1446
					if(cal2>50){
10571 nelberth 1447
						if(cal3<=ancho&&mouse.y<=alto){
10568 nelberth 1448
							yf=cal1;
1449
				 			xf=cal2;
10572 nelberth 1450
						}else if(cal3<=ancho&&mouse.y>alto){
1451
							yf=alto-y;
1452
							xf=yf/recorte
10571 nelberth 1453
						}else if(cal3>=ancho&&mouse.y<=alto){
10570 nelberth 1454
							xf=ancho-x;
10571 nelberth 1455
							yf=xf*recorte;
10568 nelberth 1456
						}
10489 nelberth 1457
				 	}
4798 nelberth 1458
			 	}
1459
			 	if(t3){
10495 nelberth 1460
					cal1=yf+(y-mouse.y);
1461
			 		cal2=cal1/recorte;
10572 nelberth 1462
					cal3=x+cal2;
10579 nelberth 1463
					if(cal2>50){
10572 nelberth 1464
						if(cal3<=ancho&&mouse.y>=0){
1465
							yf=cal1;
1466
				 			xf=cal2;
1467
							y=mouse.y;
1468
						}else if(cal3<=ancho&&mouse.y<0){
1469
							yf=yf+y;
1470
							xf=yf/recorte
1471
							y=0;
10578 nelberth 1472
						}else if(cal3>=ancho){
10575 nelberth 1473
							xf=ancho-x;
10578 nelberth 1474
							y=y+(yf-xf*recorte);
10580 nelberth 1475
							yf=xf*recorte;
10572 nelberth 1476
						}
1477
 
10496 nelberth 1478
				 	}
1479
 
4798 nelberth 1480
			 	}
1481
			 	if(t2){
10580 nelberth 1482
 
10498 nelberth 1483
					cal1=mouse.y-y;
1484
			 		cal2=cal1/recorte;
10580 nelberth 1485
					cal3=x+(yf-cal1)/recorte;cal2;
1486
					if(cal2>50){
1487
						if(cal3>=0&&mouse.y<=alto){
1488
							x=cal3;
1489
							yf=cal1;
1490
				 			xf=cal2;
10593 nelberth 1491
						}else if(mouse.y>alto||cal3<0&&mouse.y>alto){
10580 nelberth 1492
							yf=alto-y;
10583 nelberth 1493
							x=x+(xf-yf/recorte);
10580 nelberth 1494
							xf=yf/recorte
10593 nelberth 1495
						}else if(cal3<0){
10584 nelberth 1496
							xf=xf+x;
1497
							yf=xf*recorte;
1498
							x=0;
10580 nelberth 1499
						}
10586 nelberth 1500
				 	}
10499 nelberth 1501
 
5215 nelberth 1502
			 	}
1503
			 	if(t1){
10506 nelberth 1504
					cal0=y-mouse.y;
1505
					cal1=yf+cal0;
10500 nelberth 1506
			 		cal2=cal1/recorte;
10506 nelberth 1507
					cal3=x-cal0/recorte;
10586 nelberth 1508
					if(cal2>50){
1509
						if(cal3>=0&&mouse.y>=0){
1510
							yf=cal1;
1511
					 		xf=cal2;
1512
					 		x=cal3;
1513
					 		y=mouse.y;
10593 nelberth 1514
						}else if(mouse.y<0||cal3<0&&mouse.y<0){
10590 nelberth 1515
							yf=yf+y;
1516
							x=x+(xf-yf/recorte);
10586 nelberth 1517
							xf=yf/recorte
10590 nelberth 1518
							y=0;
10593 nelberth 1519
						}else if(cal3<0){
10589 nelberth 1520
							xf=xf+x;
10588 nelberth 1521
							y=y+(yf-xf*recorte);
10586 nelberth 1522
							yf=xf*recorte;
1523
							x=0;
1524
						}
1525
				 	}
1526
 
10504 nelberth 1527
				}
5492 nelberth 1528
				}else{
10586 nelberth 1529
				if(t4){
10537 nelberth 1530
 
10541 nelberth 1531
					cal1=mouse.y-y;
1532
					cal2=mouse.x-x;
1533
					if(cal1>50){
1534
						yf=mouse.y<=alto?cal1:alto-y;
1535
				 	}
1536
					if(cal2>50){
1537
						xf=mouse.x<=ancho?cal2:ancho-x;
1538
					}
5215 nelberth 1539
			 	}
10543 nelberth 1540
 
5215 nelberth 1541
			 	if(t3){
10542 nelberth 1542
					cal1=yf-(mouse.y-y);
1543
					cal2=mouse.x-x;
1544
					if(cal1>50){
10553 nelberth 1545
 
10551 nelberth 1546
						if(mouse.y>=0){
1547
							yf=cal1;
1548
							y=mouse.y;
1549
						}else{
10552 nelberth 1550
							yf=yf+y;
10551 nelberth 1551
							y=0;
1552
						}
10542 nelberth 1553
				 	}
1554
					if(cal2>50){
10547 nelberth 1555
						xf=mouse.x<=ancho?cal2:ancho-x;
10542 nelberth 1556
					}
10543 nelberth 1557
			 	}
5332 nelberth 1558
				/* Izquierda abajo */
5215 nelberth 1559
			 	if(t2){
10555 nelberth 1560
					cal1=mouse.y-y;
1561
					cal2=xf-(mouse.x-x);
1562
					if(cal1>50){
1563
						yf=yf=mouse.y<=alto?cal1:alto-y;
1564
					}
1565
					if(cal2>50){
10556 nelberth 1566
						if(mouse.x>=0){
10555 nelberth 1567
							xf=cal2;
10559 nelberth 1568
							x=mouse.x;
10555 nelberth 1569
						}else{
1570
							xf=xf+x;
1571
							x=0;
1572
						}
1573
					}
4798 nelberth 1574
			 	}
5332 nelberth 1575
				/* izquierda arriba */
4798 nelberth 1576
			 	if(t1){
10560 nelberth 1577
 
1578
					cal1=yf-(mouse.y-y);
1579
					cal2=xf-(mouse.x-x);
1580
					if(cal1>50){
1581
 
1582
						if(mouse.y>=0){
1583
							yf=cal1;
1584
							y=mouse.y;
1585
						}else{
1586
							yf=yf+y;
1587
							y=0;
1588
						}
1589
				 	}
1590
					if(cal2>50){
1591
						if(mouse.x>=0){
1592
							xf=cal2;
1593
							x=mouse.x;
1594
						}else{
1595
							xf=xf+x;
1596
							x=0;
1597
						}
1598
					}
10562 nelberth 1599
 
4798 nelberth 1600
			 	}
5492 nelberth 1601
			}
4798 nelberth 1602
 
1603
		 	actualizar();
1604
		 	}else if(texto_listo){
1605
		 		if(tcli){
1606
		 			tx=mouse.x-(txf/2)
1607
		 			ty=mouse.y-(tyf/2)
1608
		 		}else if(rotar){
1609
 
1610
		 		}
1611
 
1612
		 		actualizar2();
1613
		 	}
1614
		 })
10446 nelberth 1615
		 $('body').mouseup(function(e){
10599 nelberth 1616
			console.log('levanto el mouse')
4798 nelberth 1617
		 	if(!recorte_listo){
1618
			 	cli=false;
1619
			 	t1=false;
1620
			 	t2=false;
1621
			 	t3=false;
1622
			 	t4=false;
1623
		 	}else if (texto_listo) {
1624
		 		tcli=false;
1625
		 	}
1626
		 })
1627
 
5129 nelberth 1628
 
4798 nelberth 1629
	}
5500 nelberth 1630
	/* Titulo */
5501 nelberth 1631
 
6073 nelberth 1632
var titulo_noticia, censor_titulo = true, numero_titulo=0;
5500 nelberth 1633
	$(document).on("keyup change", "#name", function(e){
5501 nelberth 1634
	console.log(numero_titulo)
5500 nelberth 1635
	titulo_noticia = $(this).val();
1636
	titulo_elemento= $(".titulo_topico");
1637
	if(titulo_noticia!=""){
5505 nelberth 1638
		if(censor_titulo){
5500 nelberth 1639
			titulo_elemento.html(titulo_noticia);
1640
			if(titulo_elemento.height()>38){
5508 nelberth 1641
				var titulo_noticia2 = "";
5500 nelberth 1642
				for(var i =0; i <titulo_noticia.length;i++){
1643
					titulo_noticia2 = titulo_noticia2 + titulo_noticia.split("")[i];
1644
					titulo_elemento.html(titulo_noticia2);
1645
					if(titulo_elemento.height()>38){
1646
						titulo_noticia2 = titulo_noticia2.slice(0,-5) + "...";
1647
						titulo_elemento.html(titulo_noticia2);
1648
						numero_titulo = titulo_noticia2.length;
1649
						censor_titulo=false;
1650
						break;
1651
					}
4798 nelberth 1652
 
5500 nelberth 1653
				}
1654
			}else{
1655
				numero_titulo=0;
1656
			}
1657
		}else{
1658
			if(numero_titulo+1>=titulo_noticia.length){
1659
				titulo_elemento.html(titulo_noticia);
1660
				censor_titulo=true;
1661
			}
5505 nelberth 1662
		}
5500 nelberth 1663
	}else{
5741 nelberth 1664
		titulo_elemento.html("LABEL_TITLE_TOPIC");
5500 nelberth 1665
		censor_titulo = true;
1666
	}
1667
})
1 www 1668
    });
1669
JS;
1670
$this->inlineScript()->captureEnd();
1671
?>
1672
 
1673
 
1674
 
1675
<!-- Content Header (Page header) -->
1676
<section class="content-header">
1677
	<div class="container-fluid">
1678
    	<div class="row mb-2">
1679
        	<div class="col-sm-12">
1680
            	<h1>LABEL_TOPICS</h1>
1681
			</div>
1682
		</div>
1683
	</div><!-- /.container-fluid -->
1684
</section>
1685
 
4693 nelberth 1686
<section class="content" id='content1'>
1 www 1687
	<div class="container-fluid">
1688
    	<div class="row">
1689
        	<div class="col-12">
1690
				<div class="card">
1691
					<div class="card-body">
20 steven 1692
        	    		<table id="gridTable" class="table   table-hover">
1 www 1693
                      		<thead>
1694
        						<tr>
1695
                                	<th>LABEL_NAME</th>
1696
                                  	<th>LABEL_STATUS</th>
1697
                                  	<th>LABEL_DETAILS</th>
1698
                                  	<th>LABEL_ACTIONS</th>
1699
                                </tr>
1700
                       		</thead>
1701
                         	<tbody>
1702
                         	</tbody>
1703
                    	</table>
1704
                   	</div>
1705
                   	<div class="card-footer clearfix">
1706
                   		<div style="float:right;">
1707
							<button type="button" class="btn btn-info btn-refresh"><i class="fa fa-refresh"></i> LABEL_REFRESH  </button>
1708
							<?php if($allowAdd) : ?>
1709
							<button type="button" class="btn btn-primary btn-add"><i class="fa fa-plus"></i> LABEL_ADD </button>
1710
							<?php endif; ?>
1711
						</div>
1712
                 	</div>
1713
          		</div>
1714
           	</div>
1715
        </div>
1716
 	</div>
1717
</section>
5467 nelberth 1718
<section id="addImage" style='display:none' class="">
5463 nelberth 1719
<div class="d-flex justify-content-center tituloEditor">
5701 nelberth 1720
        <h4>LABEL_ADD_TOPIC</h4>
5463 nelberth 1721
 
1722
    </div>
5687 nelberth 1723
	<div class="grid-padre" >
5487 nelberth 1724
				<?php
5462 nelberth 1725
       			 $form = $this->formAdd;
1726
            		$form->setAttributes([
1727
                        'method'  => 'post',
1728
            		    'action'  => $routeAdd,
1729
                        'name'    => 'form-topic-add',
1730
                        'id'      => 'form-topic-add',
1731
                    ]);
1732
 
1733
                    $form->prepare();
1734
                    echo $this->form()->openTag($form);
1735
                    ?>
5684 nelberth 1736
    			<div class="form-group grid-1-2">
5462 nelberth 1737
    				<?php
1738
                        $element = $form->get('name');
1739
 
1740
                        $element->setAttributes(['class' => 'form-control']);
1741
                        $element->setOptions(['label' => 'LABEL_NAME']);
1742
                        echo $this->formLabel($element);
1743
                        echo $this->formText($element);
1744
                    ?>
1745
				</div>
5487 nelberth 1746
 
5684 nelberth 1747
                <div class="form-group grid-1-2">
5462 nelberth 1748
                	<?php
1749
                    $element = $form->get('description');
1750
                    $element->setAttributes(['id' => 'description_add', 'class' => 'form-control', 'rows' => '2','class' => 'form-control']);
1751
                    $element->setOptions(['label' => 'LABEL_DESCRIPTION']);
1752
                    echo $this->formLabel($element);
1753
                    echo $this->formTextArea($element);
1754
                    ?>
1755
   				</div>
5684 nelberth 1756
				<div class="form-group grid-1-2">
5462 nelberth 1757
    				<?php
1758
                        $element = $form->get('order');
1759
                        $element->setAttributes(['class' => 'form-control']);
1760
                        $element->setOptions(['label' => 'LABEL_ORDER']);
1761
                        echo $this->formLabel($element);
1762
                        echo $this->formText($element);
1763
                    ?>
1764
				</div>
5678 nelberth 1765
 
5462 nelberth 1766
               		<?php
5531 nelberth 1767
                    $element = $form->get('file');
5991 nelberth 1768
					$element->setAttributes([ 'class' => 'file']);
5653 nelberth 1769
                    echo $this->formHidden($element); ?>
5678 nelberth 1770
 
5684 nelberth 1771
          		<div class="form-group grid-1-2">
5462 nelberth 1772
    				<?php
1773
                        $element = $form->get('status');
1774
                        $element->setAttributes(['class' => 'form-control']);
1775
                        $element->setOptions(['label' => 'LABEL_STATUS']);
1776
                        echo $this->formLabel($element);
1777
                        echo $this->formSelect($element);
1778
                    ?>
1779
				</div>
10864 nelberth 1780
 
5747 nelberth 1781
				<div class="contenido form-group" id="contenido">
10861 nelberth 1782
				<div class="articulo_noticia animated fadeIn">
1783
    <div class="pasos">
1784
        <div class="titulo_pasos animated fadeInDown delay-04 fast">LABEL_STEP_1</div>
1785
        <div class="paso_opcion">
1786
            <div class="responsing_cut">
1787
                <div class="icon_cut"><span class="fa fa-scissors"></span></div>
1788
                <div class="contenido_cut">
1789
                    <div class="animated fadeInRight delay-04 fast">
1790
                        <div>
1791
                            <div class="titulo_cut">
1792
                                <div>LABEL_CUT</div>
1793
                                <div class="fa fa-times" id="cerrar_cut_modal"></div>
1794
                            </div>
1795
                            <div class="opcion_editor recortar10">
1796
                                <div>LABEL_CUT</div>
1797
                                <div id="blockCelda"><span class="fa fa-unlock"></span></div>
1798
                            </div>
1799
                        </div>
1800
                    </div>
1801
                </div>
1802
            </div>
1803
            <div class="responsing_text">
1804
                <div class="icon_text"><span class="fa fa-text-width"></span></div>
1805
                <div class="contenido_text">
1806
                    <div class="animated fadeInRight delay-04 fast">
1807
                        <div class="texto">
1808
                            <div class="titulo_text">
1809
                                <div>LABEL_TEXT</div>
1810
                                <div class="fa fa-times" id="cerrar_text_modal"></div>
1811
                            </div>
1812
                            <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
1813
                                    type="number" class="" data-tooltip="Tamaño de la letra" name="" id="font-size" max="500" min="1" step="1" value="48" /></div>
1814
                            <div class="fonts mb-20">
1815
                                <div class="font" id="negritas" data-tooltip="Negritas"><i class="fa fa-bold" aria-hidden="true"></i></div>
1816
                                <div class="font" id="italic" data-tooltip="Letra Cursiva"><i class="fa fa-italic" aria-hidden="true"></i></div>
1817
                                <div class="color_letra font"><label>A</label><input type="color" class="" data-tooltip="Color de la letra" name="" id="color" value="#ffffff" /></div>
1818
                                <div class="font fa" data-tooltip="Sombra de la letra" id="shadow">S</div>
1819
                                <div class="font" id="rectangulo" data-tooltip="Fondo de la letra">
1820
                                    <div class="rectangulo">F</div>
1821
                                </div>
1822
                            </div>
1823
                            <div class="color_fondo_cuadro mb-20" style="display:none"><input type="color" name="" id="colorrect" value="#000000" class="w-25" data-tooltip="Color del fondo" class="mr-2" /><input type="range" id="opacidad" max="100" min="1" step="1" value="100" class="w-75"></div><input id="texto_input"
1824
                                type="text" name="texto" placeholder="LABEL_ADD_TEXT_HERE" /> </div>
1825
                    </div>
1826
                </div>
1827
            </div>
1828
            <div class="responsing_filtros">
1829
                <div class="icon_filter"><span class="fa fa-eyedropper"></span></div>
1830
                <div class="contenido_filter">
1831
                    <div class="titulo_filtro mb-20">
1832
                        <div>LABEL_FILTERS</div>
1833
                        <div class="fa fa-times" id="cerrar_filter_modal"></div>
1834
                    </div>
1835
                    <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>
1836
                </div>
1837
            </div>
1838
            <div class="volver"><span class="icon-undo"></span>LABEL_START_OVER</div>
1839
            <div class="paso_1 paso animated bounceInDown delay-04 fast">1</div>
1840
            <div class="paso_2 a1 animated bounceInDown delay-06 fast">2</div>
1841
            <div class="paso_2 b1 animated bounceInDown delay-08 fast">3</div>
1842
        </div>
1843
    </div>
1844
    <div class="editor_imagenes">
1845
        <div class="fondo_oscuro"></div>
1846
        <div class="editor_imagenes2 ">
1847
            <div>
1848
                <div class="canvas_imagen">
1849
                    <div class="canvas recortar">
10864 nelberth 1850
                        <div class="canvas_subir" id="imagen_noticia">LABEL_DRAG_IMAGE_HERE o seleccione un archivo <input type="file"></div>
10861 nelberth 1851
                    </div>
1852
                </div>
1853
                <div class="botones_dimenciones">
1854
                    <div class="scale">
1855
                        <div class="dimenciones">
1856
                            <div id="ancho">1240px</div>
1857
                            <div>x</div>
1858
                            <div id="alto">720px</div>
1859
                        </div>
1860
                        <div class="porciento">
1861
                            <div id="menos_scale"><span class="icon-minus fa fa-minus"></span></div>
1862
                            <div class="ps">
1863
                                <ul class="cantidades_scale">
1864
                                    <li data-scale="2" class="as">200%</li>
1865
                                    <li data-scale="1" class="as">100%</li>
1866
                                    <li data-scale="0.75" class="as">75%</li>
1867
                                    <li data-scale="0.5" class="as">50%</li>
1868
                                    <li data-scale="0.25" class="as">25%</li>
1869
                                </ul>
1870
                                <div id="porciento_scale">50%</div>
1871
                            </div>
1872
                            <div id="mas_scale"><span class="icon-plus fa fa-plus"></span></div>
1873
                        </div>
1874
                    </div>
1875
                    <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>
1876
                </div>
1877
            </div>
1878
            <div class="modificar animated fadeInRight delay-04 fast">
1879
                <div>
1880
                    <div class="titulo_recortar"><span class="icon-ungroup fa fa-scissors"></span>LABEL_CUT</div>
1881
                    <div class="opcion_editor recortar10">
1882
                        <div class="recortar_texto">LABEL_CUT</div>
1883
                        <div id="blockCelda"><span class="fa fa-unlock"></span></div>
1884
                    </div>
1885
                </div>
1886
                <div class="texto">
1887
                    <div class="mb-20">
1888
                        <div class="titulo_texto "><span class="icon-plus fa fa-text-width"></span>LABEL_TEXT</div>
1889
                    </div>
1890
                    <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>
1891
                    <div class="fonts mb-20">
1892
                        <div class="font" id="negritas" data-tooltip="Negritas"><i class="fa fa-bold" aria-hidden="true"></i></div>
1893
                        <div class="font" id="italic" data-tooltip="Letra Cursiva"><i class="fa fa-italic" aria-hidden="true"></i></div>
1894
                        <div class="color_letra font"><label>A</label><input type="color" class="" data-tooltip="Color de la letra" name="" id="color" value="#ffffff" /></div>
1895
                        <div class="font fa" data-tooltip="Sombra de la letra" id="shadow">S</div>
1896
                        <div class="font" id="rectangulo" data-tooltip="Fondo de la letra">
1897
                            <div class="rectangulo">F</div>
1898
                        </div>
1899
                    </div>
1900
                    <div class="color_fondo_cuadro mb-20" style="display:none"> <input type="color" name="" id="colorrect" value="#000000" class="w-25" data-tooltip="Color del fondo" class="mr-2" /><input type="range" id="opacidad" max="100" min="1" step="1" value="100" class="w-75"></div><input id="texto_input"
1901
                        type="text" name="texto" placeholder="LABEL_ADD_TEXT_HERE" />
1902
                    <div class="mb-20">
1903
                        <div class="titulo_filtro"><span class="icon-eyedropper fa fa-eyedropper"></span>LABEL_FILTERS</div>
1904
                    </div>
1905
                    <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>
1906
                </div>
1907
            </div>
1908
        </div>
1909
    </div>
1910
</div>
1911
<dav class="fixed_noticia"></dav>
1912
<dav class="cuadro_noticias animated bounceInUp delay-04" id="cuadro_noticias">
1913
    <dav class="relative">
1914
        <div class="titulo_topico">LABEL_TITLE_TOPIC</div><canvas class="imagen_noticias" id="imagen_noticias" width="320" height="480"></canvas> </dav>
1915
    <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>
1916
</dav>
10797 nelberth 1917
 
10687 nelberth 1918
 
5747 nelberth 1919
				</div>
5916 nelberth 1920
 
5549 nelberth 1921
 
5462 nelberth 1922
     	      		<?php echo $this->form()->closeTag($form); ?>
1923
      		</div>
1924
 
5463 nelberth 1925
 
4691 nelberth 1926
</section>
1 www 1927
 
5895 nelberth 1928
<section id="topicEdit" style='display:none' class="">
1929
<div class="d-flex justify-content-center tituloEditor">
5912 nelberth 1930
        <h4>LABEL_EDIT_TOPIC</h4>
1 www 1931
 
5895 nelberth 1932
    </div>
1933
	<div class="grid-padre" >
5899 nelberth 1934
					<?php
1935
       			  $form = $this->formEdit;
1 www 1936
            		$form->setAttributes([
5899 nelberth 1937
                        'method'    => 'post',
1938
                        'name'      => 'form-topic-edit',
1939
                        'id'        => 'form-topic-edit'
1 www 1940
                    ]);
1941
 
1942
                    $form->prepare();
1943
                    echo $this->form()->openTag($form);
1944
                    ?>
5895 nelberth 1945
    			<div class="form-group grid-1-2">
1 www 1946
    				<?php
1947
                        $element = $form->get('name');
1948
 
1949
                        $element->setAttributes(['class' => 'form-control']);
1950
                        $element->setOptions(['label' => 'LABEL_NAME']);
1951
                        echo $this->formLabel($element);
1952
                        echo $this->formText($element);
1953
                    ?>
1954
				</div>
5904 nelberth 1955
				<div class="form-group grid-1-2">
1 www 1956
                	<?php
1957
                    $element = $form->get('description');
5904 nelberth 1958
                    $element->setAttributes(['id' => 'description_edit', 'rows' => '2', 'class' => 'form-control',   'class' => 'form-control']);
1 www 1959
                    $element->setOptions(['label' => 'LABEL_DESCRIPTION']);
1960
                    echo $this->formLabel($element);
1961
                    echo $this->formTextArea($element);
1962
                    ?>
1963
   				</div>
5895 nelberth 1964
				<div class="form-group grid-1-2">
1 www 1965
    				<?php
1966
                        $element = $form->get('order');
1967
                        $element->setAttributes(['class' => 'form-control']);
1968
                        $element->setOptions(['label' => 'LABEL_ORDER']);
1969
                        echo $this->formLabel($element);
1970
                        echo $this->formText($element);
1971
                    ?>
1972
				</div>
5895 nelberth 1973
 
1 www 1974
               		<?php
1975
                    $element = $form->get('file');
5990 nelberth 1976
					$element->setAttributes([ 'class' => 'file']);
1977
                    echo $this->formHidden($element);
1978
					?>
5895 nelberth 1979
 
1980
          		<div class="form-group grid-1-2">
1 www 1981
    				<?php
1982
                        $element = $form->get('status');
1983
                        $element->setAttributes(['class' => 'form-control']);
1984
                        $element->setOptions(['label' => 'LABEL_STATUS']);
1985
                        echo $this->formLabel($element);
1986
                        echo $this->formSelect($element);
1987
                    ?>
1988
				</div>
1989
 
5908 nelberth 1990
				<div class="contenido form-group" id="contenido2">
5895 nelberth 1991
				</div>
5981 nelberth 1992
 
1 www 1993
     	      		<?php echo $this->form()->closeTag($form); ?>
1994
      		</div>
1995
 
5895 nelberth 1996
 
1997
</section>
1 www 1998
 
1999
 
2000
 
2001
<!-- The Modal -->
2002
<div class="modal" id="modalImageApp">
2003
	<div class="modal-dialog ">
2004
    	<div class="modal-content">
2005
 
2006
            <!-- Modal Header -->
2007
      		<div class="modal-header">
2008
        		<h4 class="modal-title">LABEL_IMAGE</h4>
2009
        		<button type="button" class="close" data-dismiss="modal">&times;</button>
2010
      		</div>
2011
 
2012
            <!-- Modal body -->
2013
            <div class="modal-body text-center">
2014
				<img src="" class="img img-responsive" style="width: 300px; height: auto" id="image-app" />
2015
      		</div>
2016
 
2017
            <!-- Modal footer -->
2018
      		<div class="modal-footer">
2019
        		<button type="button" class="btn btn-danger" data-dismiss="modal">Cerrar</button>
2020
          	</div>
2021
         </div>
2022
	</div>
2023
</div>
2024
 
2025
 
2026
 
2027
 
2028
 
2029
 
2030
 
2031
 
2032
 
2033