PageSourceSearch

https://minjusticia.gov.co/_catalogs/masterpage/Portal/wpframe/wpSlider.js

js minjusticia.gov.co collected 2026-10-02 03:32:41 UTC 2,858 bytes, 78 lines download raw bytes

1var wpRenderRun = false;
2var wpSlider;
3var slider = {};
4_spBodyOnLoadFunctionNames.push("init");
5
6function init() {
7    if (SP_JSONParse(localStorage.isEdit)) {
8        console.debug("%cModo de edicion: No se ejecuta", sInfo[1]);
9        return false;
10    }
11    console.debug("%cCargando la funcionalidad de renderizado", sInfo[1]);
12    SP.SOD.executeFunc("wpRender.js", "WPRender", renderSliders);
13}
14
15function renderSliders() {
16    if (wpRenderRun == true) {
17        console.debug("%cYa se corrio el renderizado", sInfo[1]);
18        return false;
19    }
20    wpRenderRun = true;
21    console.debug("%cRenderizado de sliders", sInfo[1]);
22    var domContents = document.querySelectorAll(".slider");
23    domContents.forEach(function (slider) {
24        //Obtenemos en nombre de la lista
25        if ("undefined" == typeof (slider.hasAttribute('spx-list'))) {
26            error = {
27                name: "Slider",
28                type: "error",
29                time: 10,
30                title: "Slider:",
31                message: "No se configuro el nombre de la biblioteca que contiene los Sliders."
32            }
33            console.error("%c %o", sError[0], error);
34            return false;
35        }
36
37        var list = configList(slider);
38        var wpSlider = new WPRender(list, "wpSlider");
39        //Cambiamos las propiedades de los items 
40        wpSlider.changeItems = function(){
41            var list = this;
42            list.items.forEach(function(item){
43                item.Descripcion = item.Descripcion ? item.Descripcion :"";
44            });
45        }
46        wpSlider.render()
47            .then(function (wpSlider) {
48                slider.innerHTML = "";
49                slider.append(wpSlider.DOM);
50                slider.querySelectorAll(".carousel-item")[0].classList.add("active");
51            })
52            .catch(function (error) {
53                console.error("%c %o", sError[0], error);
54            })
55    })
56}
57
58function configList(slider) {
59    var site = slider.hasAttribute('spx-site') ? slider.getAttribute('spx-site') : "current"
60    var list = {};
61    //Obtenemos la categoria y configuramos el filtro
62    var where = '<Eq><FieldRef Name="MJCategoria"/><Value Type="Text">{0}</Value></Eq>';
63    
64    var category = slider.hasAttribute('spx-category') ? slider.getAttribute('spx-category') : "";
65
66    list.context = site == "root" ? localStorage.spSiteUrl : site;
67    list.name = slider.getAttribute('spx-list')
68    list.where = category == "" ? "" : String.format(where, category);
69    list.orderBy = [["ImageCreateDate", false]];
70    list.fields = {
71        "FileLeafRef": "FileLeafRef",
72        "PreviewOnForm": "PreviewOnForm",
73        "Categoria": "MJCategoria",
74        "Descripcion": "MJDescripcion",
75        "URL": "URL"
76    }
77    return list;
78}

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.