PageSourceSearch

https://registro.techshowmadrid.es/Scripts/form_section_extra_activity.js

js techshowmadrid.es collected 2026-10-03 20:54:18 UTC 4,760 bytes, 99 lines download raw bytes

1function ExtraActivity_SetRowEvents($tr) {
2
3    $tr.mouseover(function () { $(this).addClass("css-extra-activity-row-over") })
4    $tr.mouseout(function () { $(this).removeClass("css-extra-activity-row-over") })
5
6    $tr.find("input").change(function () {
7        ExtraActivity_SaveCheckedContacts($tr)
8        console.log("ExtraActivity_SetRowEvents.input.change.2")
9        $("#saveButton").removeAttr("disabled")
10    })
11
12    $tr.dblclick(function (e) {
13        var $chk = $(this).find("input")
14        $chk.prop("checked", !$chk.prop("checked"))
15        $chk.trigger("change")
16    })
17}
18function ExtraActivity_SaveCheckedContacts($tr) {
19    var $parent = $tr.closest("[data-is-extra-activity=true]"),
20        $hidden = $parent.find("#Json_ExtraActivity_SelectedContactsInfo"),
21        $table = $parent.find("[data-is-extra-activity-table]"),
22        selectedContactsInfo = {
23            BuyOptionId: $parent.attr("data-extra-activity-buyoption-id"),
24            SelectedContactsIndexes: []
25        }
26
27    // console.log("ExtraActivity_SaveCheckedContacts.Parent", $parent)
28    // console.log("ExtraActivity_SaveCheckedContacts.Hidden", $hidden)
29
30    var selectedIds = new Array()
31    $table.find("input[type=checkbox]:checked").each(function (e) {
32        var $chk = $(this),
33            id = $chk.closest("tr").attr("data-contact-index")
34
35        selectedIds.push(id)
36    })
37
38    selectedContactsInfo.SelectedContactsIndexes = selectedIds
39
40    // $hidden.val(selectedIds.join())
41    $hidden.val(JSON.stringify(selectedContactsInfo))
42    // alert("Pendiente guardar id contactos chequeados: " + $hidden.val())
43}
44
45/* Los script de los formularios deben sobrescribir esta función (!EN EL LAYOUT!) si se desea cambiar el tipo de datos a mostrar o el número de columnas */
46function ExtraActivity_FillContactsTable($ExtraActivityDiv, $ContactSourceDiv, arrCurrentSelectedIndexes) {
47
48    // console.log("$ExtraActivityDiv", $ExtraActivityDiv)
49    // console.log("$ContactSourceDiv", $ContactSourceDiv)
50    // console.log("arrCurrentSelectedIndexes", arrCurrentSelectedIndexes)
51
52    var $table = $ExtraActivityDiv.find("[data-is-extra-activity-table]"),
53        row = '<tr data-contact-index="[CONTACT_INDEX]">' +
54            '<td class="css-cd-check"><input type="checkbox" class="css-extra-activity-check" /></td>' +
55            '<td class="css-cd-companyname">[COMPANY_NAME]</td>' +
56            '<td class="css-cd-contact-type">[CONTACT_TYPE]</td>' +
57            '<td class="css-cd-fullname">[FULLNAME]</td>' +
58            '<td class="css-cd-position">[POSITION]</td>' +
59            '</tr>',
60        contactIndex = parseInt($ContactSourceDiv.attr("data-current-section-index"), 10),
61        qty = $ExtraActivityDiv.find("[data-is-extra-activity]").attr("data-extra-activity-quantity"),
62        headerContent = $ExtraActivityDiv.find("[data-is-extra-activity-presentation]").html(),
63        contactType = $ContactSourceDiv.attr("data-parent-buy-option-contact-type-name"),
64
65        nombreEmpresa = $ContactSourceDiv.find("[ng-model='contacts" + (contactIndex + 1) + "_CompanyName2']").val(),
66        nombre = $ContactSourceDiv.find("[ng-model='contacts" + (contactIndex + 1) + "_Name']").val(),
67        apellido1 = $ContactSourceDiv.find("[ng-model='contacts" + (contactIndex + 1) + "_Surname']").val(),
68        apellido2 = $ContactSourceDiv.find("[ng-model='contacts" + (contactIndex + 1) + "_Surname2']").val(),
69        cargo = $ContactSourceDiv.find("[ng-model='contacts" + (contactIndex + 1) + "_Position']").val(),
70        fullName = $.trim(nombre) + " " + $.trim(apellido1) + " " + $.trim(apellido2),
71        checked = false
72
73    console.log("headerContent-fgp", headerContent)
74
75    if (arrCurrentSelectedIndexes && arrCurrentSelectedIndexes.length > 0)
76        checked = arrCurrentSelectedIndexes.indexOf($ContactSourceDiv.attr("data-current-section-index")) >= 0
77
78    if (headerContent)
79        headerContent = headerContent.replace("[EXTRA_ACTITIVY_QUANTITY]", qty)
80    $ExtraActivityDiv.find("[data-is-extra-activity-presentation]").html(headerContent)
81
82    var $tr = $(row)
83    $tr.attr("data-contact-index", contactIndex)
84    $tr.find(".css-cd-contact-type").html(contactType)
85    $tr.find(".css-cd-companyname").html(nombreEmpresa)
86    $tr.find(".css-cd-fullname").html(fullName)
87    $tr.find(".css-cd-position").html(cargo)
88
89    $tr.find("input").prop("checked", checked)
90
91    // row = row.replace("[CONTACT_INDEX]", contactIndex)
92    // row = row.replace("[COMPANY_NAME]", nombreEmpresa)
93    // row = row.replace("[FULLNAME]", fullName)
94    // row = row.replace("[POSITION]", cargo)
95
96    ExtraActivity_SetRowEvents($tr)
97
98    $table.append($tr)
99}

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.