__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
/**
* @package Helix3 Framework
* @author JoomShaper https://www.joomshaper.com
* @copyright (c) 2010 - 2021 JoomShaper
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or Later
*/
jQuery(function ($) {
$(".sp-gallery-field").each(function (index, el) {
var $field = $(el);
// Upload form
$field.find(".btn-sp-gallery-item-upload").on("click", function (event) {
event.preventDefault();
$field.find(".sp-gallery-item-upload").click();
});
//Sortable
$field.find(".sp-gallery-items").sortable({
stop: function (event, ui) {
// Set Value
var images = [];
$.each($field.find(".sp-gallery-items").find(">li"), function (index, value) {
images.push('"' + $(value).data("src") + '"');
});
var output = '{"' + $field.find(".form-field-spgallery").data("name") + '":[' + images + "]}";
$field.find(".form-field-spgallery").val(output);
},
});
//Upload
$field.find(".sp-gallery-item-upload").on("change", function (e) {
e.preventDefault();
var $this = $(this);
var file = $(this).prop("files")[0];
var data = new FormData();
data.append("option", "com_ajax");
data.append("plugin", "helix3");
data.append("action", "upload_image");
data.append("format", "json");
if (file.type.match(/image.*/)) {
data.append("image", file);
$.ajax({
type: "POST",
data: data,
contentType: false,
cache: false,
processData: false,
beforeSend: function () {
$this.prop("disabled", true);
$field.find(".btn-sp-gallery-item-upload").attr("disabled", "disabled");
var loader = $(
'<li class="sp-gallery-item-loader"><i class="fa fa-circle-o-notch fa-spin"></i></li>'
);
$this.prev(".sp-gallery-items").append(loader);
},
success: function (response) {
var data = $.parseJSON(response);
if (data.status) {
$field.find(".sp-gallery-item-loader").before(data.output);
} else {
alert(data.output);
}
$this.val("");
$this.prev(".sp-gallery-items").find(".sp-gallery-item-loader").remove();
$this.prop("disabled", false);
$field.find(".btn-sp-gallery-item-upload").removeAttr("disabled");
var images = [];
$.each($field.find(".sp-gallery-items").find(">li"), function (index, value) {
images.push('"' + $(value).data("src") + '"');
});
var output = '{"' + $field.find(".form-field-spgallery").data("name") + '":[' + images + "]}";
$(".form-field-spgallery").val(output);
},
error: function () {
$this.prev(".sp-gallery-items").find(".sp-gallery-item-loader").remove();
$this.val("");
},
});
}
$this.val("");
});
});
// Delete Image
$(document).on("click", ".btn-remove-image", function (event) {
event.preventDefault();
var $this = $(this);
if (confirm("You are about to permanently delete this item. 'Cancel' to stop, 'OK' to delete.") == true) {
var request = {
option: "com_ajax",
plugin: "helix3",
action: "remove_image",
src: $(this).parent().data("src"),
format: "json",
};
$.ajax({
type: "POST",
data: request,
success: function (response) {
var data = $.parseJSON(response);
if (data.status) {
$this.parent().remove();
var images = [];
$.each($(".sp-gallery-items").find(">li"), function (index, value) {
images.push('"' + $(value).data("src") + '"');
});
var output = '{"' + $(".form-field-spgallery").data("name") + '":[' + images + "]}";
$(".form-field-spgallery").val(output);
} else {
alert(data.output);
}
},
});
}
});
});
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| admin.general.j4.js | File | 6.38 KB | 0664 |
|
| admin.general.js | File | 7.33 KB | 0664 |
|
| admin.layout.j4.js | File | 13.55 KB | 0664 |
|
| admin.layout.js | File | 14.68 KB | 0664 |
|
| bootstrap.legacy.js | File | 3.46 KB | 0664 |
|
| helper.j4.js | File | 716 B | 0664 |
|
| helper.js | File | 2.2 KB | 0664 |
|
| jquery-ui.draggable.min.js | File | 31.2 KB | 0664 |
|
| jquery-ui.min.js | File | 247.72 KB | 0664 |
|
| jquery.ui.core.min.js | File | 20.72 KB | 0664 |
|
| jquery.ui.sortable.min.js | File | 23.85 KB | 0664 |
|
| menu.generator.js | File | 7.84 KB | 0664 |
|
| modal.js | File | 6.15 KB | 0664 |
|
| post-formats.js | File | 1.56 KB | 0664 |
|
| spgallery.js | File | 3.59 KB | 0664 |
|
| spimage.js | File | 3.28 KB | 0664 |
|
| webfont.js | File | 4.47 KB | 0664 |
|