PageSourceSearch

https://tickets.zamekloucen.cz/vstupenky/Scripts/dragAndDrop.js

js zamekloucen.cz collected 2026-10-02 11:08:42 UTC 3,017 bytes, 89 lines download raw bytes

1$(document).ready(function () {
2    $('.dad-container').dad({ draggable: '.handle' });
3    var wrappers = $('.drag-drop-wrapper');
4    for (var i = 0; i < wrappers.length; i++) {
5        $(wrappers[i]).find('.admin-header > .admin-visibilty').click(function () {
6            setDraggableVisibility($(this));
7        });
8        $(wrappers[i]).find('.admin-header > .admin-delete').click(function () {
9            deleteDragAndDropControl($(this).attr('data-auto'));
10        });
11        $(wrappers[i]).find('#btn-save-dad-order').click(function () {
12            saveDragAndDropControlsOrder(wrappers[i]);
13        });
14    }
15});
16
17function setDraggableVisibility(eye) {
18    var visible = false;
19    if (eye.hasClass('admin-is-visible')) {
20        eye.removeClass('admin-is-visible');
21        eye.addClass('admin-is-hidden');
22        visible = false;
23    }
24    else {
25        eye.removeClass('admin-is-hidden');
26        eye.addClass('admin-is-visible');
27        visible = true;
28    }
29    var auto = parseInt(eye.attr('data-auto'));
30    $.ajax({
31        url: rootUrl + 'Administration/DragAndDropControlVisibility/',
32        dataType: "json",
33        type: "POST",
34        cache: false,
35        data: { auto: auto, visible: visible },
36        success: function (result) {
37            if (result !== null && result.Result) {
38                alertify.success('Změna viditelnosti proběhla úspěšně.');
39            }
40        },
41        error: function (xhr) {
42            alertify.error('Změna viditelnosti se nepodařila.');
43        }
44    });
45}
46
47function deleteDragAndDropControl(auto) {
48    $.ajax({
49        url: rootUrl + 'Administration/DragAndDropControlDelete/',
50        dataType: "json",
51        type: "POST",
52        cache: false,
53        data: { auto: auto },
54        success: function (result) {
55            if (result !== null && result.Result) {
56                $('div[data-control-auto="' + result.Auto + '"]').parent().remove();
57                alertify.success('Blok byl úspěšně smazán.');
58            }
59        },
60        error: function (xhr) {
61            alertify.error('Smazání bloku se nezdařilo.');
62        }
63    });
64}
65
66function saveDragAndDropControlsOrder(wrapper) {
67    var items = $(wrapper).find('.admin-header');
68    var result = '';
69
70    for (var i = 0; i < items.length; i++) {
71        result += $(items[i]).attr('data-control-auto') + '$' + $(items[i]).attr('data-dad-position') + '#';
72    }
73
74    $.ajax({
75        url: rootUrl + 'Administration/SaveDragAndDropControlsOrder/',
76        dataType: "json",
77        type: "POST",
78        cache: false,
79        data: { data: result },
80        success: function (result) {
81            if (result !== null && result.Result) {
82                alertify.success('Pořadí bylo úspěšně změněno.');
83            }
84        },
85        error: function (xhr) {
86            alertify.error('Nepodařilo se uložit změny v pořadí.');
87        }
88    });
89}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.