14934 |
stevensc |
1 |
<?php
|
1 |
www |
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 |
|
16822 |
efrain |
16 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/nprogress/nprogress.css'));
|
|
|
17 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/nprogress/nprogress.js'));
|
1 |
www |
18 |
|
16822 |
efrain |
19 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/ckeditor/ckeditor.js'));
|
1 |
www |
20 |
|
|
|
21 |
|
16822 |
efrain |
22 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/bootstrap-fileinput/css/fileinput.min.css'));
|
|
|
23 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/bootstrap-fileinput/themes/explorer-fas/theme.css'));
|
1 |
www |
24 |
|
16843 |
efrain |
25 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/js/plugins/piexif.js'));
|
|
|
26 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/js/plugins/sortable.js'));
|
16822 |
efrain |
27 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/js/fileinput.js'));
|
|
|
28 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/js/locales/es.js'));
|
|
|
29 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/themes/fas/theme.js'));
|
|
|
30 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap-fileinput/themes/explorer-fas/theme.js'));
|
1 |
www |
31 |
|
|
|
32 |
|
16822 |
efrain |
33 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/jquery-validation/jquery.validate.js'));
|
|
|
34 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/jquery-validation/additional-methods.js'));
|
|
|
35 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/jquery-validation/localization/messages_es.js'));
|
1 |
www |
36 |
|
16822 |
efrain |
37 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/datatables.net-bs5/dataTables.bootstrap5.css'));
|
|
|
38 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/datatables.net-bs5-responsive/responsive.bootstrap5.css'));
|
|
|
39 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/nelberth-editor/style.css'));
|
|
|
40 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net/jquery.dataTables.js'));
|
|
|
41 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net-bs5/dataTables.bootstrap5.js'));
|
|
|
42 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net-bs5-responsive/dataTables.responsive.min.js'));
|
|
|
43 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/datatables.net-bs5-responsive/responsive.bootstrap5.min.js'));
|
1 |
www |
44 |
|
|
|
45 |
|
16822 |
efrain |
46 |
$this->headLink()->appendStylesheet($this->basePath('assets/vendors/bootstrap4-toggle/css/bootstrap4-toggle.min.css'));
|
|
|
47 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/bootstrap4-toggle/js/bootstrap4-toggle.min.js'));
|
1 |
www |
48 |
|
|
|
49 |
|
|
|
50 |
|
|
|
51 |
|
|
|
52 |
|
16822 |
efrain |
53 |
$this->inlineScript()->appendFile($this->basePath('assets/vendors/jquery-input-number/input-number-format.jquery.js'));
|
|
|
54 |
|
|
|
55 |
|
1 |
www |
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();
|
16822 |
efrain |
173 |
|
1 |
www |
174 |
},
|
|
|
175 |
'aoColumns': [
|
|
|
176 |
{ 'mDataProp': 'name' },
|
|
|
177 |
{ 'mDataProp': 'status' },
|
|
|
178 |
{ 'mDataProp': 'image' },
|
|
|
179 |
{ 'mDataProp': 'actions' },
|
|
|
180 |
],
|
|
|
181 |
'columnDefs': [
|
|
|
182 |
{
|
|
|
183 |
'targets': 0,
|
|
|
184 |
'className' : 'text-vertical-middle',
|
|
|
185 |
},
|
|
|
186 |
{
|
|
|
187 |
'targets': -2,
|
|
|
188 |
'orderable': false,
|
|
|
189 |
'render' : function ( data, type, row ) {
|
|
|
190 |
s = ' ';
|
|
|
191 |
|
|
|
192 |
if( data ) {
|
|
|
193 |
s = s + ' <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;" /> '
|
|
|
194 |
} else {
|
|
|
195 |
s = s + ' LABEL_IMAGE: <br>';
|
|
|
196 |
}
|
|
|
197 |
|
|
|
198 |
|
|
|
199 |
return s;
|
|
|
200 |
}
|
|
|
201 |
},
|
|
|
202 |
|
|
|
203 |
|
|
|
204 |
{
|
|
|
205 |
'targets': -1,
|
|
|
206 |
'orderable': false,
|
|
|
207 |
'render' : function ( data, type, row ) {
|
|
|
208 |
s = '';
|
|
|
209 |
|
|
|
210 |
if(allowEdit && data['link_edit'] ) {
|
|
|
211 |
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> ';
|
|
|
212 |
}
|
|
|
213 |
if(allowDelete && data['link_delete'] ) {
|
|
|
214 |
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> ';
|
|
|
215 |
}
|
|
|
216 |
return s;
|
|
|
217 |
}
|
|
|
218 |
}
|
|
|
219 |
],
|
|
|
220 |
});
|
|
|
221 |
|
|
|
222 |
|
|
|
223 |
var validatorAdd = $('#form-topic-add').validate({
|
|
|
224 |
debug: true,
|
|
|
225 |
onclick: false,
|
|
|
226 |
onkeyup: false,
|
|
|
227 |
ignore: [],
|
|
|
228 |
rules: {
|
|
|
229 |
'name': {
|
|
|
230 |
required: true,
|
|
|
231 |
maxlength: 128,
|
|
|
232 |
},
|
|
|
233 |
'description': {
|
|
|
234 |
updateCkeditor:function() {
|
|
|
235 |
CKEDITOR.instances.description_add.updateElement();
|
|
|
236 |
},
|
|
|
237 |
required: true
|
|
|
238 |
},
|
|
|
239 |
'file': {
|
|
|
240 |
required: true,
|
|
|
241 |
},
|
|
|
242 |
'order' : {
|
|
|
243 |
required: true,
|
|
|
244 |
digits: true,
|
|
|
245 |
min: 1,
|
|
|
246 |
max: 250
|
|
|
247 |
},
|
|
|
248 |
'status' : {
|
|
|
249 |
required: true,
|
|
|
250 |
},
|
|
|
251 |
},
|
|
|
252 |
submitHandler: function(form)
|
|
|
253 |
{
|
|
|
254 |
var formdata = false;
|
|
|
255 |
if (window.FormData){
|
|
|
256 |
formdata = new FormData(form); //form[0]);
|
|
|
257 |
}
|
5709 |
nelberth |
258 |
|
|
|
259 |
|
|
|
260 |
$('.info_noticia').prop('disabled', true);
|
5703 |
nelberth |
261 |
NProgress.start();
|
1 |
www |
262 |
$.ajax({
|
|
|
263 |
'dataType' : 'json',
|
|
|
264 |
'accept' : 'application/json',
|
|
|
265 |
'method' : 'post',
|
|
|
266 |
'url' : $('#form-topic-add').attr('action'),
|
|
|
267 |
'data' : formdata,
|
|
|
268 |
'processData': false,
|
|
|
269 |
'contentType': false,
|
|
|
270 |
}).done(function(response) {
|
5542 |
nelberth |
271 |
console.log(response)
|
|
|
272 |
if(response['success']) {
|
1 |
www |
273 |
$.fn.showSuccess(response['data']);
|
5708 |
nelberth |
274 |
$('body, html').animate({scrollTop: '0px'}, 300);
|
5703 |
nelberth |
275 |
$('#content1').css('display','block');
|
|
|
276 |
$('#addImage').css('display','none');
|
1 |
www |
277 |
gridTable.api().ajax.reload(null, false);
|
|
|
278 |
} else {
|
|
|
279 |
validatorAdd.resetForm();
|
|
|
280 |
if(jQuery.type(response['data']) == 'string') {
|
|
|
281 |
$.fn.showError(response['data']);
|
|
|
282 |
} else {
|
|
|
283 |
$.each(response['data'], function( fieldname, errors ) {
|
|
|
284 |
$.fn.showFormErrorValidator('#form-topic-add #' + fieldname, errors);
|
|
|
285 |
});
|
|
|
286 |
}
|
|
|
287 |
}
|
|
|
288 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
5709 |
nelberth |
289 |
|
5575 |
nelberth |
290 |
console.log(jqXHR)
|
1 |
www |
291 |
$.fn.showError(textStatus);
|
|
|
292 |
}).always(function() {
|
5709 |
nelberth |
293 |
$('.info_noticia').prop('disabled', false);
|
1 |
www |
294 |
NProgress.done();
|
|
|
295 |
});
|
|
|
296 |
return false;
|
|
|
297 |
},
|
|
|
298 |
invalidHandler: function(form, validator) {
|
|
|
299 |
|
|
|
300 |
}
|
|
|
301 |
});
|
|
|
302 |
|
|
|
303 |
var validatorEdit = $('#form-topic-edit').validate({
|
|
|
304 |
debug: true,
|
|
|
305 |
onclick: false,
|
|
|
306 |
onkeyup: false,
|
|
|
307 |
ignore: [],
|
|
|
308 |
rules: {
|
|
|
309 |
'name': {
|
|
|
310 |
required: true,
|
|
|
311 |
maxlength: 128,
|
|
|
312 |
},
|
|
|
313 |
'description': {
|
|
|
314 |
updateCkeditor:function() {
|
|
|
315 |
CKEDITOR.instances.description_edit.updateElement();
|
|
|
316 |
},
|
|
|
317 |
required: true
|
|
|
318 |
},
|
|
|
319 |
'file': {
|
5982 |
nelberth |
320 |
required: true,
|
1 |
www |
321 |
},
|
|
|
322 |
'order' : {
|
|
|
323 |
required: true,
|
|
|
324 |
digits: true,
|
|
|
325 |
min: 1,
|
|
|
326 |
max: 250
|
|
|
327 |
},
|
|
|
328 |
'status' : {
|
|
|
329 |
required: true,
|
|
|
330 |
},
|
|
|
331 |
|
|
|
332 |
},
|
|
|
333 |
submitHandler: function(form)
|
|
|
334 |
{
|
|
|
335 |
var formdata = false;
|
|
|
336 |
if (window.FormData){
|
|
|
337 |
formdata = new FormData(form); //form[0]);
|
|
|
338 |
}
|
|
|
339 |
|
7060 |
nelberth |
340 |
$('.info_noticia').prop('disabled', true);
|
5982 |
nelberth |
341 |
NProgress.start();
|
1 |
www |
342 |
$.ajax({
|
|
|
343 |
'dataType' : 'json',
|
|
|
344 |
'accept' : 'application/json',
|
|
|
345 |
'method' : 'post',
|
|
|
346 |
'url' : $('#form-topic-edit').attr('action'),
|
|
|
347 |
'data' : formdata,
|
|
|
348 |
'processData': false,
|
|
|
349 |
'contentType': false,
|
|
|
350 |
}).done(function(response) {
|
|
|
351 |
if(response['success']) {
|
|
|
352 |
$.fn.showSuccess(response['data']);
|
|
|
353 |
|
5994 |
nelberth |
354 |
$('body, html').animate({scrollTop: '0px'}, 300);
|
5898 |
nelberth |
355 |
$('#content1').css('display','block');
|
|
|
356 |
$('#topicEdit').css('display','none');
|
1 |
www |
357 |
gridTable.api().ajax.reload(null, false);
|
|
|
358 |
} else {
|
|
|
359 |
validatorAdd.resetForm();
|
|
|
360 |
if(jQuery.type(response['data']) == 'string') {
|
|
|
361 |
$.fn.showError(response['data']);
|
|
|
362 |
} else {
|
|
|
363 |
$.each(response['data'], function( fieldname, errors ) {
|
|
|
364 |
$.fn.showFormErrorValidator('#form-topic-edit #' + fieldname, errors);
|
|
|
365 |
});
|
|
|
366 |
}
|
|
|
367 |
}
|
|
|
368 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
369 |
$.fn.showError(textStatus);
|
|
|
370 |
}).always(function() {
|
7060 |
nelberth |
371 |
|
|
|
372 |
$('.info_noticia').prop('disabled', false);
|
1 |
www |
373 |
NProgress.done();
|
|
|
374 |
});
|
|
|
375 |
return false;
|
|
|
376 |
},
|
|
|
377 |
invalidHandler: function(form, validator) {
|
|
|
378 |
|
|
|
379 |
}
|
|
|
380 |
});
|
|
|
381 |
|
16822 |
efrain |
382 |
$('body').on('click', 'button.btn-delete', function(e) {
|
|
|
383 |
e.preventDefault();
|
|
|
384 |
var action = $(this).data('href');
|
1 |
www |
385 |
|
16822 |
efrain |
386 |
|
|
|
387 |
swal.fire({
|
|
|
388 |
title: 'LABEL_ARE_YOU_SURE',
|
|
|
389 |
icon: 'question',
|
|
|
390 |
cancelButtonText: 'LABEL_NO',
|
|
|
391 |
showCancelButton: true,
|
|
|
392 |
confirmButtonText: 'LABEL_YES'
|
|
|
393 |
}).then((result) => {
|
|
|
394 |
if (result.isConfirmed) {
|
|
|
395 |
|
|
|
396 |
NProgress.start();
|
|
|
397 |
$.ajax({
|
|
|
398 |
'dataType' : 'json',
|
|
|
399 |
'accept' : 'application/json',
|
|
|
400 |
'method' : 'post',
|
|
|
401 |
'url' : action,
|
|
|
402 |
}).done(function(response) {
|
|
|
403 |
if(response['success']) {
|
|
|
404 |
$.fn.showSuccess(response['data']);
|
|
|
405 |
gridTable.api().ajax.reload(null, false);
|
|
|
406 |
} else {
|
|
|
407 |
$.fn.showError(response['data']);
|
|
|
408 |
}
|
|
|
409 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
410 |
$.fn.showError(textStatus);
|
|
|
411 |
}).always(function() {
|
|
|
412 |
NProgress.done();
|
|
|
413 |
});
|
|
|
414 |
}
|
|
|
415 |
});
|
|
|
416 |
});
|
|
|
417 |
|
1 |
www |
418 |
|
|
|
419 |
$('body').on('click', '.btn-view-image-app', function(e) {
|
|
|
420 |
e.preventDefault();
|
|
|
421 |
|
|
|
422 |
$('#image-app').attr('src', $(this).data('href'));
|
|
|
423 |
$('#modalImageApp').modal('show');
|
|
|
424 |
return false;
|
|
|
425 |
});
|
|
|
426 |
|
|
|
427 |
$('#form-topic-add #order').inputNumberFormat({decimal: 0});
|
5741 |
nelberth |
428 |
|
1 |
www |
429 |
|
|
|
430 |
|
|
|
431 |
$('body').on('click', 'button.btn-add', function(e) {
|
|
|
432 |
e.preventDefault();
|
6015 |
nelberth |
433 |
|
1 |
www |
434 |
$('#form-topic-add #name').val('');
|
|
|
435 |
$('#form-topic-add #order').val('1');
|
5536 |
nelberth |
436 |
$('#form-topic-add #name').val('');
|
1 |
www |
437 |
|
|
|
438 |
$('#form-topic-add #status').val('');
|
|
|
439 |
|
|
|
440 |
|
|
|
441 |
CKEDITOR.instances.description_add.setData('');
|
|
|
442 |
validatorAdd.resetForm();
|
4693 |
nelberth |
443 |
$('#content1').css('display','none');
|
|
|
444 |
$('#addImage').css('display','block');
|
4829 |
nelberth |
445 |
iniciarEditor()
|
4693 |
nelberth |
446 |
|
1 |
www |
447 |
return false;
|
|
|
448 |
});
|
5646 |
nelberth |
449 |
$('body').on('click', '#ir_atras', function(e) {
|
|
|
450 |
e.preventDefault();
|
|
|
451 |
|
|
|
452 |
|
5710 |
nelberth |
453 |
$('body, html').animate({scrollTop: '0px'}, 300);
|
5646 |
nelberth |
454 |
$('#content1').css('display','block');
|
|
|
455 |
$('#addImage').css('display','none');
|
5910 |
nelberth |
456 |
$('#topicEdit').css('display','none');
|
1 |
www |
457 |
|
5646 |
nelberth |
458 |
|
|
|
459 |
return false;
|
|
|
460 |
});
|
|
|
461 |
|
1 |
www |
462 |
|
|
|
463 |
$('#form-topic-edit #order').inputNumberFormat({decimal: 0});
|
|
|
464 |
|
5902 |
nelberth |
465 |
/* $('#form-topic-edit #file').fileinput({
|
1 |
www |
466 |
theme: 'fas',
|
|
|
467 |
language: 'es',
|
|
|
468 |
showUpload: false,
|
|
|
469 |
dropZoneEnabled: false,
|
|
|
470 |
maxFileCount: 1,
|
|
|
471 |
allowedFileExtensions: ['jpeg', 'jpg', 'png'],
|
|
|
472 |
msgPlaceholder: 'LABEL_RECOMMENDED_SIZE $image_size',
|
5902 |
nelberth |
473 |
});*/
|
1 |
www |
474 |
|
8591 |
nelberth |
475 |
|
1 |
www |
476 |
$('body').on('click', 'button.btn-edit', function(e) {
|
|
|
477 |
e.preventDefault();
|
6015 |
nelberth |
478 |
|
1 |
www |
479 |
var url = $(this).data('href');
|
5900 |
nelberth |
480 |
NProgress.start();
|
1 |
www |
481 |
$.ajax({
|
|
|
482 |
'dataType' : 'json',
|
|
|
483 |
'accept' : 'application/json',
|
|
|
484 |
'method' : 'get',
|
|
|
485 |
'url' : url,
|
|
|
486 |
}).done(function(response) {
|
|
|
487 |
if(response['success']) {
|
5913 |
nelberth |
488 |
console.log(response['data'])
|
1 |
www |
489 |
$('#form-topic-edit')[0].reset();
|
|
|
490 |
|
|
|
491 |
$('#form-topic-edit').attr('action',url);
|
6078 |
nelberth |
492 |
$('#form-topic-edit #name').val(response['data']['name']);
|
1 |
www |
493 |
$('#form-topic-edit #order').val(response['data']['order']);
|
|
|
494 |
|
5919 |
nelberth |
495 |
$('#form-topic-edit #status').val(response['data']['status']);
|
1 |
www |
496 |
|
|
|
497 |
CKEDITOR.instances.description_edit.setData(response['data']['description']);
|
|
|
498 |
validatorEdit.resetForm();
|
5898 |
nelberth |
499 |
$('#content1').css('display','none');
|
|
|
500 |
$('#topicEdit').css('display','block');
|
6015 |
nelberth |
501 |
iniciarEditor(false,response['data']['image']);
|
1 |
www |
502 |
} else {
|
|
|
503 |
validatorEdit.resetForm();
|
|
|
504 |
if(jQuery.type(response['data']) == 'string') {
|
|
|
505 |
$.fn.showError(response['data']);
|
|
|
506 |
} else {
|
|
|
507 |
$.each(response['data'], function( fieldname, errors ) {
|
|
|
508 |
$.fn.showFormErrorValidator('#form-topic-edit #' + fieldname, errors);
|
|
|
509 |
});
|
|
|
510 |
}
|
|
|
511 |
}
|
|
|
512 |
}).fail(function( jqXHR, textStatus, errorThrown) {
|
|
|
513 |
$.fn.showError(textStatus);
|
|
|
514 |
}).always(function() {
|
|
|
515 |
NProgress.done();
|
|
|
516 |
});
|
|
|
517 |
});
|
|
|
518 |
|
|
|
519 |
$('body').on('click', 'button.btn-cancel', function(e) {
|
|
|
520 |
e.preventDefault();
|
|
|
521 |
$('#modalTopicAdd').modal('hide');
|
5895 |
nelberth |
522 |
$('#topicEdit').modal('hide');
|
1 |
www |
523 |
});
|
|
|
524 |
|
|
|
525 |
$('body').on('click', 'button.btn-refresh', function(e) {
|
|
|
526 |
e.preventDefault();
|
|
|
527 |
gridTable.api().ajax.reload(null, false);
|
|
|
528 |
});
|
|
|
529 |
|
8290 |
stevensc |
530 |
CKEDITOR.replace('description_add', {
|
|
|
531 |
toolbar: [
|
|
|
532 |
{ name: 'editing', items: ['Scayt'] },
|
|
|
533 |
{ name: 'links', items: ['Link', 'Unlink'] },
|
|
|
534 |
{ name: 'paragraph', items: ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote'] },
|
|
|
535 |
{ name: 'basicstyles', items: ['Bold', 'Italic', 'Strike', 'RemoveFormat'] },
|
|
|
536 |
'/',
|
|
|
537 |
{ name: 'insert', items: ['Image', 'Table', 'HorizontalRule', 'SpecialChar'] },
|
|
|
538 |
{ name: 'styles', items: ['Styles', 'Format'] },
|
|
|
539 |
{ name: 'tools', items: ['Maximize'] }
|
|
|
540 |
],
|
|
|
541 |
removePlugins: 'elementspath,Anchor',
|
|
|
542 |
heigth: 100
|
|
|
543 |
});
|
|
|
544 |
CKEDITOR.replace('description_edit', {
|
|
|
545 |
toolbar: [
|
|
|
546 |
{ name: 'editing', items: ['Scayt'] },
|
|
|
547 |
{ name: 'links', items: ['Link', 'Unlink'] },
|
|
|
548 |
{ name: 'paragraph', items: ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote'] },
|
|
|
549 |
{ name: 'basicstyles', items: ['Bold', 'Italic', 'Strike', 'RemoveFormat'] },
|
|
|
550 |
'/',
|
|
|
551 |
{ name: 'insert', items: ['Image', 'Table', 'HorizontalRule', 'SpecialChar'] },
|
|
|
552 |
{ name: 'styles', items: ['Styles', 'Format'] },
|
|
|
553 |
{ name: 'tools', items: ['Maximize'] }
|
|
|
554 |
],
|
|
|
555 |
removePlugins: 'elementspath,Anchor',
|
|
|
556 |
heigth: 100
|
|
|
557 |
});
|
1 |
www |
558 |
|
4798 |
nelberth |
559 |
|
|
|
560 |
|
|
|
561 |
/*Script del editor (Aqui comienza el cielo y la tierra) */
|
4803 |
nelberth |
562 |
var imagenServidorNoticia;
|
|
|
563 |
var scroll_altura,viente;
|
|
|
564 |
var nombre_user = $(".perfil_u_nombre").text();
|
|
|
565 |
var primer_nombre = nombre_user.split(" ")[0];
|
11026 |
nelberth |
566 |
var nuevoHtmlImagen='<div class="articulo_noticia animated fadeIn"> <div class="pasos"> <div class="titulo_pasos animated fadeInDown delay-04 fast">LABEL_STEP_1</div><div class="paso_opcion"> <div class="responsing_cut"> <div class="icon_cut"><span class="fa fa-scissors"></span></div><div class="contenido_cut"> <div class="animated fadeInRight delay-04 fast"> <div> <div class="titulo_cut"> <div>LABEL_CUT</div><div class="fa fa-times" id="cerrar_cut_modal"></div></div><div class="opcion_editor recortar10"> <div class="recortar_texto">LABEL_CUT</div><div id="blockCelda"><span class="fa fa-unlock"></span></div></div></div></div></div></div><div class="responsing_text"> <div class="icon_text"><span class="fa fa-text-width"></span></div><div class="contenido_text"> <div class="animated fadeInRight delay-04 fast"> <div class="texto"> <div class="titulo_text"> <div>LABEL_TEXT</div><div class="fa fa-times" id="cerrar_text_modal"></div></div><div class="fonts mb-20"><select name="fuentes" id="selectFuente" class="select-custom mr-2"><option value="arial" selected>LABEL_FONT_ARIAL</option><option value="calibri">LABEL_FONT_CALIBRI</option><option value="forte">LABEL_FONT_FORTE</option><option value="impact">LABEL_FONT_IMPACT</option><option value="jokerman">LABEL_FONT_JOKERMAN</option><option value="mv boli">LABEL_FONT_MV_BOLI</option><option value="times new roman">LABEL_FONT_TIMES_NEW_ROMAN</option><option value="verdana">LABEL_FONT_VERDANA</option><option value="vivaldi">LABEL_FONT_VIVALDI</option></select><input type="number" class="" data-tooltip="Tamaño de la letra" name="" id="font-size" max="500" min="1" step="1" value="48"/></div><div class="fonts mb-20"> <div class="font" id="negritas" data-tooltip="Negritas"><i class="fa fa-bold" aria-hidden="true"></i></div><div class="font" id="italic" data-tooltip="Letra Cursiva"><i class="fa fa-italic" aria-hidden="true"></i></div><div class="color_letra font"><label>A</label><input type="color" class="" data-tooltip="Color de la letra" name="" id="color" value="#ffffff"/></div><div class="font fa" data-tooltip="Sombra de la letra" id="shadow">S</div><div class="font" id="rectangulo" data-tooltip="Fondo de la letra"> <div class="rectangulo">F</div></div></div><div class="color_fondo_cuadro mb-20 flex-column" style="display:none"> <div class="w-100 d-flex justify-content-between border-bottom"><label for="colorrect" class="font-weight-normal d-flex align-items-center" style="margin:0 !important">LABEL_COLOR_BACKGROUND: </label><input type="color" name="" id="colorrect" value="#000000" style="width:30px" data-tooltip="Color del fondo" class="mr-2"/></div><div class="d-flex flex-column"><label for="opacidad" class="font-weight-normal mt-2">LABEL_BACKGROUND_TRANSPARENCY</label><input type="range" id="opacidad" max="100" min="1" step="1" value="100" ></div></div><input id="texto_input" type="text" name="texto" placeholder="LABEL_ADD_TEXT_HERE"/> </div></div></div></div><div class="responsing_filtros"> <div class="icon_filter"><span class="fa fa-eyedropper"></span></div><div class="contenido_filter"> <div class="titulo_filtro mb-20"> <div>LABEL_FILTERS</div><div class="fa fa-times" id="cerrar_filter_modal"></div></div><div class="fonts mb-20"> <select name="filtros" id="selectFiltro" class="select-custom"><option class="opcion_editor" value="normal">LABEL_FILTER_NORMAL</option><option class="opcion_editor" value=".5,1.3,1.31,1.33,1.38">LABEL_FILTER_NIGHT</option><option class="opcion_editor" value=".7,1.1,1.64,1.66,1.50">LABEL_FILTER_SAINT_ANA</option><option class="opcion_editor" value=".75,1,1.66,1.60,1.51">LABEL_FILTER_CREAM</option><option class="opcion_editor" value=".7,1.2,1.49,1.49,1.6">LABEL_FILTER_MAGIC</option><option class="opcion_editor" value=".7,1.2,1.60,1.66,1.58">LABEL_FILTER_RELIEF</option><option class="opcion_editor" value=".9,.9,1.45,1.54,1.54">LABEL_FILTER_LIGHT</option><option class="opcion_editor" value="1,1.5,1,1,1">LABEL_FILTER_SATURATION</option><option class="opcion_editor" value=".9,1.3,1,1,1">LABEL_FILTER_RETOUCH</option><option class="opcion_editor" value=".8,1,1.6,1.45,1.49">LABEL_FILTER_ORANGE</option><option class="opcion_editor" value=".8,.75,1.60,1.66,1.58">LABEL_FILTER_WIND</option><option class="opcion_editor" value=".8,.9,1.66,1.43,1.28">LABEL_FILTER_DESERT</option><option class="opcion_editor" value=".85,.75,1.47,1.66,1.54">LABEL_FILTER_FOREST</option><option class="opcion_editor" value=".8,.8,1.71,1.64,1.58">LABEL_FILTER_TOWN</option><option class="opcion_editor" value=".8,1.2,1.24,.99,1">LABEL_FILTER_PINK</option><option class="opcion_editor" value=".9,1.1,1.33,1.19,.91">LABEL_FILTER_HISTORY</option><option class="opcion_editor" value="1,1,gris">LABEL_FILTER_GRAY</option><option class="opcion_editor" value=".8,1.5,gris">LABEL_FILTER_OLD_PICTURE</option><option class="opcion_editor" value=".9,1.2,26,-12,0,2">LABEL_FILTER_CHARMING</option><option class="opcion_editor" value="1.1,1.4,40,12,-6,2">LABEL_FILTER_EMOTION</option><option class="opcion_editor" value=".9,1.32,56,47,17,2">LABEL_FILTER_BEIGE</option><option class="opcion_editor" value=".87,1.19,55,37,23,2">LABEL_FILTER_FINE</option><option class="opcion_editor" value="1.2,.9,67,13,-23,2">LABEL_FILTER_LORD</option><option class="opcion_editor" value="1.2,1.2,35,7,18,2">LABEL_FILTER_70S</option><option class="opcion_editor" value=".92,1.23,-11,11,11,2">LABEL_FILTER_TREE</option><option class="opcion_editor" value=" 1,1.4,-3,-1,-12,2">LABEL_FILTER_SUMMER</option><option class="opcion_editor" value=".85,1.26,-15,2,-1,2">LABEL_FILTER_COLD_WEATHER</option><option class="opcion_editor" value="1,1.4,5,12,1,2">LABEL_FILTER_ANGELS</option><option class="opcion_editor" value=".9,1.2,43,-17,-55,2">LABEL_FILTER_HOT</option><option class="opcion_editor" value="1,1.29,29,26,17,2">LABEL_FILTER_FALL</option><option class="opcion_editor" value=".85,1.3,43,25,-11,2">LABEL_FILTER_MARCH</option><option class="opcion_editor" value=".8,1.25,31,41,12,2">LABEL_FILTER_PEAR</option><option class="opcion_editor" value="1,1.36,4,5,1,2">LABEL_FILTER_COMMON</option><option class="opcion_editor" value=".9,1.3,37,-25,1,2">LABEL_FILTER_GOLD</option><option class="opcion_editor" value="1.1,1.3,-47,-42,-30,2">LABEL_FILTER_GOTHIC</option><option class="opcion_editor" value="1,1.4,-5,42,11,2">LABEL_FILTER_FORESTRY</option><option class="opcion_editor" value=".9,1.2,-5,-7,4,2">LABEL_FILTER_MOON</option><option class="opcion_editor" value="1.1,1.3,-1,-1,26,2">LABEL_FILTER_PARTY</option> </select> </div></div></div><div class="volver"><span class="icon-undo"></span>LABEL_START_OVER</div><div class="paso_1 paso animated bounceInDown delay-04 fast">1</div><div class="paso_2 a1 animated bounceInDown delay-06 fast">2</div><div class="paso_2 b1 animated bounceInDown delay-08 fast">3</div></div></div><div class="editor_imagenes"> <div class="fondo_oscuro"></div><div class="editor_imagenes2 "> <div> <div class="canvas_imagen"> <div class="canvas recortar"> <div class="canvas_subir d-flex flex-column" id="imagen_noticia"><div>LABEL_DRAG_IMAGE_HERE_OR </div><label class="font-weight-normal mt-2" style="font-size:0.6em"for="imagen_noticia_file"> LABEL_UPLOAD_FILE_IMAGE <div class="ml-2 btn btn-primary btn-sm">LABEL_SELECT_IMAGE</div></label> <input style="display:none" type="file" id="imagen_noticia_file" accept="image/x-png,image/jpeg"></div></div></div><div class="botones_dimenciones"> <div class="scale"> <div class="dimenciones"> <div id="ancho">1240px</div><div>x</div><div id="alto">720px</div></div><div class="porciento"> <div id="menos_scale"><span class="icon-minus fa fa-minus"></span></div><div class="ps"> <ul class="cantidades_scale"> <li data-scale="2" class="as">200%</li><li data-scale="1" class="as">100%</li><li data-scale="0.75" class="as">75%</li><li data-scale="0.5" class="as">50%</li><li data-scale="0.25" class="as">25%</li></ul> <div id="porciento_scale">50%</div></div><div id="mas_scale"><span class="icon-plus fa fa-plus"></span></div></div></div><div class="botones"><button class="boton_normal" id="ir_atras">LABEL_GO_BACK</button><button class="boton_normal" id="boton_recortar">LABEL_DATATABLE_SNEXT</button></div></div></div><div class="modificar animated fadeInRight delay-04 fast escalar"> <div> <div class="titulo_recortar"><span class="icon-ungroup fa fa-scissors mb-20"></span>LABEL_CUT</div><div class="opcion_editor recortar10"> <div class="recortar_texto">LABEL_CUT</div><div id="blockCelda"><span class="fa fa-unlock"></span></div></div></div><div class="texto"> <div class="mb-20"> <div class="titulo_texto "><span class="icon-plus fa fa-text-width"></span>LABEL_TEXT</div></div><div class="fonts mb-20"> <select name="fuentes" id="selectFuente" class="select-custom mr-2"> <option value="arial" selected>LABEL_FONT_ARIAL</option> <option value="calibri">LABEL_FONT_CALIBRI</option> <option value="forte">LABEL_FONT_FORTE</option> <option value="impact">LABEL_FONT_IMPACT</option> <option value="jokerman">LABEL_FONT_JOKERMAN</option> <option value="mv boli">LABEL_FONT_MV_BOLI</option> <option value="times new roman">LABEL_FONT_TIMES_NEW_ROMAN</option> <option value="verdana">LABEL_FONT_VERDANA</option> <option value="vivaldi">LABEL_FONT_VIVALDI</option> </select> <input type="number" class="" data-tooltip="Tamaño de la letra" name="" id="font-size" max="500" min="1" step="1" value="48"/> </div><div class="fonts mb-20"> <div class="font" id="negritas" data-tooltip="Negritas"><i class="fa fa-bold" aria-hidden="true"></i></div><div class="font" id="italic" data-tooltip="Letra Cursiva"><i class="fa fa-italic" aria-hidden="true"></i></div><div class="color_letra font"><label>A</label><input type="color" class="" data-tooltip="Color de la letra" name="" id="color" value="#ffffff"/></div><div class="font fa" data-tooltip="Sombra de la letra" id="shadow">S</div><div class="font" id="rectangulo" data-tooltip="Fondo de la letra"> <div class="rectangulo">F</div></div></div><div class="color_fondo_cuadro mb-20 flex-column" style="display:none"> <div class="w-100 d-flex justify-content-between border-bottom"><label for="colorrect" class="font-weight-normal d-flex align-items-center" style="margin:0 !important">LABEL_COLOR_BACKGROUND: </label><input type="color" name="" id="colorrect" value="#000000" style="width:30px" data-tooltip="Color del fondo" class="mr-2"/></div><div class="d-flex flex-column"><label for="opacidad" class="font-weight-normal mt-2">LABEL_BACKGROUND_TRANSPARENCY</label><input type="range" id="opacidad" max="100" min="1" step="1" value="100" ></div></div><input id="texto_input" type="text" name="texto" placeholder="LABEL_ADD_TEXT_HERE"/> <div class="mb-20"> <div class="titulo_filtro"><span class="icon-eyedropper fa fa-eyedropper"></span>LABEL_FILTERS</div></div><div class="fonts mb-20"> <select name="filtros" id="selectFiltro" class="select-custom selectFiltro"><option class="opcion_editor" value="normal" >LABEL_FILTER_NORMAL</option><option class="opcion_editor" value=".5,1.3,1.31,1.33,1.38">LABEL_FILTER_NIGHT</option><option class="opcion_editor" value=".7,1.1,1.64,1.66,1.50">LABEL_FILTER_SAINT_ANA</option><option class="opcion_editor" value=".75,1,1.66,1.60,1.51">LABEL_FILTER_CREAM</option><option class="opcion_editor" value=".7,1.2,1.49,1.49,1.6">LABEL_FILTER_MAGIC</option><option class="opcion_editor" value=".7,1.2,1.60,1.66,1.58">LABEL_FILTER_RELIEF</option><option class="opcion_editor" value=".9,.9,1.45,1.54,1.54">LABEL_FILTER_LIGHT</option><option class="opcion_editor" value="1,1.5,1,1,1">LABEL_FILTER_SATURATION</option><option class="opcion_editor" value=".9,1.3,1,1,1">LABEL_FILTER_RETOUCH</option><option class="opcion_editor" value=".8,1,1.6,1.45,1.49">LABEL_FILTER_ORANGE</option><option class="opcion_editor" value=".8,.75,1.60,1.66,1.58">LABEL_FILTER_WIND</option><option class="opcion_editor" value=".8,.9,1.66,1.43,1.28">LABEL_FILTER_DESERT</option><option class="opcion_editor" value=".85,.75,1.47,1.66,1.54">LABEL_FILTER_FOREST</option><option class="opcion_editor" value=".8,.8,1.71,1.64,1.58">LABEL_FILTER_TOWN</option><option class="opcion_editor" value=".8,1.2,1.24,.99,1">LABEL_FILTER_PINK</option><option class="opcion_editor" value=".9,1.1,1.33,1.19,.91">LABEL_FILTER_HISTORY</option><option class="opcion_editor" value="1,1,gris">LABEL_FILTER_GRAY</option><option class="opcion_editor" value=".8,1.5,gris">LABEL_FILTER_OLD_PICTURE</option><option class="opcion_editor" value=".9,1.2,26,-12,0,2">LABEL_FILTER_CHARMING</option><option class="opcion_editor" value="1.1,1.4,40,12,-6,2">LABEL_FILTER_EMOTION</option><option class="opcion_editor" value=".9,1.32,56,47,17,2">LABEL_FILTER_BEIGE</option><option class="opcion_editor" value=".87,1.19,55,37,23,2">LABEL_FILTER_FINE</option><option class="opcion_editor" value="1.2,.9,67,13,-23,2">LABEL_FILTER_LORD</option><option class="opcion_editor" value="1.2,1.2,35,7,18,2">LABEL_FILTER_70S</option><option class="opcion_editor" value=".92,1.23,-11,11,11,2">LABEL_FILTER_TREE</option><option class="opcion_editor" value=" 1,1.4,-3,-1,-12,2">LABEL_FILTER_SUMMER</option><option class="opcion_editor" value=".85,1.26,-15,2,-1,2">LABEL_FILTER_COLD_WEATHER</option><option class="opcion_editor" value="1,1.4,5,12,1,2">LABEL_FILTER_ANGELS</option><option class="opcion_editor" value=".9,1.2,43,-17,-55,2">LABEL_FILTER_HOT</option><option class="opcion_editor" value="1,1.29,29,26,17,2">LABEL_FILTER_FALL</option><option class="opcion_editor" value=".85,1.3,43,25,-11,2">LABEL_FILTER_MARCH</option><option class="opcion_editor" value=".8,1.25,31,41,12,2">LABEL_FILTER_PEAR</option><option class="opcion_editor" value="1,1.36,4,5,1,2">LABEL_FILTER_COMMON</option><option class="opcion_editor" value=".9,1.3,37,-25,1,2">LABEL_FILTER_GOLD</option><option class="opcion_editor" value="1.1,1.3,-47,-42,-30,2">LABEL_FILTER_GOTHIC</option><option class="opcion_editor" value="1,1.4,-5,42,11,2">LABEL_FILTER_FORESTRY</option><option class="opcion_editor" value=".9,1.2,-5,-7,4,2">LABEL_FILTER_MOON</option><option class="opcion_editor" value="1.1,1.3,-1,-1,26,2">LABEL_FILTER_PARTY</option> </select> </div></div></div></div></div></div><dav class="fixed_noticia"></dav><dav class="cuadro_noticias animated bounceInUp delay-04" id="cuadro_noticias"> <dav class="relative"> <div class="titulo_topico">LABEL_TITLE_TOPIC</div><canvas class="imagen_noticias" id="imagen_noticias" width="320" height="480"></canvas> </dav> <div class="progreso d-flex align-items-center justify-content-between"><progress value="0" max="100"></progress><span class="ml-2">0.0%</span></div></dav>'
|
5207 |
nelberth |
567 |
$(document).on("click", ".info_noticia", function(e){
|
5709 |
nelberth |
568 |
imagenServidorNoticia = elemento.toDataURL("image/jpeg", 1.0);
|
5989 |
nelberth |
569 |
$('.file').val(imagenServidorNoticia.split(',')[1]);
|
5709 |
nelberth |
570 |
$(".c1").addClass("paso");
|
|
|
571 |
})
|
6045 |
nelberth |
572 |
var edit;
|
6015 |
nelberth |
573 |
function iniciarEditor(add=true, image=''){
|
5864 |
nelberth |
574 |
cortar=false;
|
4803 |
nelberth |
575 |
recorte_listo=false;
|
|
|
576 |
texto="";
|
|
|
577 |
seis=true;
|
|
|
578 |
color="#ffffff";
|
|
|
579 |
texto_listo=false,siete=false;
|
|
|
580 |
uno=true;
|
|
|
581 |
size=48;
|
10804 |
nelberth |
582 |
blockCelda=false;
|
4803 |
nelberth |
583 |
cinco=true;
|
4944 |
nelberth |
584 |
xf=320,yf =480;
|
4803 |
nelberth |
585 |
negritas=false, bold="";
|
|
|
586 |
shadow = true, nueve=true;
|
|
|
587 |
italic=false, ita="";
|
|
|
588 |
rectangulo=false, diez=false;
|
|
|
589 |
fontfamily="Arial";
|
|
|
590 |
r=0,g=0,b=0,a=1;
|
6049 |
nelberth |
591 |
edit=add;
|
4806 |
nelberth |
592 |
window.clearInterval(editorNoticia);
|
5202 |
nelberth |
593 |
setTimeout(function(){
|
|
|
594 |
scroll_altura=$(".articulo_noticia").offset().top-110;
|
4821 |
nelberth |
595 |
anchoFondoOscuro = $(".articulo_noticia").width();
|
4823 |
nelberth |
596 |
altoFondoOscuro = $(".editor_imagenes").height();
|
5202 |
nelberth |
597 |
|
6022 |
nelberth |
598 |
},navegacion(nuevoHtmlImagen,edit,image));
|
5202 |
nelberth |
599 |
|
4829 |
nelberth |
600 |
}
|
4798 |
nelberth |
601 |
|
4801 |
nelberth |
602 |
$(document).on("click", ".volver", function(){
|
|
|
603 |
var nombre_user = $(".perfil_u_nombre").text();
|
|
|
604 |
var primer_nombre = nombre_user.split(" ")[0];
|
5864 |
nelberth |
605 |
cortar=false;
|
4801 |
nelberth |
606 |
cinco=true;
|
|
|
607 |
recorte_listo=false;
|
|
|
608 |
texto="";
|
|
|
609 |
seis=true;
|
|
|
610 |
color="#ffffff";
|
|
|
611 |
texto_listo=false,siete=false;
|
|
|
612 |
uno=true;
|
10803 |
nelberth |
613 |
blockCelda=false;
|
4801 |
nelberth |
614 |
size=48;
|
8591 |
nelberth |
615 |
|
8593 |
nelberth |
616 |
|
4944 |
nelberth |
617 |
xf=320,yf =480;
|
4801 |
nelberth |
618 |
negritas=false, bold="";
|
|
|
619 |
shadow = true, nueve=true;
|
|
|
620 |
italic=false, ita="";
|
|
|
621 |
rectangulo=false, diez=false;
|
|
|
622 |
fontfamily="Arial";
|
|
|
623 |
r=0,g=0,b=0,a=1;
|
4804 |
nelberth |
624 |
var imagenServidorNoticia;
|
6048 |
nelberth |
625 |
console.log(edit)
|
4801 |
nelberth |
626 |
window.clearInterval(editorNoticia);
|
|
|
627 |
setTimeout(function(){
|
|
|
628 |
scroll_altura=$(".articulo_noticia").offset().top-110;
|
|
|
629 |
anchoFondoOscuro = $(".articulo_noticia").width();
|
4823 |
nelberth |
630 |
altoFondoOscuro = $(".editor_imagenes").height();
|
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;
|
11026 |
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();
|
10810 |
nelberth |
711 |
setTimeout(function(){
|
|
|
712 |
anchoFondoOscuro = $(".articulo_noticia").width();
|
|
|
713 |
altoFondoOscuro = $(".editor_imagenes").height();
|
10814 |
nelberth |
714 |
},300)
|
10810 |
nelberth |
715 |
|
10792 |
nelberth |
716 |
});
|
5129 |
nelberth |
717 |
|
4798 |
nelberth |
718 |
$(document).on("dragover", "#imagen_noticia", function(e){
|
|
|
719 |
e.preventDefault();
|
|
|
720 |
e.stopPropagation();
|
|
|
721 |
$(this).css({"background":"rgba(0,0,0,.2)"})
|
|
|
722 |
})
|
|
|
723 |
$(document).on("drop", "#imagen_noticia", function(e){
|
|
|
724 |
e.preventDefault();
|
|
|
725 |
e.stopPropagation();
|
|
|
726 |
$(this).css("background", "none");
|
|
|
727 |
var archivo = e.originalEvent.dataTransfer.files;
|
|
|
728 |
var img=archivo[0];
|
5926 |
nelberth |
729 |
if(img.type =="image/jpeg"||img.type =="image/png"){
|
4798 |
nelberth |
730 |
$(".modificar").removeClass("animated");
|
|
|
731 |
var render = new FileReader();
|
|
|
732 |
render.readAsDataURL(img);
|
|
|
733 |
render.onload = function(e){
|
8345 |
nelberth |
734 |
imagen2=new Image();
|
|
|
735 |
imagen2.src=e.target.result;
|
8349 |
nelberth |
736 |
|
|
|
737 |
$(imagen2).ready(function(e){
|
8517 |
nelberth |
738 |
if(imagen2.width<200||imagen2.height<200){
|
8360 |
nelberth |
739 |
$.fn.showError('LABEL_MINIMUM_IMAGE_SIZE');
|
8349 |
nelberth |
740 |
}else{
|
|
|
741 |
$(".volver").css("display","block")
|
|
|
742 |
$(".a1").addClass("paso");
|
|
|
743 |
$(".titulo_pasos").html("LABEL_STEP_2");
|
8351 |
nelberth |
744 |
editorNoticia(imagen2.src)
|
8349 |
nelberth |
745 |
}
|
8350 |
nelberth |
746 |
})
|
8349 |
nelberth |
747 |
}
|
8344 |
nelberth |
748 |
}else{
|
8360 |
nelberth |
749 |
$.fn.showError('LABEL_SUPPORTED_FORMATS');
|
5926 |
nelberth |
750 |
}
|
8346 |
nelberth |
751 |
})
|
10866 |
nelberth |
752 |
$(document).on("change", "#imagen_noticia_file", function(e){
|
|
|
753 |
file = $(this)[0].files[0];
|
10867 |
nelberth |
754 |
e.preventDefault();
|
10866 |
nelberth |
755 |
$(this).css("background", "none");
|
10867 |
nelberth |
756 |
var archivo = file;
|
10869 |
nelberth |
757 |
var img=file;
|
10866 |
nelberth |
758 |
if(img.type =="image/jpeg"||img.type =="image/png"){
|
|
|
759 |
$(".modificar").removeClass("animated");
|
|
|
760 |
var render = new FileReader();
|
|
|
761 |
render.readAsDataURL(img);
|
|
|
762 |
render.onload = function(e){
|
|
|
763 |
imagen2=new Image();
|
|
|
764 |
imagen2.src=e.target.result;
|
|
|
765 |
|
|
|
766 |
$(imagen2).ready(function(e){
|
10914 |
nelberth |
767 |
if(imagen2.width<320||imagen2.height<480){
|
10866 |
nelberth |
768 |
$.fn.showError('LABEL_MINIMUM_IMAGE_SIZE');
|
|
|
769 |
}else{
|
|
|
770 |
$(".volver").css("display","block")
|
|
|
771 |
$(".a1").addClass("paso");
|
|
|
772 |
$(".titulo_pasos").html("LABEL_STEP_2");
|
|
|
773 |
editorNoticia(imagen2.src)
|
|
|
774 |
}
|
|
|
775 |
})
|
|
|
776 |
}
|
|
|
777 |
}else{
|
|
|
778 |
$.fn.showError('LABEL_SUPPORTED_FORMATS');
|
10868 |
nelberth |
779 |
}
|
10866 |
nelberth |
780 |
})
|
4798 |
nelberth |
781 |
$(document).on("dragover", "body", function(e){
|
|
|
782 |
e.preventDefault();
|
|
|
783 |
e.stopPropagation();
|
|
|
784 |
})
|
|
|
785 |
$(document).on("drop", "body", function(e){
|
|
|
786 |
e.preventDefault();
|
|
|
787 |
e.stopPropagation();
|
|
|
788 |
})
|
|
|
789 |
|
5741 |
nelberth |
790 |
var canvas='<div class="editorNoticia"><canvas id="editorNoticia">LABEL_NOT_SUPPORTED</canvas></div>';
|
4798 |
nelberth |
791 |
$(document).on("mouseover", ".editorNoticia", function(){
|
12337 |
nelberth |
792 |
const getScrollBarWidth = () => window.innerWidth - document.documentElement.getBoundingClientRect().width
|
12339 |
nelberth |
793 |
let anchoScroll= getScrollBarWidth()+"px";
|
4798 |
nelberth |
794 |
$("body").css({"overflow": "hidden"});
|
12343 |
nelberth |
795 |
$(".cuadro_noticias, .fixed_noticia,.tituloEditor,.grid-padre,.subpanel").css("margin-right",anchoScroll )
|
|
|
796 |
$(".barra,.footer").css("padding-right",anchoScroll)
|
4798 |
nelberth |
797 |
|
|
|
798 |
|
|
|
799 |
})
|
|
|
800 |
$(document).on("mouseover", "#editorNoticia", function(){
|
|
|
801 |
if(recorte_listo){
|
|
|
802 |
ocho=true;
|
|
|
803 |
}
|
|
|
804 |
})
|
|
|
805 |
$(document).on("mouseout", "#editorNoticia", function(){
|
|
|
806 |
if(recorte_listo){
|
|
|
807 |
ocho=false;
|
|
|
808 |
actualizar2()
|
|
|
809 |
}
|
|
|
810 |
})
|
|
|
811 |
$(document).on("mouseout", ".editorNoticia",function(){
|
|
|
812 |
$("body").css({"overflow": "auto"})
|
12343 |
nelberth |
813 |
$(".cuadro_noticias, .fixed_noticia,.tituloEditor,.grid-padre,.subpanel").css("margin-right", "0px")
|
|
|
814 |
$(".barra,.footer").css("padding-right","0px")
|
4798 |
nelberth |
815 |
|
|
|
816 |
})
|
|
|
817 |
$(document).on('mousewheel', ".editorNoticia",function(e){
|
|
|
818 |
var ruedita = e.originalEvent.wheelDelta
|
|
|
819 |
if(ruedita>0){
|
|
|
820 |
scale = scale+(scale/10);
|
|
|
821 |
$("#porciento_scale").html((scale*100).toFixed(2)+"%")
|
|
|
822 |
}else{
|
|
|
823 |
scale = scale-(scale/10);
|
|
|
824 |
$("#porciento_scale").html((scale*100).toFixed(2)+"%")
|
|
|
825 |
}
|
|
|
826 |
$("#editorNoticia").css({"transform": "scale("+scale+")"});
|
|
|
827 |
})
|
|
|
828 |
$(document).on("click", ".as", function(e){
|
|
|
829 |
e.preventDefault();
|
|
|
830 |
scale = $(this).data("scale");
|
|
|
831 |
$("#porciento_scale").html((scale*100).toFixed(2)+"%")
|
|
|
832 |
$("#editorNoticia").css({"transform": "scale("+scale+")"});
|
|
|
833 |
|
|
|
834 |
})
|
|
|
835 |
$(document).on("click", ".ps", function(e){
|
|
|
836 |
e.preventDefault();
|
|
|
837 |
$(".cantidades_scale").slideToggle(200).css("display", "block");
|
|
|
838 |
})
|
5789 |
nelberth |
839 |
$(document).on("click", "#cerrar_filter_modal, .icon_filter", function(e){
|
|
|
840 |
e.preventDefault();
|
5854 |
nelberth |
841 |
if(recorte_listo){
|
5789 |
nelberth |
842 |
$(".contenido_filter").slideToggle(200).css("display", "block");
|
5854 |
nelberth |
843 |
}
|
5789 |
nelberth |
844 |
})
|
5805 |
nelberth |
845 |
$(document).on("click", "#cerrar_text_modal, .icon_text", function(e){
|
|
|
846 |
e.preventDefault();
|
5854 |
nelberth |
847 |
if(recorte_listo){
|
5855 |
nelberth |
848 |
$(".contenido_text").slideToggle(200).css("display", "block");
|
5854 |
nelberth |
849 |
}
|
5805 |
nelberth |
850 |
})
|
5865 |
nelberth |
851 |
|
5816 |
nelberth |
852 |
$(document).on("click", "#cerrar_cut_modal, .icon_cut", function(e){
|
|
|
853 |
e.preventDefault();
|
5861 |
nelberth |
854 |
if(cortar){
|
5854 |
nelberth |
855 |
$(".contenido_cut").slideToggle(200).css("display", "block");
|
5861 |
nelberth |
856 |
}
|
5854 |
nelberth |
857 |
|
5816 |
nelberth |
858 |
})
|
4798 |
nelberth |
859 |
$(document).on("click", "#menos_scale", function(e){
|
|
|
860 |
e.preventDefault();
|
|
|
861 |
scale = scale-(scale/10);
|
|
|
862 |
$("#porciento_scale").html((scale*100).toFixed(2)+"%")
|
|
|
863 |
$("#editorNoticia").css({"transform": "scale("+scale+")"});
|
|
|
864 |
})
|
|
|
865 |
|
14934 |
stevensc |
866 |
$(document).on("click", ".canvas.recortar", function(e){
|
14936 |
stevensc |
867 |
$('.sidebar-mini').addClass(function( index ) {
|
14938 |
stevensc |
868 |
return "sidebar-collapse";
|
14935 |
stevensc |
869 |
});
|
14934 |
stevensc |
870 |
})
|
|
|
871 |
|
4798 |
nelberth |
872 |
$(document).on("click", "#mas_scale", function(e){
|
|
|
873 |
e.preventDefault();
|
|
|
874 |
scale = scale+(scale/10);
|
|
|
875 |
$("#porciento_scale").html((scale*100).toFixed(2)+"%")
|
|
|
876 |
$("#editorNoticia").css({"transform": "scale("+scale+")"});
|
|
|
877 |
})
|
10747 |
nelberth |
878 |
$(document).on('change', '#selectFiltro', function(e){
|
10770 |
nelberth |
879 |
|
10747 |
nelberth |
880 |
data=$(this).val()
|
10786 |
nelberth |
881 |
if(data=="normal"){
|
|
|
882 |
filter();
|
10788 |
nelberth |
883 |
}else{
|
|
|
884 |
data=data.split(',');
|
10805 |
nelberth |
885 |
if(data[2]=='gris'){
|
10788 |
nelberth |
886 |
filtergris(data[0],data[1]);
|
10805 |
nelberth |
887 |
}else{
|
10788 |
nelberth |
888 |
filter(Number(data[0]),Number(data[1]),Number(data[2]),Number(data[3]),Number(data[4]),Number(data[5]));
|
|
|
889 |
}
|
10770 |
nelberth |
890 |
}
|
|
|
891 |
|
10783 |
nelberth |
892 |
|
10788 |
nelberth |
893 |
|
10747 |
nelberth |
894 |
})
|
10764 |
nelberth |
895 |
|
10789 |
nelberth |
896 |
|
4798 |
nelberth |
897 |
var texto_listo=false,siete=false;
|
|
|
898 |
var texto;
|
|
|
899 |
$(document).on("keyup", "#texto_input", function(e){
|
|
|
900 |
e.preventDefault();
|
|
|
901 |
texto = $(this).val();
|
|
|
902 |
if(texto_actualizar){
|
|
|
903 |
siete=true;
|
|
|
904 |
}
|
|
|
905 |
if(texto!=""){
|
|
|
906 |
texto_actualizar=true;
|
|
|
907 |
actualizar2();
|
|
|
908 |
}else{
|
|
|
909 |
actualizar2();
|
|
|
910 |
}
|
|
|
911 |
|
|
|
912 |
})
|
|
|
913 |
var color="#ffffff";
|
10734 |
nelberth |
914 |
|
10943 |
nelberth |
915 |
$(document).on("change input", "#color", function(){
|
4798 |
nelberth |
916 |
color=$(this).val();
|
|
|
917 |
seis=true;
|
|
|
918 |
actualizar2();
|
|
|
919 |
})
|
|
|
920 |
var size=48;
|
10858 |
nelberth |
921 |
$(document).on("keypress", "#font-size, #texto_input", function(e){
|
10857 |
nelberth |
922 |
if(e.which == 13){
|
|
|
923 |
return false;
|
|
|
924 |
}
|
|
|
925 |
});
|
|
|
926 |
$(document).on("keyup change", "#font-size", function(e){
|
10855 |
nelberth |
927 |
e.preventDefault();
|
4798 |
nelberth |
928 |
size=$(this).val();
|
|
|
929 |
size = parseInt(size);
|
|
|
930 |
seis=true;
|
|
|
931 |
siete=true;
|
|
|
932 |
actualizar2();
|
|
|
933 |
})
|
|
|
934 |
var negritas=false, bold="";
|
|
|
935 |
$(document).on("click", "#negritas", function(e){
|
|
|
936 |
e.preventDefault();
|
|
|
937 |
if(!negritas){
|
|
|
938 |
bold="bold";
|
|
|
939 |
$(this).addClass("fa");
|
|
|
940 |
seis=true;
|
|
|
941 |
siete=true;
|
|
|
942 |
actualizar2();
|
|
|
943 |
negritas=true;
|
|
|
944 |
}else{
|
|
|
945 |
bold="";
|
|
|
946 |
$(this).removeClass("fa");
|
|
|
947 |
seis=true;
|
|
|
948 |
siete=true;
|
|
|
949 |
actualizar2();
|
|
|
950 |
negritas=false;
|
|
|
951 |
}
|
|
|
952 |
})
|
|
|
953 |
var italic=false, ita="";
|
|
|
954 |
$(document).on("click", "#italic", function(e){
|
|
|
955 |
e.preventDefault();
|
|
|
956 |
if(!italic){
|
|
|
957 |
ita="italic";
|
|
|
958 |
$(this).addClass("fa");
|
|
|
959 |
seis=true;
|
|
|
960 |
siete=true;
|
|
|
961 |
actualizar2();
|
|
|
962 |
italic=true;
|
|
|
963 |
}else{
|
|
|
964 |
ita="";
|
|
|
965 |
$(this).removeClass("fa");
|
|
|
966 |
seis=true;
|
|
|
967 |
siete=true;
|
|
|
968 |
actualizar2();
|
|
|
969 |
italic=false;
|
|
|
970 |
}
|
|
|
971 |
})
|
|
|
972 |
var fontfamily="Arial";
|
10616 |
nelberth |
973 |
$(document).on("change", "#selectFuente", function(e){
|
4798 |
nelberth |
974 |
e.preventDefault();
|
10618 |
nelberth |
975 |
fontfamily= $(this).val();
|
4798 |
nelberth |
976 |
seis=true;
|
|
|
977 |
siete=true;
|
|
|
978 |
actualizar2();
|
|
|
979 |
|
5149 |
nelberth |
980 |
})
|
4798 |
nelberth |
981 |
var shadow = true, nueve=true;
|
5149 |
nelberth |
982 |
$(document).on("click","#shadow", function(e){
|
4798 |
nelberth |
983 |
e.preventDefault();
|
|
|
984 |
if(shadow){
|
|
|
985 |
$(this).removeClass("fa");
|
|
|
986 |
seis=true;
|
|
|
987 |
nueve=false;
|
|
|
988 |
actualizar2();
|
|
|
989 |
shadow=false;
|
|
|
990 |
}else{
|
|
|
991 |
$(this).addClass("fa");
|
|
|
992 |
seis=true;
|
|
|
993 |
nueve=true;
|
|
|
994 |
actualizar2();
|
|
|
995 |
shadow=true;
|
|
|
996 |
}
|
|
|
997 |
|
5149 |
nelberth |
998 |
})
|
4798 |
nelberth |
999 |
var rectangulo=false, diez=false, colorrect="#000000";
|
5149 |
nelberth |
1000 |
$(document).on("click", "#rectangulo", function(e){
|
4798 |
nelberth |
1001 |
e.preventDefault();
|
|
|
1002 |
if(!rectangulo){
|
|
|
1003 |
$(this).addClass("fa");
|
10691 |
nelberth |
1004 |
$('.color_fondo_cuadro').css('display','flex')
|
4798 |
nelberth |
1005 |
diez=true;
|
|
|
1006 |
actualizar2();
|
|
|
1007 |
rectangulo=true;
|
|
|
1008 |
}else{
|
|
|
1009 |
$(this).removeClass("fa");
|
10689 |
nelberth |
1010 |
$('.color_fondo_cuadro').css('display','none')
|
4798 |
nelberth |
1011 |
diez=false;
|
|
|
1012 |
actualizar2();
|
|
|
1013 |
rectangulo=false;
|
|
|
1014 |
}
|
|
|
1015 |
|
5149 |
nelberth |
1016 |
})
|
4798 |
nelberth |
1017 |
var r=0,g=0,b=0;
|
10943 |
nelberth |
1018 |
$(document).on("change input", "#colorrect", function(){
|
4798 |
nelberth |
1019 |
colorrect=$(this).val();
|
8315 |
nelberth |
1020 |
r=parseInt(colorrect.slice(1,3),16);
|
|
|
1021 |
g=parseInt(colorrect.slice(3,5),16);
|
|
|
1022 |
b=parseInt(colorrect.slice(5,7),16);
|
4798 |
nelberth |
1023 |
seis=true;
|
|
|
1024 |
actualizar2();
|
|
|
1025 |
})
|
|
|
1026 |
var a=1;
|
5149 |
nelberth |
1027 |
|
10942 |
nelberth |
1028 |
$(document).on("mousemove change ", "#opacidad", function(){
|
4798 |
nelberth |
1029 |
a=$(this).val();
|
|
|
1030 |
a=a/100;
|
|
|
1031 |
seis=true;
|
|
|
1032 |
actualizar2();
|
5149 |
nelberth |
1033 |
})
|
4798 |
nelberth |
1034 |
var imaNoti = new Image();
|
|
|
1035 |
function filter(brillo=1, contraste=1, rojo=1, verde=1, azul=1, valor=1){
|
5073 |
nelberth |
1036 |
cuatro=false;
|
5414 |
nelberth |
1037 |
restaurar(brillo, contraste);
|
4798 |
nelberth |
1038 |
datos=imagenOriginal.data;
|
10783 |
nelberth |
1039 |
if(valor==2){
|
4798 |
nelberth |
1040 |
for (var i = 0; i <datos.length; i+=4) {
|
|
|
1041 |
datos[i]=datos[i]+rojo;
|
|
|
1042 |
datos[i+1]=datos[i+1]+verde;
|
|
|
1043 |
datos[i+2]=datos[i+2]+azul;
|
|
|
1044 |
}
|
|
|
1045 |
}else{
|
|
|
1046 |
for (var i = 0; i <datos.length; i+=4) {
|
|
|
1047 |
datos[i]=datos[i]*rojo;
|
|
|
1048 |
datos[i+1]=datos[i+1]*verde;
|
|
|
1049 |
datos[i+2]=datos[i+2]*azul
|
|
|
1050 |
}
|
|
|
1051 |
}
|
|
|
1052 |
editor.putImageData(imagenOriginal,0,0)
|
|
|
1053 |
var imagenNoticia = elemento.toDataURL("image/jpeg", 1.0);
|
|
|
1054 |
imaNoti.src = imagenNoticia;
|
|
|
1055 |
actualizar2();
|
|
|
1056 |
}
|
|
|
1057 |
function filtergris(brillo=1, contraste=1){
|
|
|
1058 |
cuatro=false;
|
|
|
1059 |
restaurar(brillo, contraste);
|
|
|
1060 |
datos=imagenOriginal.data;
|
|
|
1061 |
var auxiliar;
|
|
|
1062 |
for (var i = 0; i <datos.length; i+=4) {
|
8315 |
nelberth |
1063 |
auxiliar = 0.34 * datos[i] + 0.5 *datos[i+1] + 0.16 * datos[i+2];
|
4798 |
nelberth |
1064 |
datos[i]=auxiliar;
|
|
|
1065 |
datos[i+1]=auxiliar;
|
|
|
1066 |
datos[i+2]=auxiliar;
|
|
|
1067 |
}
|
5429 |
nelberth |
1068 |
|
4798 |
nelberth |
1069 |
editor.putImageData(imagenOriginal,0,0)
|
|
|
1070 |
var imagenNoticia = elemento.toDataURL("image/jpeg", 1.0);
|
|
|
1071 |
imaNoti.src = imagenNoticia;
|
|
|
1072 |
actualizar2();
|
|
|
1073 |
}
|
|
|
1074 |
function restaurar(brillo = 1, contraste=1){
|
|
|
1075 |
editor.filter = "none"
|
|
|
1076 |
editor.filter = 'contrast('+contraste+') brightness('+brillo+') saturate(1) sepia(0)';
|
5429 |
nelberth |
1077 |
editor.fillStyle="rgba(255,255,255,1)"
|
|
|
1078 |
editor.fillRect(0,0,ancho,alto);
|
5458 |
nelberth |
1079 |
editor.fillStyle=""+color+"";
|
5414 |
nelberth |
1080 |
var pxf=0,pyf=0;
|
|
|
1081 |
if(xf>=(yf/recorte)){
|
5459 |
nelberth |
1082 |
pxf=xf/ancho;
|
|
|
1083 |
pyf=yf/pxf;
|
|
|
1084 |
py=(alto/2)-(pyf/2);
|
|
|
1085 |
editor.drawImage(imagen,x,y,xf,yf,0,py,ancho,pyf);
|
|
|
1086 |
}else{
|
|
|
1087 |
pyf=yf/alto;
|
5461 |
nelberth |
1088 |
pxf=xf/pyf;
|
5459 |
nelberth |
1089 |
px=(ancho/2)-(pxf/2);
|
|
|
1090 |
editor.drawImage(imagen,x,y,xf,yf,px,0,pxf,alto);
|
|
|
1091 |
}
|
4798 |
nelberth |
1092 |
imagenOriginal = editor.getImageData(0,0,ancho,alto)
|
|
|
1093 |
}
|
|
|
1094 |
var ocho=false;
|
|
|
1095 |
function actualizar2(){
|
|
|
1096 |
if(recorte_listo){
|
|
|
1097 |
if(cuatro){
|
|
|
1098 |
imagenOriginal = editor.getImageData(0,0,ancho,alto)
|
|
|
1099 |
var imagenNoticia = elemento.toDataURL("image/jpeg", 1.0);
|
|
|
1100 |
imaNoti.src = imagenNoticia;
|
|
|
1101 |
cuatro=false;
|
|
|
1102 |
}
|
|
|
1103 |
editor.filter = "none"
|
5428 |
nelberth |
1104 |
$(imaNoti).ready(function(e){
|
5433 |
nelberth |
1105 |
noticia.drawImage(imaNoti,0,0,320,480);
|
5394 |
nelberth |
1106 |
editor.drawImage(imaNoti,0,0,ancho,alto)
|
4798 |
nelberth |
1107 |
if(texto_actualizar){
|
|
|
1108 |
if(texto!=""){
|
|
|
1109 |
if(seis){
|
|
|
1110 |
ancho_imaNoti = imaNoti.width;
|
5439 |
nelberth |
1111 |
|
|
|
1112 |
scale_noticia = -(((ancho_imaNoti-320)/ancho_imaNoti)-1);
|
4798 |
nelberth |
1113 |
editor.fillStyle=""+color+"";
|
|
|
1114 |
editor.strokeStyle="rgb(255,255,255)";
|
|
|
1115 |
if(nueve){
|
|
|
1116 |
editor.shadowColor="rgba(0,0,0,.5)";
|
|
|
1117 |
editor.shadowOffsetX=6;
|
|
|
1118 |
editor.shadowOffsetY=6;
|
|
|
1119 |
editor.shadowBlur=6;
|
|
|
1120 |
noticia.shadowColor="rgba(0,0,0,.5)";
|
|
|
1121 |
noticia.shadowOffsetX=6*scale_noticia;
|
|
|
1122 |
noticia.shadowOffsetY=6*scale_noticia;
|
|
|
1123 |
noticia.shadowBlur=6*scale_noticia;
|
|
|
1124 |
}else{
|
|
|
1125 |
editor.shadowColor="rgba(0,0,0,0)";
|
|
|
1126 |
noticia.shadowColor="rgba(0,0,0,0)";
|
|
|
1127 |
}
|
|
|
1128 |
editor.font=""+ita+" "+bold+" "+size+"px "+fontfamily+"";
|
|
|
1129 |
editor.textAlign="start";
|
|
|
1130 |
editor.textBaseline="top";
|
|
|
1131 |
|
|
|
1132 |
var sizeNoticia = size*scale_noticia;
|
|
|
1133 |
noticia.fillStyle=""+color+"";
|
|
|
1134 |
noticia.font=""+ita+" "+bold+" "+sizeNoticia+"px "+fontfamily+"";
|
|
|
1135 |
noticia.textAlign="start";
|
|
|
1136 |
noticia.textBaseline="top";
|
|
|
1137 |
seis=false;
|
|
|
1138 |
}
|
|
|
1139 |
if(siete){
|
|
|
1140 |
dimencionesTexto = editor.measureText(texto);
|
|
|
1141 |
txf=dimencionesTexto.width+20;
|
|
|
1142 |
tyf= (20+size);
|
|
|
1143 |
siete=false;
|
|
|
1144 |
}
|
5443 |
nelberth |
1145 |
if(cinco){
|
4798 |
nelberth |
1146 |
dimencionesTexto = editor.measureText(texto);
|
5441 |
nelberth |
1147 |
if(xf>=(yf/recorte)){
|
|
|
1148 |
tx=(xf/2)-(dimencionesTexto.width/2);
|
|
|
1149 |
ty=(xf*recorte/2)-(size/2);
|
|
|
1150 |
}else{
|
|
|
1151 |
tx=(yf/recorte/2)-(dimencionesTexto.width/2);
|
|
|
1152 |
ty=(yf/2)-(size/2);
|
|
|
1153 |
}
|
|
|
1154 |
|
4798 |
nelberth |
1155 |
txf=dimencionesTexto.width+20;
|
|
|
1156 |
tyf= size+20;
|
|
|
1157 |
cinco=false;
|
5443 |
nelberth |
1158 |
}
|
4798 |
nelberth |
1159 |
if(diez){
|
|
|
1160 |
editor.fillStyle="rgba("+r+","+g+","+b+","+a+")";
|
|
|
1161 |
noticia.fillStyle="rgba("+r+","+g+","+b+","+a+")";
|
|
|
1162 |
editor.fillRect(tx-10,ty-10,txf,tyf);
|
5387 |
nelberth |
1163 |
noticia.fillRect(((tx-10)*scale_noticia),((ty-10)*scale_noticia),txf*scale_noticia,tyf*scale_noticia);
|
4798 |
nelberth |
1164 |
editor.fillStyle=""+color+"";
|
|
|
1165 |
noticia.fillStyle=""+color+"";
|
|
|
1166 |
|
|
|
1167 |
}
|
|
|
1168 |
editor.fillText(texto,tx,ty);
|
5440 |
nelberth |
1169 |
noticia.fillText(texto,(tx*scale_noticia),ty*scale_noticia);
|
4798 |
nelberth |
1170 |
if(ocho){
|
|
|
1171 |
editor.strokeRect(tx-10,ty-10,txf,tyf)
|
|
|
1172 |
editor.arc(tx+txf,ty+tyf,10,0,Math.PI*2,false);
|
|
|
1173 |
editor.fill();
|
|
|
1174 |
editor.beginPath();
|
|
|
1175 |
}
|
|
|
1176 |
texto_listo=true;
|
|
|
1177 |
}
|
|
|
1178 |
}
|
|
|
1179 |
})
|
|
|
1180 |
|
|
|
1181 |
}
|
|
|
1182 |
}
|
|
|
1183 |
function actualizar(){
|
|
|
1184 |
$(imagen).ready(function(e){
|
|
|
1185 |
if(uno){
|
|
|
1186 |
ancho=imagen.width, alto = imagen.height;
|
5388 |
nelberth |
1187 |
elemento.width = ancho;
|
|
|
1188 |
elemento.height = alto;
|
4798 |
nelberth |
1189 |
$(".scale").css("display","flex");
|
|
|
1190 |
if(ancho<=alto){
|
|
|
1191 |
scale = -(((alto-450)/alto)-1);
|
8329 |
nelberth |
1192 |
|
8339 |
nelberth |
1193 |
|
8329 |
nelberth |
1194 |
}else{
|
|
|
1195 |
scale = -(((ancho-500)/ancho)-1);
|
8339 |
nelberth |
1196 |
|
4798 |
nelberth |
1197 |
}
|
10907 |
nelberth |
1198 |
scale=scale*0.80;
|
8578 |
nelberth |
1199 |
if(edit){
|
8577 |
nelberth |
1200 |
if((ancho*recorte)<=alto){
|
|
|
1201 |
xf=ancho*.70;
|
|
|
1202 |
yf=xf*recorte;
|
|
|
1203 |
}else{
|
|
|
1204 |
yf=alto*.70;
|
|
|
1205 |
xf=yf/recorte;
|
|
|
1206 |
}
|
|
|
1207 |
}
|
10597 |
nelberth |
1208 |
|
8343 |
nelberth |
1209 |
cuadro_dimencion=Math.round(12/scale);
|
8328 |
nelberth |
1210 |
|
8308 |
nelberth |
1211 |
if(xf<50||yf<50){
|
|
|
1212 |
xf=50;
|
|
|
1213 |
yf=xf*recorte;
|
|
|
1214 |
}
|
8304 |
nelberth |
1215 |
console.log(xf+' '+yf)
|
8301 |
nelberth |
1216 |
mitadX=ancho/2;
|
|
|
1217 |
mitadY=alto/2;
|
|
|
1218 |
x=mitadX-xf/2;
|
|
|
1219 |
y=mitadY-yf/2;
|
|
|
1220 |
|
4798 |
nelberth |
1221 |
$("#porciento_scale").html((scale*100).toFixed(2)+"%")
|
|
|
1222 |
$("#ancho").html(ancho+"px");
|
|
|
1223 |
$("#alto").html(alto+"px");
|
|
|
1224 |
uno=false;
|
|
|
1225 |
}
|
|
|
1226 |
if(dos){
|
5402 |
nelberth |
1227 |
|
|
|
1228 |
if(xf>=(yf/recorte)){
|
5405 |
nelberth |
1229 |
alto=xf*recorte;
|
5404 |
nelberth |
1230 |
ancho=xf;
|
5402 |
nelberth |
1231 |
}else{
|
5435 |
nelberth |
1232 |
ancho=yf/recorte;
|
5404 |
nelberth |
1233 |
alto=yf;
|
|
|
1234 |
|
5402 |
nelberth |
1235 |
}
|
|
|
1236 |
elemento.width = ancho;
|
|
|
1237 |
elemento.height = alto;
|
5451 |
nelberth |
1238 |
if(xf<=yf){
|
5411 |
nelberth |
1239 |
scale = -(((yf-450)/yf)-1);
|
5433 |
nelberth |
1240 |
|
4798 |
nelberth |
1241 |
}else{
|
5411 |
nelberth |
1242 |
scale = -(((xf-500)/xf)-1);
|
4798 |
nelberth |
1243 |
}
|
|
|
1244 |
|
|
|
1245 |
$("#porciento_scale").html((scale*100).toFixed(2)+"%")
|
5411 |
nelberth |
1246 |
$("#ancho").html(Math.round(xf)+"px");
|
|
|
1247 |
$("#alto").html(Math.round(yf)+"px");
|
4798 |
nelberth |
1248 |
dos=false;
|
|
|
1249 |
}
|
5235 |
nelberth |
1250 |
|
5408 |
nelberth |
1251 |
var pxf=0,pyf=0;
|
|
|
1252 |
noticia.fillStyle="rgba(255,255,255,1)"
|
|
|
1253 |
noticia.fillRect(0,0,320,480);
|
|
|
1254 |
if(xf>=(yf/recorte)){
|
|
|
1255 |
pxf=xf/320;
|
|
|
1256 |
pyf=yf/pxf;
|
|
|
1257 |
py=(480/2)-(pyf/2);
|
|
|
1258 |
noticia.drawImage(imagen,x,y,xf,yf,0,py,320,pyf);
|
5409 |
nelberth |
1259 |
}else{
|
5408 |
nelberth |
1260 |
pyf=yf/480;
|
|
|
1261 |
pxf=xf/pyf;
|
|
|
1262 |
px=(320/2)-(pxf/2);
|
|
|
1263 |
noticia.drawImage(imagen,x,y,xf,yf,px,0,pxf,480);
|
5409 |
nelberth |
1264 |
}
|
5407 |
nelberth |
1265 |
|
10907 |
nelberth |
1266 |
$("#editorNoticia").css({"transform": "scale("+scale+")"});
|
4798 |
nelberth |
1267 |
if(!recorte_listo){
|
|
|
1268 |
editor.drawImage(imagen,0,0,ancho,alto);
|
8320 |
nelberth |
1269 |
editor.fillStyle="rgba(0,0,0,.2)"
|
4798 |
nelberth |
1270 |
editor.fillRect(0,0,ancho,alto);
|
8320 |
nelberth |
1271 |
editor.fillStyle="rgba(255,255,255,.2)"
|
4798 |
nelberth |
1272 |
editor.fillRect(x,y,xf,yf);
|
8324 |
nelberth |
1273 |
editor.fillStyle="rgba(255,255,255,0.8)"
|
8315 |
nelberth |
1274 |
editor.fillRect(x,y,cuadro_dimencion,cuadro_dimencion);
|
|
|
1275 |
editor.fillRect((x+xf)-cuadro_dimencion,y,cuadro_dimencion,cuadro_dimencion);
|
|
|
1276 |
editor.fillRect(x,y+yf-cuadro_dimencion,cuadro_dimencion,cuadro_dimencion);
|
|
|
1277 |
editor.fillRect(x+xf-cuadro_dimencion,yf+y-cuadro_dimencion,cuadro_dimencion,cuadro_dimencion);
|
4798 |
nelberth |
1278 |
esta=true;
|
|
|
1279 |
}else{
|
5406 |
nelberth |
1280 |
var pxf=0,pyf=0;
|
5427 |
nelberth |
1281 |
|
5428 |
nelberth |
1282 |
editor.fillStyle="rgba(255,255,255,1)"
|
|
|
1283 |
editor.fillRect(0,0,ancho,alto);
|
5406 |
nelberth |
1284 |
if(xf>=(yf/recorte)){
|
|
|
1285 |
pxf=xf/ancho;
|
|
|
1286 |
pyf=yf/pxf;
|
|
|
1287 |
py=(alto/2)-(pyf/2);
|
|
|
1288 |
editor.drawImage(imagen,x,y,xf,yf,0,py,ancho,pyf);
|
|
|
1289 |
}else{
|
|
|
1290 |
pyf=yf/alto;
|
|
|
1291 |
pxf=xf/pyf;
|
|
|
1292 |
px=(ancho/2)-(pxf/2);
|
|
|
1293 |
editor.drawImage(imagen,x,y,xf,yf,px,0,pxf,alto);
|
4798 |
nelberth |
1294 |
}
|
5406 |
nelberth |
1295 |
|
|
|
1296 |
}
|
4798 |
nelberth |
1297 |
})
|
|
|
1298 |
}
|
|
|
1299 |
var imagenOriginal;
|
8356 |
nelberth |
1300 |
var x,y,xf=320,yf =480, elemento,editor,centro, total,scale,dimencionesTexto,ancho_imaNoti,
|
4798 |
nelberth |
1301 |
recorte_listo=false,alto,ancho,tx,ty,txf,tyf,cuatro=true,texto_actualizar=false,cinco=true,seis=true,cuatro;
|
5865 |
nelberth |
1302 |
var mitadY,mitadX, uno=true,dos=false, recorte=480/320, imagen_noticias, scale_noticia, tres=true,rotar=false, cortar=false;;
|
8317 |
nelberth |
1303 |
var translateX, cuadro_dimencion;
|
4798 |
nelberth |
1304 |
|
5822 |
nelberth |
1305 |
$(document).on("click", ".recortar10", function(e){
|
10994 |
nelberth |
1306 |
|
4798 |
nelberth |
1307 |
e.preventDefault();
|
|
|
1308 |
recorte_listo=false;
|
|
|
1309 |
uno=true;
|
|
|
1310 |
$("#boton_recortar").addClass("recortar").text("Recortar").removeClass("info_noticia");
|
|
|
1311 |
$("#boton_recortar3").addClass("recortar").text("Recortar").removeClass("info_noticia3");
|
5855 |
nelberth |
1312 |
$(".contenido_text").css("display", "none");
|
|
|
1313 |
$(".contenido_filter").css("display", "none");
|
5822 |
nelberth |
1314 |
$(".recortar10").addClass("recortar");
|
4798 |
nelberth |
1315 |
$(".canvas").addClass("recortar")
|
|
|
1316 |
$(".oa").removeClass("oa");
|
|
|
1317 |
$("#normal").addClass("oa");
|
|
|
1318 |
$(".b1").removeClass("paso");
|
5741 |
nelberth |
1319 |
$(".titulo_pasos").html("LABEL_STEP_2");
|
11010 |
nelberth |
1320 |
$('.selectFiltro').prop('selectedIndex','normal');
|
4798 |
nelberth |
1321 |
window.clearInterval(actualizar2);
|
|
|
1322 |
actualizar();
|
|
|
1323 |
|
|
|
1324 |
})
|
5789 |
nelberth |
1325 |
|
|
|
1326 |
|
10803 |
nelberth |
1327 |
blockCelda=false;
|
10994 |
nelberth |
1328 |
$(document).on("click", "#blockCelda", function(e){
|
5488 |
nelberth |
1329 |
e.preventDefault();
|
5490 |
nelberth |
1330 |
if(blockCelda){
|
|
|
1331 |
$(this).html('<span class="fa fa-unlock"></span>')
|
5495 |
nelberth |
1332 |
|
5490 |
nelberth |
1333 |
blockCelda=false;
|
|
|
1334 |
}else{
|
|
|
1335 |
$(this).html('<span class="fa fa-lock"></span>')
|
|
|
1336 |
blockCelda=true;
|
|
|
1337 |
}
|
5495 |
nelberth |
1338 |
t4=true;
|
10994 |
nelberth |
1339 |
|
5488 |
nelberth |
1340 |
})
|
4798 |
nelberth |
1341 |
var imagen
|
|
|
1342 |
function editorNoticia(img){
|
5865 |
nelberth |
1343 |
cortar=true;
|
4798 |
nelberth |
1344 |
imagen= new Image();
|
|
|
1345 |
$(".canvas").html(canvas);
|
|
|
1346 |
elemento = document.getElementById("editorNoticia");
|
|
|
1347 |
editor = elemento.getContext("2d");
|
|
|
1348 |
elemento2 = document.getElementById("imagen_noticias");
|
|
|
1349 |
noticia = elemento2.getContext("2d");
|
|
|
1350 |
|
|
|
1351 |
$(document).on("click", ".boton_marino.recortar",function(e){
|
|
|
1352 |
e.preventDefault();
|
|
|
1353 |
recorte_listo=true;
|
|
|
1354 |
$(".fondo_oscuro").css("display","none");
|
5741 |
nelberth |
1355 |
$("#boton_recortar").removeClass("recortar").text("LABEL_SEND").addClass("info_noticia").attr('type','submit');
|
5822 |
nelberth |
1356 |
$(".recortar10").removeClass("recortar");
|
4798 |
nelberth |
1357 |
$(".canvas").removeClass("recortar");
|
|
|
1358 |
$(".b1").addClass("paso");
|
5741 |
nelberth |
1359 |
$(".titulo_pasos").html("LABEL_STEP_3");
|
11007 |
nelberth |
1360 |
|
4798 |
nelberth |
1361 |
if(texto!=""){
|
|
|
1362 |
seis=true;
|
|
|
1363 |
siete=true;
|
|
|
1364 |
}
|
|
|
1365 |
cinco=true;
|
|
|
1366 |
dos=true;
|
|
|
1367 |
cuatro=true;
|
11253 |
nelberth |
1368 |
setTimeout(() => {
|
|
|
1369 |
actualizar2();
|
|
|
1370 |
}, actualizar());
|
4798 |
nelberth |
1371 |
})
|
|
|
1372 |
|
|
|
1373 |
var cli = false, t1= false, t2=false,t3=false,t4=false,tcli=false;
|
|
|
1374 |
var mouse =[];
|
|
|
1375 |
|
|
|
1376 |
|
|
|
1377 |
function raton(elemento, e){
|
|
|
1378 |
return {
|
|
|
1379 |
x:((e.pageX - elemento.offsetLeft - ((ancho/2)-((ancho*scale)/2)))/scale),
|
|
|
1380 |
y:((e.pageY - elemento.offsetTop - ((alto/2)-((alto*scale)/2)))/scale)
|
|
|
1381 |
}
|
|
|
1382 |
}
|
|
|
1383 |
|
|
|
1384 |
imagen.src=img;
|
5822 |
nelberth |
1385 |
$(".recortar10").addClass("recortar");
|
5741 |
nelberth |
1386 |
$("#boton_recortar").removeClass("boton_normal").addClass("recortar boton_marino").text("LABEL_CUT")
|
4798 |
nelberth |
1387 |
actualizar();
|
|
|
1388 |
|
|
|
1389 |
$(elemento).mousemove(function(e){
|
|
|
1390 |
mouse = raton(this, e);
|
10535 |
nelberth |
1391 |
|
4798 |
nelberth |
1392 |
if(!recorte_listo){
|
8335 |
nelberth |
1393 |
if(x<mouse.x &&(xf+x)>mouse.x && y<mouse.y && (y+yf)>mouse.y){
|
|
|
1394 |
if((xf+x-cuadro_dimencion)<mouse.x &&(xf+x)>mouse.x && (y+yf-cuadro_dimencion)<mouse.y && (y+yf)>mouse.y){
|
|
|
1395 |
$(elemento).css("cursor","nw-resize");
|
|
|
1396 |
}else if((xf+x-cuadro_dimencion)<mouse.x &&(xf+x)>mouse.x && y<mouse.y && (y+cuadro_dimencion)>mouse.y){
|
|
|
1397 |
$(elemento).css("cursor","ne-resize");
|
|
|
1398 |
}else if(x<mouse.x &&(cuadro_dimencion+x)>mouse.x && y<mouse.y && (y+cuadro_dimencion)>mouse.y){
|
|
|
1399 |
$(elemento).css("cursor","se-resize");
|
|
|
1400 |
}else if(x<mouse.x &&(cuadro_dimencion+x)>mouse.x && (y+yf-cuadro_dimencion)<mouse.y &&(y+yf)>mouse.y){
|
|
|
1401 |
$(elemento).css("cursor","sw-resize");
|
|
|
1402 |
}else{
|
|
|
1403 |
$(elemento).css("cursor","move");
|
|
|
1404 |
}
|
4798 |
nelberth |
1405 |
}else{
|
|
|
1406 |
$(elemento).css("cursor","default");
|
|
|
1407 |
}
|
|
|
1408 |
}else if(texto_listo){
|
|
|
1409 |
if(tx-10<mouse.x && tx-10+txf>mouse.x && ty-10<mouse.y && ty-10+tyf>mouse.y){
|
|
|
1410 |
$(elemento).css("cursor","move");
|
|
|
1411 |
}else if((txf+tx-10)<mouse.x &&(txf+tx-10+20)>mouse.x && (ty-10+tyf)<mouse.y && (ty-10+tyf+20)>mouse.y){
|
|
|
1412 |
$(elemento).css("cursor","pointer");
|
|
|
1413 |
}else{
|
|
|
1414 |
$(elemento).css("cursor","default");
|
|
|
1415 |
}
|
|
|
1416 |
}
|
|
|
1417 |
else{
|
|
|
1418 |
$(elemento).css("cursor","default");
|
|
|
1419 |
}
|
|
|
1420 |
})
|
|
|
1421 |
$(elemento).mousedown(function(e){
|
|
|
1422 |
mouse = raton(this, e);
|
|
|
1423 |
if(!recorte_listo){
|
8334 |
nelberth |
1424 |
if(x<mouse.x &&(xf+x)>mouse.x && y<mouse.y && (y+yf)>mouse.y){
|
8333 |
nelberth |
1425 |
|
|
|
1426 |
if((xf+x-cuadro_dimencion)<mouse.x &&(xf+x)>mouse.x && (y+yf-cuadro_dimencion)<mouse.y && (y+yf)>mouse.y){
|
|
|
1427 |
t4 = true;
|
|
|
1428 |
}else if((xf+x-cuadro_dimencion)<mouse.x &&(xf+x)>mouse.x && y<mouse.y && (y+cuadro_dimencion)>mouse.y){
|
|
|
1429 |
t3 = true;
|
|
|
1430 |
}else if(x<mouse.x &&(cuadro_dimencion+x)>mouse.x && y<mouse.y && (y+cuadro_dimencion)>mouse.y){
|
|
|
1431 |
t1 = true;
|
|
|
1432 |
}else if(x<mouse.x &&(cuadro_dimencion+x)>mouse.x && (y+yf-cuadro_dimencion)<mouse.y &&(y+yf)>mouse.y){
|
|
|
1433 |
t2 = true;
|
|
|
1434 |
}else{
|
|
|
1435 |
cli = true;
|
|
|
1436 |
}
|
4798 |
nelberth |
1437 |
}
|
8333 |
nelberth |
1438 |
|
4798 |
nelberth |
1439 |
}else if(texto_listo){
|
|
|
1440 |
if(tx-10<mouse.x && tx-10+txf>mouse.x && ty-10<mouse.y && ty-10+tyf>mouse.y){
|
|
|
1441 |
tcli=true;
|
|
|
1442 |
}else if((txf+tx-10)<mouse.x &&(txf+tx-10+20)>mouse.x && (ty-10+tyf)<mouse.y && (ty-10+tyf+20)>mouse.y){
|
|
|
1443 |
rotar=true;
|
|
|
1444 |
}
|
|
|
1445 |
}
|
|
|
1446 |
|
|
|
1447 |
})
|
|
|
1448 |
|
10515 |
nelberth |
1449 |
$('.editorNoticia').mousemove(function(e){
|
4798 |
nelberth |
1450 |
mouse = raton(this, e);
|
10594 |
nelberth |
1451 |
//console.log("raton x: "+mouse.x+ " raton Y: " +mouse.y+ " xf: "+xf+" yf: "+yf)
|
10597 |
nelberth |
1452 |
//console.log('t1: '+t1+' t2: '+t2+' t3: '+t3+' t4: '+t4)
|
4798 |
nelberth |
1453 |
if(!recorte_listo){
|
|
|
1454 |
if(cli){
|
|
|
1455 |
if((mouse.y-(yf/2))>=0&&(mouse.y+(yf/2))<=alto){
|
|
|
1456 |
y = (mouse.y-(yf/2));
|
|
|
1457 |
}else{
|
|
|
1458 |
if((mouse.y-(yf/2))<0){
|
|
|
1459 |
y=0;
|
|
|
1460 |
}
|
|
|
1461 |
if((mouse.y+(yf/2))>alto){
|
|
|
1462 |
y=alto-yf;
|
|
|
1463 |
}
|
|
|
1464 |
}
|
|
|
1465 |
if((mouse.x-(xf/2))>=0&&(mouse.x+(xf/2))<=ancho){
|
|
|
1466 |
x = (mouse.x-(xf/2));
|
|
|
1467 |
}else{
|
|
|
1468 |
if((mouse.x-(xf/2))<0){
|
|
|
1469 |
x=0;
|
|
|
1470 |
}
|
|
|
1471 |
if((mouse.x+(xf/2))>ancho){
|
|
|
1472 |
x=(ancho)-xf;
|
|
|
1473 |
}
|
|
|
1474 |
}
|
|
|
1475 |
}
|
5492 |
nelberth |
1476 |
if(blockCelda){
|
|
|
1477 |
if(t4){
|
10494 |
nelberth |
1478 |
cal1=mouse.y-y;
|
|
|
1479 |
cal2=cal1/recorte;
|
10571 |
nelberth |
1480 |
cal3=x+cal2;
|
10564 |
nelberth |
1481 |
if(cal2>50){
|
10571 |
nelberth |
1482 |
if(cal3<=ancho&&mouse.y<=alto){
|
10568 |
nelberth |
1483 |
yf=cal1;
|
|
|
1484 |
xf=cal2;
|
10572 |
nelberth |
1485 |
}else if(cal3<=ancho&&mouse.y>alto){
|
|
|
1486 |
yf=alto-y;
|
|
|
1487 |
xf=yf/recorte
|
10571 |
nelberth |
1488 |
}else if(cal3>=ancho&&mouse.y<=alto){
|
10570 |
nelberth |
1489 |
xf=ancho-x;
|
10571 |
nelberth |
1490 |
yf=xf*recorte;
|
10568 |
nelberth |
1491 |
}
|
10489 |
nelberth |
1492 |
}
|
4798 |
nelberth |
1493 |
}
|
|
|
1494 |
if(t3){
|
10495 |
nelberth |
1495 |
cal1=yf+(y-mouse.y);
|
|
|
1496 |
cal2=cal1/recorte;
|
10572 |
nelberth |
1497 |
cal3=x+cal2;
|
10579 |
nelberth |
1498 |
if(cal2>50){
|
10572 |
nelberth |
1499 |
if(cal3<=ancho&&mouse.y>=0){
|
|
|
1500 |
yf=cal1;
|
|
|
1501 |
xf=cal2;
|
|
|
1502 |
y=mouse.y;
|
|
|
1503 |
}else if(cal3<=ancho&&mouse.y<0){
|
|
|
1504 |
yf=yf+y;
|
|
|
1505 |
xf=yf/recorte
|
|
|
1506 |
y=0;
|
11037 |
nelberth |
1507 |
}else if(cal3>=ancho&&mouse.y>=0){
|
10575 |
nelberth |
1508 |
xf=ancho-x;
|
10578 |
nelberth |
1509 |
y=y+(yf-xf*recorte);
|
10580 |
nelberth |
1510 |
yf=xf*recorte;
|
10572 |
nelberth |
1511 |
}
|
|
|
1512 |
|
10496 |
nelberth |
1513 |
}
|
|
|
1514 |
|
4798 |
nelberth |
1515 |
}
|
|
|
1516 |
if(t2){
|
10580 |
nelberth |
1517 |
|
10498 |
nelberth |
1518 |
cal1=mouse.y-y;
|
|
|
1519 |
cal2=cal1/recorte;
|
10580 |
nelberth |
1520 |
cal3=x+(yf-cal1)/recorte;cal2;
|
|
|
1521 |
if(cal2>50){
|
|
|
1522 |
if(cal3>=0&&mouse.y<=alto){
|
|
|
1523 |
x=cal3;
|
|
|
1524 |
yf=cal1;
|
|
|
1525 |
xf=cal2;
|
11241 |
nelberth |
1526 |
}else if(cal3>0&&mouse.y>alto){
|
10580 |
nelberth |
1527 |
yf=alto-y;
|
10583 |
nelberth |
1528 |
x=x+(xf-yf/recorte);
|
10580 |
nelberth |
1529 |
xf=yf/recorte
|
11241 |
nelberth |
1530 |
}else if(cal3<0&&mouse.y<=alto){
|
10584 |
nelberth |
1531 |
xf=xf+x;
|
|
|
1532 |
yf=xf*recorte;
|
|
|
1533 |
x=0;
|
10580 |
nelberth |
1534 |
}
|
10586 |
nelberth |
1535 |
}
|
10499 |
nelberth |
1536 |
|
5215 |
nelberth |
1537 |
}
|
|
|
1538 |
if(t1){
|
10506 |
nelberth |
1539 |
cal0=y-mouse.y;
|
|
|
1540 |
cal1=yf+cal0;
|
10500 |
nelberth |
1541 |
cal2=cal1/recorte;
|
10506 |
nelberth |
1542 |
cal3=x-cal0/recorte;
|
10586 |
nelberth |
1543 |
if(cal2>50){
|
|
|
1544 |
if(cal3>=0&&mouse.y>=0){
|
|
|
1545 |
yf=cal1;
|
|
|
1546 |
xf=cal2;
|
|
|
1547 |
x=cal3;
|
|
|
1548 |
y=mouse.y;
|
11243 |
nelberth |
1549 |
}else if(cal3>0&&mouse.y<0){
|
10590 |
nelberth |
1550 |
yf=yf+y;
|
|
|
1551 |
x=x+(xf-yf/recorte);
|
10586 |
nelberth |
1552 |
xf=yf/recorte
|
10590 |
nelberth |
1553 |
y=0;
|
11038 |
nelberth |
1554 |
}else if(cal3<0&&mouse.y>=0){
|
10589 |
nelberth |
1555 |
xf=xf+x;
|
10588 |
nelberth |
1556 |
y=y+(yf-xf*recorte);
|
10586 |
nelberth |
1557 |
yf=xf*recorte;
|
|
|
1558 |
x=0;
|
|
|
1559 |
}
|
|
|
1560 |
}
|
|
|
1561 |
|
10504 |
nelberth |
1562 |
}
|
5492 |
nelberth |
1563 |
}else{
|
10586 |
nelberth |
1564 |
if(t4){
|
10537 |
nelberth |
1565 |
|
10541 |
nelberth |
1566 |
cal1=mouse.y-y;
|
|
|
1567 |
cal2=mouse.x-x;
|
|
|
1568 |
if(cal1>50){
|
|
|
1569 |
yf=mouse.y<=alto?cal1:alto-y;
|
|
|
1570 |
}
|
|
|
1571 |
if(cal2>50){
|
|
|
1572 |
xf=mouse.x<=ancho?cal2:ancho-x;
|
|
|
1573 |
}
|
5215 |
nelberth |
1574 |
}
|
10543 |
nelberth |
1575 |
|
5215 |
nelberth |
1576 |
if(t3){
|
10542 |
nelberth |
1577 |
cal1=yf-(mouse.y-y);
|
|
|
1578 |
cal2=mouse.x-x;
|
|
|
1579 |
if(cal1>50){
|
10553 |
nelberth |
1580 |
|
10551 |
nelberth |
1581 |
if(mouse.y>=0){
|
|
|
1582 |
yf=cal1;
|
|
|
1583 |
y=mouse.y;
|
|
|
1584 |
}else{
|
10552 |
nelberth |
1585 |
yf=yf+y;
|
10551 |
nelberth |
1586 |
y=0;
|
|
|
1587 |
}
|
10542 |
nelberth |
1588 |
}
|
|
|
1589 |
if(cal2>50){
|
10547 |
nelberth |
1590 |
xf=mouse.x<=ancho?cal2:ancho-x;
|
10542 |
nelberth |
1591 |
}
|
10543 |
nelberth |
1592 |
}
|
5332 |
nelberth |
1593 |
/* Izquierda abajo */
|
5215 |
nelberth |
1594 |
if(t2){
|
10555 |
nelberth |
1595 |
cal1=mouse.y-y;
|
|
|
1596 |
cal2=xf-(mouse.x-x);
|
|
|
1597 |
if(cal1>50){
|
|
|
1598 |
yf=yf=mouse.y<=alto?cal1:alto-y;
|
|
|
1599 |
}
|
|
|
1600 |
if(cal2>50){
|
10556 |
nelberth |
1601 |
if(mouse.x>=0){
|
10555 |
nelberth |
1602 |
xf=cal2;
|
10559 |
nelberth |
1603 |
x=mouse.x;
|
10555 |
nelberth |
1604 |
}else{
|
|
|
1605 |
xf=xf+x;
|
|
|
1606 |
x=0;
|
|
|
1607 |
}
|
|
|
1608 |
}
|
4798 |
nelberth |
1609 |
}
|
5332 |
nelberth |
1610 |
/* izquierda arriba */
|
4798 |
nelberth |
1611 |
if(t1){
|
10560 |
nelberth |
1612 |
|
|
|
1613 |
cal1=yf-(mouse.y-y);
|
|
|
1614 |
cal2=xf-(mouse.x-x);
|
|
|
1615 |
if(cal1>50){
|
|
|
1616 |
|
|
|
1617 |
if(mouse.y>=0){
|
|
|
1618 |
yf=cal1;
|
|
|
1619 |
y=mouse.y;
|
|
|
1620 |
}else{
|
|
|
1621 |
yf=yf+y;
|
|
|
1622 |
y=0;
|
|
|
1623 |
}
|
|
|
1624 |
}
|
|
|
1625 |
if(cal2>50){
|
|
|
1626 |
if(mouse.x>=0){
|
|
|
1627 |
xf=cal2;
|
|
|
1628 |
x=mouse.x;
|
|
|
1629 |
}else{
|
|
|
1630 |
xf=xf+x;
|
|
|
1631 |
x=0;
|
|
|
1632 |
}
|
|
|
1633 |
}
|
10562 |
nelberth |
1634 |
|
4798 |
nelberth |
1635 |
}
|
11032 |
nelberth |
1636 |
}
|
4798 |
nelberth |
1637 |
|
|
|
1638 |
actualizar();
|
|
|
1639 |
}else if(texto_listo){
|
|
|
1640 |
if(tcli){
|
|
|
1641 |
tx=mouse.x-(txf/2)
|
|
|
1642 |
ty=mouse.y-(tyf/2)
|
|
|
1643 |
}else if(rotar){
|
|
|
1644 |
|
|
|
1645 |
}
|
|
|
1646 |
|
|
|
1647 |
actualizar2();
|
|
|
1648 |
}
|
|
|
1649 |
})
|
10446 |
nelberth |
1650 |
$('body').mouseup(function(e){
|
10599 |
nelberth |
1651 |
console.log('levanto el mouse')
|
4798 |
nelberth |
1652 |
if(!recorte_listo){
|
|
|
1653 |
cli=false;
|
|
|
1654 |
t1=false;
|
|
|
1655 |
t2=false;
|
|
|
1656 |
t3=false;
|
|
|
1657 |
t4=false;
|
|
|
1658 |
}else if (texto_listo) {
|
|
|
1659 |
tcli=false;
|
|
|
1660 |
}
|
|
|
1661 |
})
|
|
|
1662 |
|
5129 |
nelberth |
1663 |
|
4798 |
nelberth |
1664 |
}
|
5500 |
nelberth |
1665 |
/* Titulo */
|
5501 |
nelberth |
1666 |
|
6073 |
nelberth |
1667 |
var titulo_noticia, censor_titulo = true, numero_titulo=0;
|
5500 |
nelberth |
1668 |
$(document).on("keyup change", "#name", function(e){
|
5501 |
nelberth |
1669 |
console.log(numero_titulo)
|
5500 |
nelberth |
1670 |
titulo_noticia = $(this).val();
|
|
|
1671 |
titulo_elemento= $(".titulo_topico");
|
|
|
1672 |
if(titulo_noticia!=""){
|
5505 |
nelberth |
1673 |
if(censor_titulo){
|
5500 |
nelberth |
1674 |
titulo_elemento.html(titulo_noticia);
|
|
|
1675 |
if(titulo_elemento.height()>38){
|
5508 |
nelberth |
1676 |
var titulo_noticia2 = "";
|
5500 |
nelberth |
1677 |
for(var i =0; i <titulo_noticia.length;i++){
|
|
|
1678 |
titulo_noticia2 = titulo_noticia2 + titulo_noticia.split("")[i];
|
|
|
1679 |
titulo_elemento.html(titulo_noticia2);
|
|
|
1680 |
if(titulo_elemento.height()>38){
|
|
|
1681 |
titulo_noticia2 = titulo_noticia2.slice(0,-5) + "...";
|
|
|
1682 |
titulo_elemento.html(titulo_noticia2);
|
|
|
1683 |
numero_titulo = titulo_noticia2.length;
|
|
|
1684 |
censor_titulo=false;
|
|
|
1685 |
break;
|
|
|
1686 |
}
|
4798 |
nelberth |
1687 |
|
5500 |
nelberth |
1688 |
}
|
|
|
1689 |
}else{
|
|
|
1690 |
numero_titulo=0;
|
|
|
1691 |
}
|
|
|
1692 |
}else{
|
|
|
1693 |
if(numero_titulo+1>=titulo_noticia.length){
|
|
|
1694 |
titulo_elemento.html(titulo_noticia);
|
|
|
1695 |
censor_titulo=true;
|
|
|
1696 |
}
|
5505 |
nelberth |
1697 |
}
|
5500 |
nelberth |
1698 |
}else{
|
5741 |
nelberth |
1699 |
titulo_elemento.html("LABEL_TITLE_TOPIC");
|
5500 |
nelberth |
1700 |
censor_titulo = true;
|
|
|
1701 |
}
|
|
|
1702 |
})
|
1 |
www |
1703 |
});
|
|
|
1704 |
JS;
|
|
|
1705 |
$this->inlineScript()->captureEnd();
|
|
|
1706 |
?>
|
|
|
1707 |
|
14934 |
stevensc |
1708 |
|
|
|
1709 |
|
1 |
www |
1710 |
<!-- Content Header (Page header) -->
|
|
|
1711 |
<section class="content-header">
|
|
|
1712 |
<div class="container-fluid">
|
14934 |
stevensc |
1713 |
<div class="row mb-2">
|
|
|
1714 |
<div class="col-sm-12">
|
|
|
1715 |
<h1>LABEL_TOPICS</h1>
|
1 |
www |
1716 |
</div>
|
|
|
1717 |
</div>
|
|
|
1718 |
</div><!-- /.container-fluid -->
|
|
|
1719 |
</section>
|
|
|
1720 |
|
4693 |
nelberth |
1721 |
<section class="content" id='content1'>
|
1 |
www |
1722 |
<div class="container-fluid">
|
14934 |
stevensc |
1723 |
<div class="row">
|
|
|
1724 |
<div class="col-12">
|
|
|
1725 |
<div class="card">
|
1 |
www |
1726 |
<div class="card-body">
|
16845 |
efrain |
1727 |
<table id="gridTable" class="table table-bordered">
|
14934 |
stevensc |
1728 |
<thead>
|
|
|
1729 |
<tr>
|
|
|
1730 |
<th>LABEL_NAME</th>
|
|
|
1731 |
<th>LABEL_STATUS</th>
|
|
|
1732 |
<th>LABEL_DETAILS</th>
|
|
|
1733 |
<th>LABEL_ACTIONS</th>
|
|
|
1734 |
</tr>
|
|
|
1735 |
</thead>
|
|
|
1736 |
<tbody>
|
|
|
1737 |
</tbody>
|
|
|
1738 |
</table>
|
|
|
1739 |
</div>
|
|
|
1740 |
<div class="card-footer clearfix">
|
|
|
1741 |
<div style="float:right;">
|
|
|
1742 |
<button type="button" class="btn btn-info btn-refresh"><i class="fa fa-refresh"></i> LABEL_REFRESH </button>
|
|
|
1743 |
<?php if ($allowAdd) : ?>
|
|
|
1744 |
<button type="button" class="btn btn-primary btn-add"><i class="fa fa-plus"></i> LABEL_ADD </button>
|
1 |
www |
1745 |
<?php endif; ?>
|
|
|
1746 |
</div>
|
14934 |
stevensc |
1747 |
</div>
|
|
|
1748 |
</div>
|
|
|
1749 |
</div>
|
|
|
1750 |
</div>
|
|
|
1751 |
</div>
|
|
|
1752 |
</section>
|
5467 |
nelberth |
1753 |
<section id="addImage" style='display:none' class="">
|
14934 |
stevensc |
1754 |
<div class="d-flex justify-content-center tituloEditor">
|
16845 |
efrain |
1755 |
<h4>LABEL_ADD_TOPIC</h6>
|
5463 |
nelberth |
1756 |
|
14934 |
stevensc |
1757 |
</div>
|
|
|
1758 |
<div class="grid-padre">
|
|
|
1759 |
<?php
|
|
|
1760 |
$form = $this->formAdd;
|
|
|
1761 |
$form->setAttributes([
|
|
|
1762 |
'method' => 'post',
|
|
|
1763 |
'action' => $routeAdd,
|
|
|
1764 |
'name' => 'form-topic-add',
|
|
|
1765 |
'id' => 'form-topic-add',
|
|
|
1766 |
]);
|
5678 |
nelberth |
1767 |
|
14934 |
stevensc |
1768 |
$form->prepare();
|
|
|
1769 |
echo $this->form()->openTag($form);
|
|
|
1770 |
?>
|
|
|
1771 |
<div class="form-group grid-1-2">
|
|
|
1772 |
<?php
|
|
|
1773 |
$element = $form->get('name');
|
10917 |
nelberth |
1774 |
|
14934 |
stevensc |
1775 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
1776 |
$element->setOptions(['label' => 'LABEL_NAME']);
|
|
|
1777 |
echo $this->formLabel($element);
|
|
|
1778 |
echo $this->formText($element);
|
|
|
1779 |
?>
|
|
|
1780 |
</div>
|
5916 |
nelberth |
1781 |
|
14934 |
stevensc |
1782 |
<div class="form-group grid-1-2">
|
|
|
1783 |
<?php
|
|
|
1784 |
$element = $form->get('description');
|
|
|
1785 |
$element->setAttributes(['id' => 'description_add', 'class' => 'form-control', 'rows' => '2', 'class' => 'form-control']);
|
|
|
1786 |
$element->setOptions(['label' => 'LABEL_DESCRIPTION']);
|
|
|
1787 |
echo $this->formLabel($element);
|
|
|
1788 |
echo $this->formTextArea($element);
|
|
|
1789 |
?>
|
|
|
1790 |
</div>
|
|
|
1791 |
<div class="form-group grid-1-2">
|
|
|
1792 |
<?php
|
|
|
1793 |
$element = $form->get('order');
|
|
|
1794 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
1795 |
$element->setOptions(['label' => 'LABEL_ORDER']);
|
|
|
1796 |
echo $this->formLabel($element);
|
|
|
1797 |
echo $this->formText($element);
|
|
|
1798 |
?>
|
|
|
1799 |
</div>
|
5462 |
nelberth |
1800 |
|
14934 |
stevensc |
1801 |
<?php
|
|
|
1802 |
$element = $form->get('file');
|
|
|
1803 |
$element->setAttributes(['class' => 'file']);
|
|
|
1804 |
echo $this->formHidden($element); ?>
|
|
|
1805 |
|
|
|
1806 |
<div class="form-group grid-1-2">
|
|
|
1807 |
<?php
|
|
|
1808 |
$element = $form->get('status');
|
|
|
1809 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
1810 |
$element->setOptions(['label' => 'LABEL_STATUS']);
|
|
|
1811 |
echo $this->formLabel($element);
|
|
|
1812 |
echo $this->formSelect($element);
|
|
|
1813 |
?>
|
|
|
1814 |
</div>
|
|
|
1815 |
|
|
|
1816 |
<div class="contenido form-group" id="contenido">
|
|
|
1817 |
|
|
|
1818 |
|
|
|
1819 |
</div>
|
|
|
1820 |
|
|
|
1821 |
|
|
|
1822 |
<?php echo $this->form()->closeTag($form); ?>
|
|
|
1823 |
</div>
|
|
|
1824 |
|
|
|
1825 |
|
4691 |
nelberth |
1826 |
</section>
|
1 |
www |
1827 |
|
5895 |
nelberth |
1828 |
<section id="topicEdit" style='display:none' class="">
|
14934 |
stevensc |
1829 |
<div class="d-flex justify-content-center tituloEditor">
|
16845 |
efrain |
1830 |
<h4>LABEL_EDIT_TOPIC</h6>
|
1 |
www |
1831 |
|
14934 |
stevensc |
1832 |
</div>
|
|
|
1833 |
<div class="grid-padre">
|
|
|
1834 |
<?php
|
|
|
1835 |
$form = $this->formEdit;
|
|
|
1836 |
$form->setAttributes([
|
|
|
1837 |
'method' => 'post',
|
|
|
1838 |
'name' => 'form-topic-edit',
|
|
|
1839 |
'id' => 'form-topic-edit'
|
|
|
1840 |
]);
|
5895 |
nelberth |
1841 |
|
14934 |
stevensc |
1842 |
$form->prepare();
|
|
|
1843 |
echo $this->form()->openTag($form);
|
|
|
1844 |
?>
|
|
|
1845 |
<div class="form-group grid-1-2">
|
|
|
1846 |
<?php
|
|
|
1847 |
$element = $form->get('name');
|
1 |
www |
1848 |
|
14934 |
stevensc |
1849 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
1850 |
$element->setOptions(['label' => 'LABEL_NAME']);
|
|
|
1851 |
echo $this->formLabel($element);
|
|
|
1852 |
echo $this->formText($element);
|
|
|
1853 |
?>
|
|
|
1854 |
</div>
|
|
|
1855 |
<div class="form-group grid-1-2">
|
|
|
1856 |
<?php
|
|
|
1857 |
$element = $form->get('description');
|
|
|
1858 |
$element->setAttributes(['id' => 'description_edit', 'rows' => '2', 'class' => 'form-control', 'class' => 'form-control']);
|
|
|
1859 |
$element->setOptions(['label' => 'LABEL_DESCRIPTION']);
|
|
|
1860 |
echo $this->formLabel($element);
|
|
|
1861 |
echo $this->formTextArea($element);
|
|
|
1862 |
?>
|
|
|
1863 |
</div>
|
|
|
1864 |
<div class="form-group grid-1-2">
|
|
|
1865 |
<?php
|
|
|
1866 |
$element = $form->get('order');
|
|
|
1867 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
1868 |
$element->setOptions(['label' => 'LABEL_ORDER']);
|
|
|
1869 |
echo $this->formLabel($element);
|
|
|
1870 |
echo $this->formText($element);
|
|
|
1871 |
?>
|
|
|
1872 |
</div>
|
1 |
www |
1873 |
|
14934 |
stevensc |
1874 |
<?php
|
|
|
1875 |
$element = $form->get('file');
|
|
|
1876 |
$element->setAttributes(['class' => 'file']);
|
|
|
1877 |
echo $this->formHidden($element);
|
|
|
1878 |
?>
|
|
|
1879 |
|
|
|
1880 |
<div class="form-group grid-1-2">
|
|
|
1881 |
<?php
|
|
|
1882 |
$element = $form->get('status');
|
|
|
1883 |
$element->setAttributes(['class' => 'form-control']);
|
|
|
1884 |
$element->setOptions(['label' => 'LABEL_STATUS']);
|
|
|
1885 |
echo $this->formLabel($element);
|
|
|
1886 |
echo $this->formSelect($element);
|
|
|
1887 |
?>
|
|
|
1888 |
</div>
|
|
|
1889 |
|
|
|
1890 |
<div class="contenido form-group" id="contenido2">
|
|
|
1891 |
</div>
|
|
|
1892 |
|
|
|
1893 |
<?php echo $this->form()->closeTag($form); ?>
|
|
|
1894 |
</div>
|
|
|
1895 |
|
|
|
1896 |
|
5895 |
nelberth |
1897 |
</section>
|
1 |
www |
1898 |
|
|
|
1899 |
|
14934 |
stevensc |
1900 |
|
1 |
www |
1901 |
<!-- The Modal -->
|
|
|
1902 |
<div class="modal" id="modalImageApp">
|
|
|
1903 |
<div class="modal-dialog ">
|
14934 |
stevensc |
1904 |
<div class="modal-content">
|
1 |
www |
1905 |
|
14934 |
stevensc |
1906 |
<!-- Modal Header -->
|
|
|
1907 |
<div class="modal-header">
|
16845 |
efrain |
1908 |
<h6 class="modal-title">LABEL_IMAGE</h6>
|
16822 |
efrain |
1909 |
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="btn-close"></button>
|
14934 |
stevensc |
1910 |
</div>
|
1 |
www |
1911 |
|
14934 |
stevensc |
1912 |
<!-- Modal body -->
|
|
|
1913 |
<div class="modal-body text-center">
|
1 |
www |
1914 |
<img src="" class="img img-responsive" style="width: 300px; height: auto" id="image-app" />
|
14934 |
stevensc |
1915 |
</div>
|
|
|
1916 |
|
|
|
1917 |
<!-- Modal footer -->
|
|
|
1918 |
<div class="modal-footer">
|
16822 |
efrain |
1919 |
<button type="button" class="btn btn-light" data-bs-dismiss="modal">LABEL_CLOSE</button>
|
14934 |
stevensc |
1920 |
</div>
|
|
|
1921 |
</div>
|
1 |
www |
1922 |
</div>
|
14934 |
stevensc |
1923 |
</div>
|