| Server IP : 162.214.74.102 / Your IP : 216.73.216.192 Web Server : Apache System : Linux dedi-4363141.lrsys.com.br 3.10.0-1160.119.1.el7.tuxcare.els25.x86_64 #1 SMP Wed Oct 1 17:37:27 UTC 2025 x86_64 User : lrsys ( 1015) PHP Version : 5.6.40 Disable Function : exec,passthru,shell_exec,system MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/lrsys/public_html/lrsys_apps/gasch/application/plugins/module_cms/assets/js/ |
Upload File : |
/* global existingFiles */
/*
JS do plugin criado
*/
$(document).ready(function() {
var _url = $("#_url").val();
$('.add-poll').on('click', function () {
var cloned = $(this).parent().clone(false);
cloned.css('margin-top', '20px');
cloned.find('input').val('');
cloned.find('.add-poll')
.removeClass('md-btn-success add-poll')
.addClass('md-btn-danger remove-poll')
.css('border', '1px solid #e94033');
cloned.find('i')
.removeClass('fa-plus')
.addClass('fa-trash');
$('.append-poll').append(cloned);
});
$('body').on('click', '.remove-poll', function() {
$(this).parent().remove();
});
$('#text').redactor(
{
imageResizable: true,
imagePosition: true,
minHeight: 200,
imageTag: 'figure',
imageUpload: _url + "module_cms/image/create",
plugins: ['fontcolor']
}
);
////////////////////////IMAGES
var upload_resp;
var $ib_form_submit = $("#submit");
var ib_file = new Dropzone("#upload_container",
{
url: _url + "module_cms/image/create",
acceptedFiles: "image/*",
addRemoveLinks: true,
dictRemoveFile: "Remove",
dictCancelUpload: "Cancel",
maxFiles:1,init: function() {
this.hiddenFileInput.removeAttribute('multiple');
},
removedfile: function (file) {
var id = $("#articleId").val();
$.ajax({
type: 'POST',
url: _url + 'module_cms/article/deleteImage',
data: 'id=' + id,
dataType: 'html'
}).done(function (data) {
var obj = JSON.parse(data);
toastr.success(obj.msg);
if (obj.status == 'OK') {
$('#cms_image_id').val('');
var _ref;
return (_ref = file.previewElement) != null ? _ref.parentNode.removeChild(file.previewElement) : void 0;
}
});
}
}
);
ib_file.on("sending", function () {
$ib_form_submit.prop('disabled', true);
});
ib_file.on("success", function (file, response) {
$ib_form_submit.prop('disabled', false);
upload_resp = response;
if (upload_resp.success == true) {
$('#cms_image_id').val(upload_resp.id);
file.id = upload_resp.id;
toastr.success(upload_resp.msg);
} else {
toastr.error(upload_resp.msg);
ib_file.removeFile(file);
}
});
if (typeof existingFiles !== 'undefined') {
for (var i = 0; i < existingFiles.length; i++) {
ib_file.emit("addedfile", existingFiles[i]);
ib_file.createThumbnailFromUrl(existingFiles[i], existingFiles[i].url);
ib_file.emit("complete", existingFiles[i]);
}
}
/////////////////////////FIM IMAGES
});