PageSourceSearch

https://xoops.org/modules/publisher/assets/js/funcs.js

js xoops.org collected 2026-10-01 09:16:39 UTC 5,914 bytes, 169 lines download raw bytes

1function selectAll(formObj, fieldname, isInverse) {
2    if (fieldname.length == 0) {
3        for (var i = 0; i < formObj.length; i++) {
4            fldObj = formObj.elements[i];
5            if (fldObj.type == 'checkbox') {
6                fldObj.checked = isInverse;
7            }
8        }
9    } else {
10        for (var i = 0; i < formObj.length; i++) {
11            fldObj = formObj.elements[i];
12            if (fldObj.type == 'checkbox') {
13                if (fldObj.name.indexOf(fieldname) > -1) {
14                    fldObj.checked = isInverse;
15                }
16            }
17        }
18    }
19}
20
21
22function publisherPageWrap(id, page) {
23    var revisedMessage;
24    var textareaDom = xoopsGetElementById(id);
25    xoopsInsertText(textareaDom, page);
26    textareaDom.focus();
27}
28
29function addSelectedItemsToParent() {
30    self.opener.addToParentList(window.document.forms[0].destList);
31    window.close();
32}
33
34// Fill the selcted item list with the items already present in parent.
35function fillInitialDestList() {
36    var destList = window.document.forms[0].destList;
37    var srcList = self.opener.window.document.forms[0].elements['moderators[]'];
38    for (var count = destList.options.length - 1; count >= 0; count--) {
39        destList.options[count] = null;
40    }
41    for (var i = 0; i < srcList.options.length; i++) {
42        if (srcList.options[i] != null)
43            destList.options[i] = new Option(srcList.options[i].text);
44    }
45}
46
47// Add the selected items from the source to destination list
48function addSrcToDestList() {
49    destList = window.document.forms[0].destList;
50    srcList = window.document.forms[0].srcList;
51    var len = destList.length;
52    for (var i = 0; i < srcList.length; i++) {
53        if ((srcList.options[i] != null) && (srcList.options[i].selected)) {
54            //Check if this value already exist in the destList or not
55            //if not then add it otherwise do not add it.
56            var found = false;
57            for (var count = 0; count < len; count++) {
58                if (destList.options[count] != null) {
59                    if (srcList.options[i].text == destList.options[count].text) {
60                        found = true;
61                        break;
62                    }
63                }
64            }
65            if (found != true) {
66                destList.options[len] = new Option(srcList.options[i].text);
67                len++;
68            }
69        }
70    }
71}
72
73// Deletes from the destination list.
74function deleteFromDestList() {
75    var destList = window.document.forms[0].destList;
76    var len = destList.options.length;
77    for (var i = (len - 1); i >= 0; i--) {
78        if ((destList.options[i] != null) && (destList.options[i].selected == true)) {
79            destList.options[i] = null;
80        }
81    }
82}
83
84
85function small_window(myurl, w, h) {
86    // La ventana se llama "Add_from_Src_to_Dest"
87    var newWindow;
88    LeftPosition = (screen.width) ? (screen.width - w) / 2 : 0;
89    TopPosition = (screen.height) ? (screen.height - h) / 2 : 0;
90    newWindow = window.open(myurl, "Add_from_Src_to_Dest", 'left=' + LeftPosition + ',top=' + TopPosition + ',width=' + w + ', height=' + h + ',scrollBars=yes,resizable=yes,toolbar=no,menubar=no,location=no,directories=no');
91}
92
93// Adds the list of selected items selected in the child
94// window to its list. It is called by child window to do so.
95function addToParentList(sourceList) {
96    destinationList = window.document.forms[0].elements['moderators[]'];
97    for (var count = destinationList.options.length - 1; count >= 0; count--) {
98        destinationList.options[count] = null;
99    }
100    for (var i = 0; i < sourceList.options.length; i++) {
101        if (sourceList.options[i] != null)
102            destinationList.options[i] = new Option(sourceList.options[i].text, sourceList.options[i].value);
103    }
104}
105
106// Marks all the items as selected for the submit button.
107function selectList(sourceList) {
108    sourceList = window.document.forms[0].elements['moderators[]'];
109    for (var i = 0; i < sourceList.options.length; i++) {
110        if (sourceList.options[i] != null)
111            sourceList.options[i].selected = true;
112    }
113    return true;
114}
115
116// Deletes the selected items of supplied list.
117function deleteSelectedItemsFromList(sourceList) {
118    var maxCnt = sourceList.options.length;
119    for (var i = maxCnt - 1; i >= 0; i--) {
120        if ((sourceList.options[i] != null) && (sourceList.options[i].selected == true)) {
121            sourceList.options[i] = null;
122        }
123    }
124}
125
126function goto_URL(object) {
127    window.location.href = object.options[object.selectedIndex].value;
128}
129
130function toggle(id) {
131    if (document.getElementById) {
132        obj = document.getElementById(id);
133    }
134    if (document.all) {
135        obj = document.all[id];
136    }
137    if (document.layers) {
138        obj = document.layers[id];
139    }
140    if (obj) {
141        if (obj.style.display == "none") {
142            obj.style.display = "";
143        } else {
144            obj.style.display = "none";
145        }
146    }
147
148    var expDays = 365;
149    var exp = new Date();
150    exp.setTime(exp.getTime() + (expDays * 24 * 60 * 60 * 1000));
151
152    setCookie(window.location.pathname + "_publisher_collaps_" + obj.id, obj.style.display, exp);
153
154    return false;
155}
156
157
158var iconClose = new Image();
159iconClose.src = '/modules/publisher/assets/images/links/close12.gif';
160var iconOpen = new Image();
161iconOpen.src = '/modules/publisher/assets/images/links/open12.gif';
162
163function toggleIcon(iconName) {
164    if (document.images[iconName].src == window.iconOpen.src) {
165        document.images[iconName].src = window.iconClose.src;
166    } else if (document.images[iconName].src == window.iconClose.src) {
167        document.images[iconName].src = window.iconOpen.src;
168    }
169}

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.