webring-rails 1.4.3 → 1.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/javascripts/webring/widget.js +108 -15
- data/app/assets/javascripts/webring/widget.min.js +1 -1
- data/lib/webring/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 447748a2ca051ec5cfdbdb2939c09a30c8b57e2a47fff7aabd8f32cea100cc0c
|
4
|
+
data.tar.gz: 6644675f77cd307363543cc56b183152e4a42adb1121844834da943e430ba993
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a2b3855e306305947af1fc114b30005e8ed551f070f7cacd67d5719f9517b915fcbe6a3bf266f4acf187c6345f636f513a6ee0a6ebaea5ea8d1b4d8a20c40ac5
|
7
|
+
data.tar.gz: 771bdf593b8310ae9a0c18b957ed3f6f896e26b7277b85da26e36bd03c7f86bcb736430a73df8c45f039150eb8dfd7f3616b8b0c1427706fd7ebfd50238c216c
|
@@ -112,6 +112,85 @@
|
|
112
112
|
});
|
113
113
|
|
114
114
|
const STYLES = Object.freeze({
|
115
|
+
// Reset all generic element selectors except SVG (to preserve SVG functionality)
|
116
|
+
reset: `
|
117
|
+
.webring-nav,
|
118
|
+
.webring-nav div,
|
119
|
+
.webring-nav span,
|
120
|
+
.webring-nav nav,
|
121
|
+
.webring-nav a,
|
122
|
+
.webring-nav div::before,
|
123
|
+
.webring-nav span::before,
|
124
|
+
.webring-nav nav::before,
|
125
|
+
.webring-nav a::before,
|
126
|
+
.webring-nav div::after,
|
127
|
+
.webring-nav span::after,
|
128
|
+
.webring-nav nav::after,
|
129
|
+
.webring-nav a::after {
|
130
|
+
all: initial;
|
131
|
+
box-sizing: border-box;
|
132
|
+
}
|
133
|
+
|
134
|
+
.webring-nav,
|
135
|
+
.webring-nav div,
|
136
|
+
.webring-nav span,
|
137
|
+
.webring-nav nav,
|
138
|
+
.webring-nav a {
|
139
|
+
font-family: inherit;
|
140
|
+
font-size: inherit;
|
141
|
+
line-height: inherit;
|
142
|
+
color: inherit;
|
143
|
+
}
|
144
|
+
|
145
|
+
.webring-nav div,
|
146
|
+
.webring-nav span,
|
147
|
+
.webring-nav nav,
|
148
|
+
.webring-nav a {
|
149
|
+
display: initial;
|
150
|
+
margin: 0;
|
151
|
+
padding: 0;
|
152
|
+
border: none;
|
153
|
+
background: none;
|
154
|
+
text-decoration: none;
|
155
|
+
color: inherit;
|
156
|
+
font-weight: inherit;
|
157
|
+
font-size: inherit;
|
158
|
+
line-height: inherit;
|
159
|
+
vertical-align: baseline;
|
160
|
+
box-shadow: none;
|
161
|
+
outline: none;
|
162
|
+
transform: none;
|
163
|
+
opacity: 1;
|
164
|
+
visibility: visible;
|
165
|
+
position: static;
|
166
|
+
float: none;
|
167
|
+
clear: none;
|
168
|
+
overflow: visible;
|
169
|
+
white-space: normal;
|
170
|
+
text-align: left;
|
171
|
+
letter-spacing: normal;
|
172
|
+
word-spacing: normal;
|
173
|
+
text-transform: none;
|
174
|
+
text-shadow: none;
|
175
|
+
list-style: none;
|
176
|
+
border-radius: 0;
|
177
|
+
min-width: auto;
|
178
|
+
max-width: none;
|
179
|
+
min-height: auto;
|
180
|
+
max-height: none;
|
181
|
+
width: auto;
|
182
|
+
height: auto;
|
183
|
+
top: auto;
|
184
|
+
right: auto;
|
185
|
+
bottom: auto;
|
186
|
+
left: auto;
|
187
|
+
z-index: auto;
|
188
|
+
}
|
189
|
+
|
190
|
+
.webring-nav a {
|
191
|
+
cursor: pointer;
|
192
|
+
}
|
193
|
+
`,
|
115
194
|
layout: `
|
116
195
|
.webring-nav {
|
117
196
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
@@ -122,9 +201,14 @@
|
|
122
201
|
max-width: 350px;
|
123
202
|
margin: 0 auto;
|
124
203
|
padding: 10px;
|
204
|
+
box-sizing: border-box;
|
125
205
|
}
|
126
|
-
.webring-title {
|
206
|
+
.webring-nav .webring-title {
|
127
207
|
margin-bottom: 8px;
|
208
|
+
margin-top: 0;
|
209
|
+
padding: 0;
|
210
|
+
font-size: inherit;
|
211
|
+
line-height: normal;
|
128
212
|
}
|
129
213
|
.webring-nav nav {
|
130
214
|
display: flex;
|
@@ -132,19 +216,25 @@
|
|
132
216
|
width: 100%;
|
133
217
|
justify-content: center;
|
134
218
|
align-items: center;
|
219
|
+
margin: 0;
|
220
|
+
padding: 0;
|
221
|
+
box-sizing: border-box;
|
135
222
|
}
|
136
|
-
.webring-btn {
|
223
|
+
.webring-nav .webring-btn {
|
137
224
|
display: flex;
|
138
225
|
align-items: center;
|
139
226
|
justify-content: center;
|
140
227
|
padding: 6px 12px;
|
141
228
|
text-decoration: none;
|
229
|
+
box-sizing: border-box;
|
230
|
+
margin: 0;
|
142
231
|
}
|
143
|
-
.random-btn {
|
232
|
+
.webring-nav .webring-btn.random-btn {
|
144
233
|
padding: 6px 8px;
|
145
234
|
}
|
146
|
-
.logo-only {
|
235
|
+
.webring-nav nav .logo-only {
|
147
236
|
padding: 8px 3px 6px 3px;
|
237
|
+
margin: 0;
|
148
238
|
}
|
149
239
|
.webring-nav[data-widget-type="no-text"] {
|
150
240
|
padding: 8px 10px;
|
@@ -152,17 +242,19 @@
|
|
152
242
|
.webring-nav[data-widget-type="one-way"] {
|
153
243
|
max-width: 200px;
|
154
244
|
}
|
155
|
-
.webring-logo-inline {
|
245
|
+
.webring-nav .webring-logo-inline {
|
156
246
|
display: inline-block;
|
157
247
|
vertical-align: middle;
|
158
248
|
margin-right: 6px;
|
159
249
|
margin-top: 1px;
|
250
|
+
margin-bottom: 0;
|
251
|
+
margin-left: 0;
|
160
252
|
}
|
161
|
-
[data-button-text="false"] .prev-btn {
|
253
|
+
.webring-nav[data-button-text="false"] .prev-btn {
|
162
254
|
padding-top: 5px;
|
163
255
|
padding-right: 12.5px;
|
164
256
|
}
|
165
|
-
[data-button-text="false"] .next-btn {
|
257
|
+
.webring-nav[data-button-text="false"] .next-btn {
|
166
258
|
padding-top: 5px;
|
167
259
|
padding-left: 12.5px;
|
168
260
|
}
|
@@ -171,10 +263,10 @@
|
|
171
263
|
.webring-nav[data-widget-type="full"] {
|
172
264
|
border: 2.5px solid #000000;
|
173
265
|
}
|
174
|
-
.webring-title {
|
266
|
+
.webring-nav .webring-title {
|
175
267
|
font-weight: 600;
|
176
268
|
}
|
177
|
-
.webring-btn {
|
269
|
+
.webring-nav .webring-btn {
|
178
270
|
text-wrap: nowrap;
|
179
271
|
color: #000000;
|
180
272
|
font-weight: 600;
|
@@ -182,16 +274,16 @@
|
|
182
274
|
border: 2.5px solid #000000;
|
183
275
|
transition: background-color 0.2s ease, color 0.2s ease;
|
184
276
|
}
|
185
|
-
.webring-btn:hover {
|
277
|
+
.webring-nav .webring-btn:hover {
|
186
278
|
background-color: #000000;
|
187
279
|
color: #ffffff;
|
188
280
|
}
|
189
|
-
.webring-btn:focus {
|
281
|
+
.webring-nav .webring-btn:focus {
|
190
282
|
outline: none;
|
191
283
|
background-color: transparent;
|
192
284
|
color: #000000;
|
193
285
|
}
|
194
|
-
.webring-btn:active {
|
286
|
+
.webring-nav .webring-btn:active {
|
195
287
|
border-color: #000000;
|
196
288
|
background-color: #000000;
|
197
289
|
color: #ffffff;
|
@@ -340,13 +432,14 @@
|
|
340
432
|
|
341
433
|
switch (styleOption) {
|
342
434
|
case 'none':
|
343
|
-
|
435
|
+
// Even with 'none', apply reset to protect against host styles
|
436
|
+
styleElement.textContent = STYLES.reset;
|
344
437
|
break;
|
345
438
|
case 'layout':
|
346
|
-
styleElement.textContent = STYLES.layout;
|
439
|
+
styleElement.textContent = STYLES.reset + STYLES.layout;
|
347
440
|
break;
|
348
441
|
default: // 'full'
|
349
|
-
styleElement.textContent = STYLES.layout + STYLES.design;
|
442
|
+
styleElement.textContent = STYLES.reset + STYLES.layout + STYLES.design;
|
350
443
|
}
|
351
444
|
}
|
352
445
|
|
@@ -1 +1 @@
|
|
1
|
-
!function(){function
|
1
|
+
!function(){function n(n){function t(n){let t=document.getElementById(e.STYLE_ID);switch(t||(t=document.createElement("style"),t.id=e.STYLE_ID,document.head.appendChild(t)),n){case"none":t.textContent=g.reset;break;case"layout":t.textContent=g.reset+g.layout;break;default:t.textContent=g.reset+g.layout+g.design}}const i=n||document.currentScript||document.getElementsByTagName("script")[document.getElementsByTagName("script").length-1];if(!i)return;const a=i.getAttribute("data-member-uid"),b=i.getAttribute("data-widget-type")??e.DEFAULT_TYPE,c=i.getAttribute("data-target-id")??e.DEFAULT_TARGET_ID,p="false"!==i.getAttribute("data-button-text"),f=i.getAttribute("data-styles")??e.DEFAULT_STYLE_TYPE,w=e.VALID_STYLE_TYPES.includes(f)?f:e.DEFAULT_STYLE_TYPE,m=i.getAttribute("data-prev-text"),u=i.getAttribute("data-random-text"),x=i.getAttribute("data-next-text"),v=i.getAttribute("data-widget-text");if(!a)return void console.error("Webring Widget: Missing data-member-uid attribute on script tag.");if(!e.VALID_TYPES.includes(b))return void console.error(`Webring Widget: Invalid widget type "${b}". Valid types: ${e.VALID_TYPES.join(", ")}`);const h=i.getAttribute("src"),y=new URL(h,window.location.href).origin,T=function(){const n=document.getElementById(c);if(!n)return void console.error(`Webring Widget: No element with id "${c}" found.`);s||(t(w),s=!0);const e=document.createDocumentFragment(),i=document.createElement("div");i.className="webring-nav",i.setAttribute("data-widget-type",b),i.setAttribute("data-button-text",p.toString());const g={prev:d.prev.text_enforced?d.prev:m?{...d.prev,text:`\xab ${m}`}:d.prev,random:d.random.text_enforced?d.random:u?{...d.random,text:`${r(20,20,"margin-right: 4px; margin-top: 1px;")} ${u}`}:d.random,next:d.next.text_enforced?d.next:x?{...d.next,text:`${x} \xbb`}:d.next,logoOnly:d.logoOnly},f=l[b];if(f.showTitle){const n=document.createElement("span");n.className="webring-title",n.innerHTML=o.widgetTitle.enforced?o.widgetTitle.default:v??o.widgetTitle.default,i.appendChild(n)}const h=document.createElement("nav");h.className="webring-buttons",f.actions.forEach((n=>{const e=g[n];if("logoOnly"===n){const n=document.createElement("div");return n.className=e.additionalClass,n.innerHTML=e.symbol,void h.appendChild(n)}const t=document.createElement("a");if(t.href=`${y}/webring/${e.path}?source_member_uid=${a}`,t.title=e.title,t.className=`webring-btn ${e.additionalClass}`,"one-way"===b&&f.showLogoInButton&&"next"===n){const n=d.next.text_enforced?o.next.default:x||g.next.text.replace(" \xbb","");t.innerHTML=p?`<span class="webring-logo-inline">${r(20,20)}</span> ${n} \xbb`:`<span class="webring-logo-inline">${r(20,20)}</span> ${e.symbol}`}else t.innerHTML=p?e.text:e.symbol;h.appendChild(t)})),i.appendChild(h),e.appendChild(i),n.innerHTML="",n.appendChild(e)};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",T):T()}const e=Object.freeze({VALID_TYPES:Object.freeze(["full","no-text","two-way","one-way","random-only"]),DEFAULT_TYPE:"full",DEFAULT_TARGET_ID:"webring-widget",STYLE_ID:"webring-widget-styles",VALID_STYLE_TYPES:Object.freeze(["full","layout","none"]),DEFAULT_STYLE_TYPE:"full"}),t=Object.freeze({prev:{default:"\xab Prev",enforced:!1},random:{default:"Random",enforced:!1},next:{default:"Next \xbb",enforced:!1},widgetTitle:{default:"Webring",enforced:!1}}),i="<<REPLACE_ME_TEXT_DEFAULTS>>",a="<<REPLACE_ME_TEXT_DEFAULTS>>"!==i?"string"==typeof i?JSON.parse(i):i:{},o=Object.freeze(Object.keys(t).reduce(((n,e)=>{const i=a[e];return n[e]={default:i?.default??t[e].default,enforced:i?.enforced??t[e].enforced},n}),{})),r="<<REPLACE_ME_LOGO_SVG_FUNCTION>>",d=Object.freeze({prev:{symbol:"\xab",text:`\xab ${o.prev.default}`,text_enforced:o.prev.enforced,title:"Previous site",path:"previous",additionalClass:"prev-btn"},random:{symbol:r(23,23),text:`${r(20,20,"margin-right: 4px; margin-top: 1px;")} ${o.random.default}`,text_enforced:o.random.enforced,title:"Random site",path:"random",additionalClass:"random-btn"},next:{symbol:"\xbb",text:`${o.next.default} \xbb`,text_enforced:o.next.enforced,title:"Next site",path:"next",additionalClass:"next-btn"},logoOnly:{symbol:r(23,23),text:r(23,23),path:"",additionalClass:"logo-only"}}),l=Object.freeze({full:{showTitle:!0,actions:["prev","random","next"]},"no-text":{showTitle:!1,actions:["prev","random","next"]},"two-way":{showTitle:!1,actions:["prev","logoOnly","next"],showLogoInMiddle:!0},"one-way":{showTitle:!1,actions:["next"],showLogoInButton:!0},"random-only":{showTitle:!1,actions:["random"]}}),g=Object.freeze({reset:"\n .webring-nav,\n .webring-nav div,\n .webring-nav span,\n .webring-nav nav,\n .webring-nav a,\n .webring-nav div::before,\n .webring-nav span::before,\n .webring-nav nav::before,\n .webring-nav a::before,\n .webring-nav div::after,\n .webring-nav span::after,\n .webring-nav nav::after,\n .webring-nav a::after {\n all: initial;\n box-sizing: border-box;\n }\n\n // .webring-nav svg,\n // .webring-nav svg * {\n // all: revert;\n // fill: currentColor;\n // }\n\n .webring-nav,\n .webring-nav div,\n .webring-nav span,\n .webring-nav nav,\n .webring-nav a {\n font-family: inherit;\n font-size: inherit;\n line-height: inherit;\n color: inherit;\n }\n\n .webring-nav div,\n .webring-nav span,\n .webring-nav nav,\n .webring-nav a {\n display: initial;\n margin: 0;\n padding: 0;\n border: none;\n background: none;\n text-decoration: none;\n color: inherit;\n font-weight: inherit;\n font-size: inherit;\n line-height: inherit;\n vertical-align: baseline;\n box-shadow: none;\n outline: none;\n transform: none;\n opacity: 1;\n visibility: visible;\n position: static;\n float: none;\n clear: none;\n overflow: visible;\n white-space: normal;\n text-align: left;\n letter-spacing: normal;\n word-spacing: normal;\n text-transform: none;\n text-shadow: none;\n list-style: none;\n border-radius: 0;\n min-width: auto;\n max-width: none;\n min-height: auto;\n max-height: none;\n width: auto;\n height: auto;\n top: auto;\n right: auto;\n bottom: auto;\n left: auto;\n z-index: auto;\n }\n\n .webring-nav a {\n cursor: pointer;\n }\n ",layout:'\n .webring-nav {\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;\n font-size: 16px;\n display: flex;\n flex-direction: column;\n align-items: center;\n max-width: 350px;\n margin: 0 auto;\n padding: 10px;\n box-sizing: border-box;\n }\n .webring-nav .webring-title {\n margin-bottom: 8px;\n margin-top: 0;\n padding: 0;\n font-size: inherit;\n line-height: normal;\n }\n .webring-nav nav {\n display: flex;\n gap: 10px;\n width: 100%;\n justify-content: center;\n align-items: center;\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n }\n .webring-nav .webring-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 6px 12px;\n text-decoration: none;\n box-sizing: border-box;\n margin: 0;\n }\n .webring-nav .webring-btn.random-btn {\n padding: 6px 8px;\n }\n .webring-nav nav .logo-only {\n padding: 8px 3px 6px 3px;\n margin: 0;\n }\n .webring-nav[data-widget-type="no-text"] {\n padding: 8px 10px;\n }\n .webring-nav[data-widget-type="one-way"] {\n max-width: 200px;\n }\n .webring-nav .webring-logo-inline {\n display: inline-block;\n vertical-align: middle;\n margin-right: 6px;\n margin-top: 1px;\n margin-bottom: 0;\n margin-left: 0;\n }\n .webring-nav[data-button-text="false"] .prev-btn {\n padding-top: 5px;\n padding-right: 12.5px;\n }\n .webring-nav[data-button-text="false"] .next-btn {\n padding-top: 5px;\n padding-left: 12.5px;\n }\n ',design:'\n .webring-nav[data-widget-type="full"] {\n border: 2.5px solid #000000;\n }\n .webring-nav .webring-title {\n font-weight: 600;\n }\n .webring-nav .webring-btn {\n text-wrap: nowrap;\n color: #000000;\n font-weight: 600;\n background-color: #ffffff;\n border: 2.5px solid #000000;\n transition: background-color 0.2s ease, color 0.2s ease;\n }\n .webring-nav .webring-btn:hover {\n background-color: #000000;\n color: #ffffff;\n }\n .webring-nav .webring-btn:focus {\n outline: none;\n background-color: transparent;\n color: #000000;\n }\n .webring-nav .webring-btn:active {\n border-color: #000000;\n background-color: #000000;\n color: #ffffff;\n }\n '});let s=!1;n()}();
|
data/lib/webring/version.rb
CHANGED