-
Notifications
You must be signed in to change notification settings - Fork 4
/
xenForo-G-1-0.user.js
238 lines (212 loc) · 20.9 KB
/
xenForo-G-1-0.user.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
// ==UserScript==
// @name xenForo-G-1-0
// @description Add arrows to show or hide forum sections, Open posts in a single tab or a new tab.
// @version 1.0
// @author Bruk ಠ‿ಠ
// @namespace http://tampermonkey.net/
// @run-at document-body
// @match *://*.fritchy.com/*
// @match *://*.nudecelebforum.com/*
// @match *://*.thecentralbox.net/*
// @match *://*.topboard.org/*
// @match *://*.doolls.org/*
// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEYAAABeCAYAAACeq2JyAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAALiIAAC4iAari3ZIAAAcTSURBVHhe7Zx7iFRVHMfd58zOzM7d2d2Z3dVtx2o1nWAVtoeFuqEUmSQ92OgPiR6oZFFBVFDGBpZGGVZEWUKRViiLUREhPSgrwbAsTASztJf4qsys1F1r+vxmfit3z9zV2XVtZ+bsF77ce8/93XvP7zu/8zvn3MeMGMYw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kDLESsBxsp6XkHkWDi1CoD1wB+u9oiEbIJQ8rfiN5TNsFtYfWchzKxYDDnur/0U1tzBixH9Ebh3JOsYcwwAAAABJRU5ErkJggg==
// @grant none
// @downloadURL http://usa.x10host.com/mybb/script/xenForo-G-1-0.user.js
// @updateURL http://usa.x10host.com/mybb/script/xenForo-G-1-0.user.js
// ==/UserScript==
// Arrows
(function() {
'use strict';
const showText = '⇓';
const hideText = '⇑';
function toggleBlockContent(block, blockId, button) {
const content = block.querySelector('.block-body') || block.querySelector('.block-content');
if (content) {
if (content.style.display === 'none') {
content.style.display = 'block';
localStorage.setItem(blockId, 'visible');
button.textContent = hideText;
} else {
content.style.display = 'none';
localStorage.setItem(blockId, 'hidden');
button.textContent = showText;
}
}
}
function addToggleButtonToBlocks(blocks, blockType) {
blocks.forEach((block, index) => {
const blockId = `${blockType}-${index}`;
const button = document.createElement('button');
button.textContent = hideText;
button.style.marginLeft = '10px';
button.style.cursor = 'pointer';
button.style.position = 'absolute';
button.style.right = '10px';
button.style.top = '50%';
button.style.transform = 'translateY(-50%)';
button.style.padding = '2px 5px';
button.style.fontSize = '1.0em';
button.style.backgroundColor = 'transparent';
button.style.border = 'none';
button.style.color = 'inherit';
button.style.fontWeight = 'bold';
const header = block.querySelector('.block-header');
if (header) {
header.style.position = 'relative';
header.appendChild(button);
button.addEventListener('click', () => toggleBlockContent(block, blockId, button));
}
const content = block.querySelector('.block-body') || block.querySelector('.block-content');
const state = localStorage.getItem(blockId);
if (content) {
if (state === 'hidden') {
content.style.display = 'none';
button.textContent = showText;
} else {
button.textContent = hideText;
}
}
});
}
const mainBlocks = document.querySelectorAll('.block.block--category');
addToggleButtonToBlocks(mainBlocks, 'main-block');
})();
// L-G
(function() {
'use strict';
let activateScript = JSON.parse(localStorage.getItem('activateScript')) || false;
let openInNewTab = JSON.parse(localStorage.getItem('openInNewTab')) || false;
let hideTimeout;
let isHideTimeoutActive = false;
const iconActive = 'data:image/jpg;base64,iVBORw0KGgoAAAANSU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j2ueV0WDgJ4PW9kDfwbQN5nGTdN03D1bZXc3b9e663eOzg7tm2PA0i6rr+oVqu/avwbaFX9/3Lh93pPVdWX/wGiBFINPPCmEQAAAABJRU5ErkJggg==';
function createButton(id, text, icon, onclick, top, visible = true) {
let button = document.createElement('button');
button.id = id;
button.innerHTML = `<img src="${icon}" style="vertical-align: middle; width: 20px; height: 20px;"/> ${text}`;
button.style.position = 'fixed';
button.style.top = top + 'px';
button.style.right = '10px';
button.style.zIndex = 1000;
button.style.padding = '5px';
button.style.borderRadius = '5px';
button.style.border = 'none';
button.style.backgroundColor = '#dfdfdf';
button.style.color = 'white';
button.style.fontSize = '14px';
button.style.cursor = 'pointer';
button.style.display = visible ? 'block' : 'none';
button.onclick = onclick;
document.body.appendChild(button);
}
function updateLinks() {
if (!activateScript) return;
let currentDomain = window.location.hostname;
let currentPath = window.location.pathname;
if (currentPath.includes('/search/')) {
return;
}
let postLinks = document.querySelectorAll('a[href*="/threads/"][href*="post-"]');
postLinks.forEach(function(link) {
let matches = link.href.match(/\/threads\/[^.]+\.(\d+)\/post-(\d+)/);
if (matches) {
let postId = matches[2];
let newHref = `https://${currentDomain}/index.php?posts/${postId}/show`;
link.href = newHref;
if (openInNewTab) {
link.setAttribute('target', '_blank');
} else {
link.removeAttribute('target');
}
}
});
}
createButton('toggleScript', activateScript ? ' ' : ' ', activateScript ? iconActive : iconInactive, function() {
activateScript = !activateScript;
localStorage.setItem('activateScript', JSON.stringify(activateScript));
document.getElementById('toggleScript').innerHTML = `<img src="${activateScript ? iconActive : iconInactive}" style="vertical-align: middle; width: 20px; height: 20px;"/> ${activateScript ? 'Function Enabled' : 'Function Disabled'}`;
let toggleTargetButton = document.getElementById('toggleTarget');
if (activateScript) {
if (!toggleTargetButton) {
createButton('toggleTarget', openInNewTab ? 'Open in Same Tab' : 'Open in New Tab', openInNewTab ? iconOpenInSameTab : iconOpenInNewTab, function() {
openInNewTab = !openInNewTab;
localStorage.setItem('openInNewTab', JSON.stringify(openInNewTab));
document.getElementById('toggleTarget').innerHTML = `<img src="${openInNewTab ? iconOpenInSameTab : iconOpenInNewTab}" style="vertical-align: middle; width: 20px; height: 20px;"/> ${openInNewTab ? 'Open in Same Tab' : 'Open in New Tab'}`;
updateLinks();
location.reload();
}, 50, false);
toggleTargetButton = document.getElementById('toggleTarget');
document.getElementById('toggleScript').addEventListener('mouseover', function() {
toggleTargetButton.style.display = 'block';
clearTimeout(hideTimeout);
});
document.getElementById('toggleScript').addEventListener('mouseout', function() {
if (!isHideTimeoutActive) {
hideTimeout = setTimeout(function() {
toggleTargetButton.style.display = 'none';
isHideTimeoutActive = false;
}, 5000);
isHideTimeoutActive = true;
}
});
toggleTargetButton.addEventListener('mouseover', function() {
clearTimeout(hideTimeout);
isHideTimeoutActive = false;
});
toggleTargetButton.addEventListener('mouseout', function() {
if (!isHideTimeoutActive) {
hideTimeout = setTimeout(function() {
toggleTargetButton.style.display = 'none';
isHideTimeoutActive = false;
}, 5000);
isHideTimeoutActive = true;
}
});
}
} else {
if (toggleTargetButton) toggleTargetButton.remove();
}
updateLinks();
location.reload();
}, 10, true);
if (activateScript) {
createButton('toggleTarget', openInNewTab ? 'Open in Same Tab' : 'Open in New Tab', openInNewTab ? iconOpenInSameTab : iconOpenInNewTab, function() {
openInNewTab = !openInNewTab;
localStorage.setItem('openInNewTab', JSON.stringify(openInNewTab));
document.getElementById('toggleTarget').innerHTML = `<img src="${openInNewTab ? iconOpenInSameTab : iconOpenInNewTab}" style="vertical-align: middle; width: 20px; height: 20px;"/> ${openInNewTab ? 'Open in Same Tab' : 'Open in New Tab'}`;
updateLinks();
location.reload();
}, 50, false);
let toggleTargetButton = document.getElementById('toggleTarget');
document.getElementById('toggleScript').addEventListener('mouseover', function() {
toggleTargetButton.style.display = 'block';
clearTimeout(hideTimeout);
});
document.getElementById('toggleScript').addEventListener('mouseout', function() {
if (!isHideTimeoutActive) {
hideTimeout = setTimeout(function() {
toggleTargetButton.style.display = 'none';
isHideTimeoutActive = false;
}, 5000);
isHideTimeoutActive = true;
}
});
toggleTargetButton.addEventListener('mouseover', function() {
clearTimeout(hideTimeout);
isHideTimeoutActive = false;
});
toggleTargetButton.addEventListener('mouseout', function() {
if (!isHideTimeoutActive) {
hideTimeout = setTimeout(function() {
toggleTargetButton.style.display = 'none';
isHideTimeoutActive = false;
}, 5000);
isHideTimeoutActive = true;
}
});
}
window.addEventListener('load', updateLinks);
})();