PageSourceSearch

https://kubawest.de/plugins/externalmedia/js/externalmedia-settings.js

js kubawest.de collected 2026-10-05 05:40:14 UTC 1,881 bytes, 202 lines download raw bytes

1(function(){
2
3"use strict";
4
5
6window.externalMediaSettings=function()
7{
8
9
10var providers =
11window.externalMediaProviders || [];
12
13
14
15var overlay=document.createElement("div");
16
17overlay.className=
18"externalmedia-settings";
19
20
21
22var html=
23'<div class="externalmedia-settings-box">'+
24'<h2>Externe Medien</h2>';
25
26
27
28for(var i=0;i<providers.length;i++)
29{
30
31var provider =
32providers[i].name;
33
34
35var checked =
36getCookie(
37"cmsimple_externalmedia_"+provider
38)=="1";
39
40
41
42html +=
43
44'<div class="externalmedia-row">'+
45
46'<span>'+
47providers[i].title+
48'</span>'+
49
50'<label class="externalmedia-switch">'+
51
52'<input type="checkbox" '+
53'data-provider="'+provider+'" '+
54(checked ? "checked" : "")+
55'>'+
56
57'<span></span>'+
58
59'</label>'+
60
61'</div>';
62
63}
64
65
66
67html +=
68
69'<button id="externalmedia-save">'+
70'Einstellungen speichern'+
71'</button>'+
72
73'</div>';
74
75
76
77overlay.innerHTML=html;
78
79document.body.appendChild(overlay);
80
81
82
83document
84.getElementById("externalmedia-save")
85.onclick=function()
86{
87
88
89var switches =
90overlay.querySelectorAll(
91"input[type=checkbox]"
92);
93
94
95
96for(var i=0;i<switches.length;i++)
97{
98
99var provider =
100switches[i].getAttribute(
101"data-provider"
102);
103
104
105
106if(switches[i].checked)
107{
108
109setCookie(
110"cmsimple_externalmedia_"+provider,
111"1",
112365
113);
114
115}
116else
117{
118
119deleteCookie(
120"cmsimple_externalmedia_"+provider
121);
122
123}
124
125}
126
127
128location.reload();
129
130
131};
132
133
134
135};
136
137
138
139function getCookie(name)
140{
141
142var cookies =
143document.cookie.split(";");
144
145
146for(var i=0;i<cookies.length;i++)
147{
148
149var c =
150cookies[i].trim();
151
152
153if(c.indexOf(name+"=")===0)
154{
155return c.substring(
156name.length+1
157);
158}
159
160}
161
162
163return "";
164
165}
166
167
168
169
170function setCookie(name,value,days)
171{
172
173var d=new Date();
174
175d.setTime(
176d.getTime()+
177days*24*60*60*1000
178);
179
180
181document.cookie =
182name+"="+value+
183"; expires="+
184d.toUTCString()+
185"; path=/; SameSite=Lax";
186
187}
188
189
190
191
192function deleteCookie(name)
193{
194
195document.cookie =
196name+
197"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/; SameSite=Lax";
198
199}
200
201
202})();

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.