one2xs 2.0

Gestart doorOne2xs51 reacties285 weergaven

52 berichten · pagina 3 van 4

Berichten
5.274
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien

Eindhoven, Nederland

Raaoul schreef:
Eerdere citaten tonen
Wouterr schreef:
Maak please wel een goede errorhandler enzo, straks ligt mn internet er weer is uit, en crasht je hele applicatie omdat die de pagina niet kan laden. emo Hetzelfde bij Multicraft, damn irrietant. Voorderest nice, en ben zeker nieuwsgierig! biggrin
Denk niet dat Javascript je hele browser kan laten crachen, toch niet als er een ajax request fout gaat emo
Ik bedoelde hier meer mee de website zelf yummie, die is dan ineens leeg, of geeft random dingen aan.. En in jouw geval een applicatie..

@above, ff proberen biggrin
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Als de connectie wegvalt word er een gecachte van bijvoorbeeld de 10 laatste topics opgehaald.
0
Berichten
2.363
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Luukieboy schreef:
Eerdere citaten tonen
Raaoul schreef:
Je kunt hier one2xs 2.0 downloaden.
http://userscripts.org/scripts/show/175363

Je moet wel eerst de Greasemonkey plugin in je browser hebben geïnstalleerd!

De sourcecode is op die pagina ook direct beschikbaar.

http://userscripts.org/scripts/review/175363

Ik kan de download van Greasemonkey voor chrome niet vinden?
Kun je als het goed is Tampermonkey voor gebruiken smile
0
Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
Afbeelding

Alleen zie ik geen verschil?
0
Berichten
7.498
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
En hoe open je tampermonkey dan? xd
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Dylanh schreef:
Afbeelding

Alleen zie ik geen verschil?
Zag je geen welkom bericht toen je naar one2xs.com ging?
Open de foutconsole even en geef me enige errors die je ziet.
0
Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
Raaoul schreef:
Eerdere citaten tonen
Dylanh schreef:
Alleen zie ik geen verschil?

Zag je geen welkom bericht toen je naar one2xs.com ging?
Open de foutconsole even en geef me enige errors die je ziet.
Spoiler tonen
Codeblok (voorbeeld.php):
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
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458

env: ERROR: Syntax error @ one2xs!
##########################
// ==UserScript==
// @name one2xs
// @namespace vandenberge.one2xs
// @description One2xs Script
// @include http://www.one2xs.com/*
// @include http://one2xs.com/*
// @require http://www.one2xs.com/includes/jquery.js
// @require http://www.one2xs.com/includes/jquery-ui.js
// @require http://www.one2xs.com/includes/one2xs-js-undep.js
// @resource jQueryUICSS http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.20/themes/ui-lightness/jquery-ui.css
// @version 2
// @grant GM_getValue
// @grant GM_setValue
// @grant GM_log
// @grant GM_listValues
// @grant GM_addStyle
// @grant GM_xmlhttpRequest
// @grant GM_getResourceText
// ==/UserScript==

String.prototype.replaceAll = function(find, replace) {
var str = this;
return str.replace(new RegExp(find, g), replace);
};

function log(message)
{
GM_log("one2xs 2.0 (v2): " + message);
}

function getSetting(key)
{
return GM_getValue("setting_" + key, null);
}

function setSetting(key, value)
{
GM_setValue("setting_" + key, value);
}

function setDefaultSettings()
{
setSetting("showTenLast", true);
setSetting("showAdvs", false);
setSetting("showCookieMessage", false);
setSetting("changeLogo", true);
}

function saveSettings()
{
log("Saving settings...");

last10 = $(#one2xs20-settings-10last).val();
adv = $(#one2xs20-settings-adv).val();
cookie = $(#one2xs20-settings-cookie).val();
logo = $(#one2xs20-settings-logo).val();

setSetting("showTenLast", last10 == "1" ? true : false);
setSetting("showAdvs", adv == "1" ? true : false);
setSetting("showCookieMessage", cookie == "1" ? true : false);
setSetting("changeLogo", logo == "1" ? true : false);

window.location.reload();
}

function showSettings()
{
settingshtml = Instellingen
+

Ik wil de 10 laatste topics waar ik gereageerd in heb op iedere pagina zien:
+
(Reset dimensies)
+

Ik wil meldingen over mijn advertentietegoed zien:
+

+

Ik wil de cookiemelding zien:
+
+

+

Vervang het logo in de header door het one2xs 2.0 logo:
+
+

+
;

setoverlaytext(settingshtml);

$(#one2xs20-settings-resetLastTenDimensions).click(function()
{
resetLastTenDimensions();
});

$(#one2xs20-settings-save).click(function()
{
saveSettings();
});
}

function removeQuicklink(name)
{
if (confirm("Ben je zeker dat je " + name + " wilt verwijderen?"))
{
setSetting("quicklink_" + name, false);

window.location.reload();
}
}

function goToQuicklink(name)
{
URL = getSetting("quicklink_" + name);

$(body).fadeOut(fast, function()
{
window.location = URL;
});
}

function showQuicklinkAddScreen()
{
loc = unsafeWindow.location.toString().replace("#", "");

setoverlaytext(Voeg quicklink toe
Deze quicklink verwijst naar: + loc +

Naam:

);

$(#one2xs20-quicklinks-add-btn).click(function()
{
name = $(#one2xs20-quicklinks-add-name).val();

addQuicklink(name, loc);
});
}

function addQuicklink(name, URL)
{
setSetting("quicklink_" + name, URL);

window.location.reload();
}

function resetLastTenDimensions()
{
log("RESETTING COORDS");

setSetting("last10_X", false);
setSetting("last10_Y", false);
setSetting("last10_W", false);
setSetting("last10_H", false);

window.location.reload();
}

function bigMessage(title, msg)
{
document.title = title;

GM_addStyle("#container { background: none; } body { background: url(http://one2xs.com/img/bg.gif) repeat-x scroll 0% 0% #D5D5D5; } #footer, #footer-forum { display: none; }");

$(#container).html("
" + msg + "
");
}

$(document).ready(function()
{
var newCSS = GM_getResourceText("jQueryUICSS");
GM_addStyle(newCSS);

log("Checking...");

GM_xmlhttpRequest({
method: "GET",
url: "http://raoul.s2.one2xs.com/one2xs20/stop.txt",
onload: function(response) {
if (response.responseText.trim() == "1")
{
bigMessage("one2xs 2.0", "one2xs 2.0 werd gestopt, schakel one2xs 2.0 uit vanuit het Greasemonkey controlepaneel.");
}
else
{
checkForWelcome();
}
},
onerror: function(response) {

}
});
});

function checkForWelcome()
{
if (GM_getValue("welcomeMessage", false) == false)
{
log("Showing welcome message");

setDefaultSettings();

bigMessage(Welkom bij one2xs.com, Welkom!

one2xs 2.0 is succesvol geinstalleerd.

Veel plezier!

Ga naar One2xs);

GM_setValue("welcomeMessage", true);
}
else
{
init();
}
}

function init()
{
log("Started!");

// Reset logo

if (getSetting("changeLogo") == true)
{
$(#logo).css(background-image, url(http://raoul.s2.one2xs.com/one2xs20/20logo.png));
}

// Disable nieuwe adv

if (getSetting("showAdvs") == false)
{
log("Removing ads info");

if ($(.nieuweadvs).html() != null)
{
$.get(/?advtegoed=del, function(dat)
{
$(.nieuweadvs).remove();
});
}
}

// Disable cookie melding

if (getSetting("showCookieMessage") == false)
{
log("Removing cookie message");

if ($(#top_info_tekst).html() != null)
{
if ($(#top_info_tekst).html().indexOf(cookies) != -1)
{
GM_log("Disabling cookie melding");

okURL = $(#top_info_tekst).find(a)[1];

$.get(okURL, function(dat)
{
$(#top_info).remove();
});
}
}
}

// Add style for sidebar

GM_addStyle("#one2xs20_sidebar { position: fixed; margin-left: -360px; margin-top: 68px; width: 310px; }");

$(#logo).append(
);

// Add laatste 10 topics

if (getSetting("showTenLast") == true)
{
radius = -webkit-border-bottom-right-radius: 3px; -webkit-border-bottom-left-radius: 5px; -moz-border-radius-bottomright: 3px; -moz-border-radius-bottomleft: 5px; border-bottom-right-radius: 3px; border-bottom-left-radius: 5px;;

GM_addStyle("#one2xs20_last10 a { padding: 0; display: inline; } #one2xs20_last10 table { width: 50%; }");
GM_addStyle("#one2xs20_last10 #drag { cursor: move; height: 27px; overflow: hidden; background: url(http://raoul.s2.one2xs.com/one2xs20/orangepattern.png) repeat-x; padding: 5px; color: #FFF; font-weight:bold; " + radius + " }");
GM_addStyle("#one2xs20_last10_progressbar { width: 0%; background: #E79B0B; height: 6px; }");

$(#logo).append(
Laatste 10 topics waarop je gereageerd hebt
);

if (getSetting("last10_X") != null && getSetting("last10_X") != false)
{
$(#one2xs20_last10).css(left, getSetting("last10_X"));
}

if (getSetting("last10_Y") != null && getSetting("last10_Y") != false)
{
$(#one2xs20_last10).css(top, getSetting("last10_Y"));
}

if (getSetting("last10_W") != null && getSetting("last10_W") != false)
{
$(#one2xs20_last10).css(width, getSetting("last10_W"));
}

if (getSetting("last10_H") != null && getSetting("last10_H") != false)
{
$(#one2xs20_last10).css(height, getSetting("last10_H"));
}

$(#one2xs20_last10).draggable({
handle: "#drag",
stop: function()
{
log($(this).css(left) + , + $(this).css(top));

setSetting("last10_X", $(this).css(left));
setSetting("last10_Y", $(this).css(top));
}
});

$(#one2xs20_last10).resizable({
minWidth: 307,
stop: function()
{
setSetting("last10_W", $(this).css(width));
setSetting("last10_H", $(this).css(height));
}
});

$(.ui-resizable-se).css(background-image, url(http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.20/themes/ui-lightness/images/ui-icons_222222_256x240.png));

if (GM_getValue("cacheLast10", false) != false)
{
$("#one2xs20_last10_urls").html(GM_getValue("cacheLast10"));
}

getLast10 = function()
{
$.get(/, function(dat)
{
$("#one2xs20_last10_urls").html("");

// Loop trough nodes
nodes = $(dat).find("ul#arrangableNodes");

found = false;

$(nodes).find("li").each(function(i, ele)
{
found = true;

eleHTML = $(ele).html();

if (eleHTML.substring(0, 52) == "

Laatste 10 topics waarin je gereageerd hebt

")
{
parsed = eleHTML.replaceAll("

Laatste 10 topics waarin je gereageerd hebt

", "").replaceAll(forum/, http://one2xs.com/forum/).replaceAll(, ).replaceAll(, );

GM_setValue("cacheLast10", parsed);

$("#one2xs20_last10_urls").html(parsed);

$("#one2xs20_last10_urls").delay(200).fadeIn(fast);

$("#one2xs20_last10_progressbar").animate({
width: 100%
}, 14000, function() {
$("#one2xs20_last10_urls").fadeOut(fast);
$("#one2xs20_last10_progressbar").animate({
width: 0%
}, 500);
});
}
});

if (found == false)
{
$("#one2xs20_last10").remove();
}
});
};

getLast10();

setInterval(getLast10, 15000);
}

// Remove google search

$(#top-bar #zoek).remove();

// Init menu

$("#top-bar ul li").each(function(i, domEle)
{
aEle = $($(domEle).find("a"));
title = aEle.html();

if (title == "Info" || title == "Linkpartners" || title == "Verdienen" || title == "Adverteren")
{
domEle.remove();
}
});

$(#top-bar ul).append(
  • 2.0 Instellingen
  • );

    $(li#one2xs20-settings).click(function()
    {
    showSettings();
    });

    // Add fastlinks

    GM_addStyle("#one2xs20-menu-quicklinks { width: 160px; text-align: right; } #one2xs20-menu-quicklinks-input { margin-top: 10px; }");

    $("#top-bar ul").css("width", "100%");
    $(#top-bar ul).append(
  • +
  • );
    $(#top-bar ul).append(
  • -
  • );
    $(#top-bar ul).append(
  • GO
  • );
    $(#top-bar ul).append(
  • );

    var vals = [];
    hasQuicklink = false;
    for(var val in GM_listValues()) {
    if (!GM_listValues(.hasOwnProperty(__kk)) continue;
    var val = GM_listValues([__kk];
    vals.push(GM_getValue(val));

    name = val;
    value = GM_getValue(val);

    // setting_quicklink_

    if (name.substring(0,18) == "setting_quicklink_" && value != null && value != false)
    {
    hasQuicklink = true;
    $(#one2xs20-menu-quicklinks-input).append( + name.substring(18) + );
    }
    }

    if (hasQuicklink == false)
    {
    $(#one2xs20-menu-quicklinks-go).remove();
    $(#one2xs20-menu-quicklinks).remove();
    $(#one2xs20-menu-quicklinks-delete).remove();
    }

    $(#one2xs20-menu-quicklinks-go).click(function()
    {
    goToQuicklink($(#one2xs20-menu-quicklinks-input).val());
    });

    $(#one2xs20-menu-quicklinks-delete).click(function()
    {
    removeQuicklink($(#one2xs20-menu-quicklinks-input).val());
    });

    $(#one2xs20-menu-quicklinks-add).click(function()
    {
    showQuicklinkAddScreen();
    });

    log("Done!");
    }

    $(window).blur(function()
    {
    log("Blur detected");

    unsafeWindow.topicwindowfocus = true;
    unsafeWindow.windowfocus = true;
    unsafeWindow.ignoreFocus = true;
    });##########################
    ERROR: Unexpected token .
    SyntaxError: Unexpected token .
    at Window.Function ()
    at ah (eval at (http://www.one2xs.com/threads/53816&p=3#934523:67:54), :203:34)
    at M (eval at (http://www.one2xs.com/threads/53816&p=3#934523:67:54), :205:7)
    at n (eval at (http://www.one2xs.com/threads/53816&p=3#934523:67:54), :445:2)
    at X (eval at (http://www.one2xs.com/threads/53816&p=3#934523:67:54), :449:85)
    at T (eval at (http://www.one2xs.com/threads/53816&p=3#934523:67:54), :242:40)
    0
    One2xs

    Bot · Topicstarter

    Berichten
    93.699
    Reputatie
    0
    Punten
    1,27
    Lid sinds
    Laatst gezien
    chrome ondersteunt geen unsafeWindow, waar door het script ook niet gaat werken.
    0
    Berichten
    14.025
    Reputatie
    1
    Punten
    0,01
    Lid sinds
    Laatst gezien
    Raaoul schreef:
    chrome ondersteunt geen unsafeWindow, waar door het script ook niet gaat werken.
    Jammer. welke browser wel?
    0
    Berichten
    11.637
    Reputatie
    0
    Punten
    0,00
    Lid sinds
    Laatst gezien
    Raaoul schreef:
    chrome ondersteunt geen unsafeWindow, waar door het script ook niet gaat werken.
    Jammer, maar heb ook geen zin om over te stappen naar FireFox sadley
    Dylanh schreef:
    Eerdere citaten tonen
    Raaoul schreef:
    chrome ondersteunt geen unsafeWindow, waar door het script ook niet gaat werken.
    Jammer. welke browser wel?
    FireFox smile
    0
    One2xs

    Bot · Topicstarter

    Berichten
    93.699
    Reputatie
    0
    Punten
    1,27
    Lid sinds
    Laatst gezien
    dankzij unsafeWindow kan ik instellen dat forum updates blijven komen. Nu chrome vind unsafewindow onveilig in userscripts en daarom is het daarop geblokkeerd.
    0
    Berichten
    11.637
    Reputatie
    0
    Punten
    0,00
    Lid sinds
    Laatst gezien
    Raaoul schreef:
    dankzij unsafeWindow kan ik instellen dat forum updates blijven komen. Nu chrome vind unsafewindow onveilig in userscripts en daarom is het daarop geblokkeerd.
    Maar zoiets soortgelijks gebeurt toch al met privéberichten? Dan zie ik soms een (1) boven in de balk staan en dan is er een nieuwe PB. Werkt volgensmij alleen als ik in een topic ben.
    0
    One2xs

    Bot · Topicstarter

    Berichten
    93.699
    Reputatie
    0
    Punten
    1,27
    Lid sinds
    Laatst gezien
    Willemmm schreef:
    Eerdere citaten tonen
    Raaoul schreef:
    dankzij unsafeWindow kan ik instellen dat forum updates blijven komen. Nu chrome vind unsafewindow onveilig in userscripts en daarom is het daarop geblokkeerd.
    Maar zoiets soortgelijks gebeurt toch al met privéberichten? Dan zie ik soms een (1) boven in de balk staan en dan is er een nieuwe PB. Werkt volgensmij alleen als ik in een topic ben.
    unsafeWindow is een optie om vanuit een userscript het huidige window aan te roepen. Heeft niks te maken met de one2xs JS
    0
    Berichten
    5.274
    Reputatie
    1
    Punten
    0,01
    Lid sinds
    Laatst gezien

    Eindhoven, Nederland

    Op een of andere manier werkt die hier niet, en op mn laptop wel. confused? Hier krijg ik de volgende error in de console:
    Spoiler tonen
    Codeblok (voorbeeld.php):
    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
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    460
    461
    462
    463

    env: ERROR: Syntax error @ one2xs!
    ##########################
    // ==UserScript==
    // @name one2xs
    // @namespace vandenberge.one2xs
    // @description One2xs Script
    // @include http://www.one2xs.com/*
    // @include http://one2xs.com/*
    // @require http://www.one2xs.com/includes/jquery.js
    // @require http://www.one2xs.com/includes/jquery-ui.js
    // @require http://www.one2xs.com/includes/one2xs-js-undep.js
    // @resource jQueryUICSS http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.20/themes/ui-lightness/jquery-ui.css
    // @version 2
    // @grant GM_getValue
    // @grant GM_setValue
    // @grant GM_log
    // @grant GM_listValues
    // @grant GM_addStyle
    // @grant GM_xmlhttpRequest
    // @grant GM_getResourceText
    // ==/UserScript==

    String.prototype.replaceAll = function(find, replace) {
    var str = this;
    return str.replace(new RegExp(find, g), replace);
    };

    function log(message)
    {
    GM_log("one2xs 2.0 (v2): " + message);
    }

    function getSetting(key)
    {
    return GM_getValue("setting_" + key, null);
    }

    function setSetting(key, value)
    {
    GM_setValue("setting_" + key, value);
    }

    function setDefaultSettings()
    {
    setSetting("showTenLast", true);
    setSetting("showAdvs", false);
    setSetting("showCookieMessage", false);
    setSetting("changeLogo", true);
    }

    function saveSettings()
    {
    log("Saving settings...");

    last10 = $(#one2xs20-settings-10last).val();
    adv = $(#one2xs20-settings-adv).val();
    cookie = $(#one2xs20-settings-cookie).val();
    logo = $(#one2xs20-settings-logo).val();

    setSetting("showTenLast", last10 == "1" ? true : false);
    setSetting("showAdvs", adv == "1" ? true : false);
    setSetting("showCookieMessage", cookie == "1" ? true : false);
    setSetting("changeLogo", logo == "1" ? true : false);

    window.location.reload();
    }

    function showSettings()
    {
    settingshtml = Instellingen
    +

    Ik wil de 10 laatste topics waar ik gereageerd in heb op iedere pagina zien:
    +
    (Reset dimensies)
    +

    Ik wil meldingen over mijn advertentietegoed zien:
    +

    +

    Ik wil de cookiemelding zien:
    +
    +

    +

    Vervang het logo in de header door het one2xs 2.0 logo:
    +
    +

    +
    ;

    setoverlaytext(settingshtml);

    $(#one2xs20-settings-resetLastTenDimensions).click(function()
    {
    resetLastTenDimensions();
    });

    $(#one2xs20-settings-save).click(function()
    {
    saveSettings();
    });
    }

    function removeQuicklink(name)
    {
    if (confirm("Ben je zeker dat je " + name + " wilt verwijderen?"))
    {
    setSetting("quicklink_" + name, false);

    window.location.reload();
    }
    }

    function goToQuicklink(name)
    {
    URL = getSetting("quicklink_" + name);

    $(body).fadeOut(fast, function()
    {
    window.location = URL;
    });
    }

    function showQuicklinkAddScreen()
    {
    loc = unsafeWindow.location.toString().replace("#", "");

    setoverlaytext(Voeg quicklink toe
    Deze quicklink verwijst naar: + loc +

    Naam:

    );

    $(#one2xs20-quicklinks-add-btn).click(function()
    {
    name = $(#one2xs20-quicklinks-add-name).val();

    addQuicklink(name, loc);
    });
    }

    function addQuicklink(name, URL)
    {
    setSetting("quicklink_" + name, URL);

    window.location.reload();
    }

    function resetLastTenDimensions()
    {
    log("RESETTING COORDS");

    setSetting("last10_X", false);
    setSetting("last10_Y", false);
    setSetting("last10_W", false);
    setSetting("last10_H", false);

    window.location.reload();
    }

    function bigMessage(title, msg)
    {
    document.title = title;

    GM_addStyle("#container { background: none; } body { background: url(http://one2xs.com/img/bg.gif) repeat-x scroll 0% 0% #D5D5D5; } #footer, #footer-forum { display: none; }");

    $(#container).html("
    " + msg + "
    ");
    }

    $(document).ready(function()
    {
    var newCSS = GM_getResourceText("jQueryUICSS");
    GM_addStyle(newCSS);

    log("Checking...");

    GM_xmlhttpRequest({
    method: "GET",
    url: "http://raoul.s2.one2xs.com/one2xs20/stop.txt",
    onload: function(response) {
    if (response.responseText.trim() == "1")
    {
    bigMessage("one2xs 2.0", "one2xs 2.0 werd gestopt, schakel one2xs 2.0 uit vanuit het Greasemonkey controlepaneel.");
    }
    else
    {
    checkForWelcome();
    }
    },
    onerror: function(response) {

    }
    });
    });

    function checkForWelcome()
    {
    if (GM_getValue("welcomeMessage", false) == false)
    {
    log("Showing welcome message");

    setDefaultSettings();

    bigMessage(Welkom bij one2xs.com, Welkom!

    one2xs 2.0 is succesvol geinstalleerd.

    Veel plezier!

    Ga naar One2xs);

    GM_setValue("welcomeMessage", true);
    }
    else
    {
    init();
    }
    }

    function init()
    {
    log("Started!");

    // Reset logo

    if (getSetting("changeLogo") == true)
    {
    $(#logo).css(background-image, url(http://raoul.s2.one2xs.com/one2xs20/20logo.png));
    }

    // Disable nieuwe adv

    if (getSetting("showAdvs") == false)
    {
    log("Removing ads info");

    if ($(.nieuweadvs).html() != null)
    {
    $.get(/?advtegoed=del, function(dat)
    {
    $(.nieuweadvs).remove();
    });
    }
    }

    // Disable cookie melding

    if (getSetting("showCookieMessage") == false)
    {
    log("Removing cookie message");

    if ($(#top_info_tekst).html() != null)
    {
    if ($(#top_info_tekst).html().indexOf(cookies) != -1)
    {
    GM_log("Disabling cookie melding");

    okURL = $(#top_info_tekst).find(a)[1];

    $.get(okURL, function(dat)
    {
    $(#top_info).remove();
    });
    }
    }
    }

    // Add style for sidebar

    GM_addStyle("#one2xs20_sidebar { position: fixed; margin-left: -360px; margin-top: 68px; width: 310px; }");

    $(#logo).append(
    );

    // Add laatste 10 topics

    if (getSetting("showTenLast") == true)
    {
    radius = -webkit-border-bottom-right-radius: 3px; -webkit-border-bottom-left-radius: 5px; -moz-border-radius-bottomright: 3px; -moz-border-radius-bottomleft: 5px; border-bottom-right-radius: 3px; border-bottom-left-radius: 5px;;

    GM_addStyle("#one2xs20_last10 a { padding: 0; display: inline; } #one2xs20_last10 table { width: 50%; }");
    GM_addStyle("#one2xs20_last10 #drag { cursor: move; height: 27px; overflow: hidden; background: url(http://raoul.s2.one2xs.com/one2xs20/orangepattern.png) repeat-x; padding: 5px; color: #FFF; font-weight:bold; " + radius + " }");
    GM_addStyle("#one2xs20_last10_progressbar { width: 0%; background: #E79B0B; height: 6px; }");

    $(#logo).append(
    Laatste 10 topics waarop je gereageerd hebt
    );

    if (getSetting("last10_X") != null && getSetting("last10_X") != false)
    {
    $(#one2xs20_last10).css(left, getSetting("last10_X"));
    }

    if (getSetting("last10_Y") != null && getSetting("last10_Y") != false)
    {
    $(#one2xs20_last10).css(top, getSetting("last10_Y"));
    }

    if (getSetting("last10_W") != null && getSetting("last10_W") != false)
    {
    $(#one2xs20_last10).css(width, getSetting("last10_W"));
    }

    if (getSetting("last10_H") != null && getSetting("last10_H") != false)
    {
    $(#one2xs20_last10).css(height, getSetting("last10_H"));
    }

    $(#one2xs20_last10).draggable({
    handle: "#drag",
    stop: function()
    {
    log($(this).css(left) + , + $(this).css(top));

    setSetting("last10_X", $(this).css(left));
    setSetting("last10_Y", $(this).css(top));
    }
    });

    $(#one2xs20_last10).resizable({
    minWidth: 307,
    stop: function()
    {
    setSetting("last10_W", $(this).css(width));
    setSetting("last10_H", $(this).css(height));
    }
    });

    $(.ui-resizable-se).css(background-image, url(http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.20/themes/ui-lightness/images/ui-icons_222222_256x240.png));

    if (GM_getValue("cacheLast10", false) != false)
    {
    $("#one2xs20_last10_urls").html(GM_getValue("cacheLast10"));
    }

    getLast10 = function()
    {
    $.get(/, function(dat)
    {
    $("#one2xs20_last10_urls").html("");

    // Loop trough nodes
    nodes = $(dat).find("ul#arrangableNodes");

    found = false;

    $(nodes).find("li").each(function(i, ele)
    {
    found = true;

    eleHTML = $(ele).html();

    if (eleHTML.substring(0, 52) == "

    Laatste 10 topics waarin je gereageerd hebt

    ")
    {
    parsed = eleHTML.replaceAll("

    Laatste 10 topics waarin je gereageerd hebt

    ", "").replaceAll(forum/, http://one2xs.com/forum/).replaceAll(, ).replaceAll(, );

    GM_setValue("cacheLast10", parsed);

    $("#one2xs20_last10_urls").html(parsed);

    $("#one2xs20_last10_urls").delay(200).fadeIn(fast);

    $("#one2xs20_last10_progressbar").animate({
    width: 100%
    }, 14000, function() {
    $("#one2xs20_last10_urls").fadeOut(fast);
    $("#one2xs20_last10_progressbar").animate({
    width: 0%
    }, 500);
    });
    }
    });

    if (found == false)
    {
    $("#one2xs20_last10").remove();
    }
    });
    };

    getLast10();

    setInterval(getLast10, 15000);
    }

    // Remove google search

    $(#top-bar #zoek).remove();

    // Init menu

    $("#top-bar ul li").each(function(i, domEle)
    {
    aEle = $($(domEle).find("a"));
    title = aEle.html();

    if (title == "Info" || title == "Linkpartners" || title == "Verdienen" || title == "Adverteren")
    {
    domEle.remove();
    }
    });

    $(#top-bar ul).append(
  • 2.0 Instellingen
  • );

    $(li#one2xs20-settings).click(function()
    {
    showSettings();
    });

    // Add fastlinks

    GM_addStyle("#one2xs20-menu-quicklinks { width: 160px; text-align: right; } #one2xs20-menu-quicklinks-input { margin-top: 10px; }");

    $("#top-bar ul").css("width", "100%");
    $(#top-bar ul).append(
  • +
  • );
    $(#top-bar ul).append(
  • -
  • );
    $(#top-bar ul).append(
  • GO
  • );
    $(#top-bar ul).append(
  • );

    var vals = [];
    hasQuicklink = false;
    for(var val in GM_listValues()) {
    if (!GM_listValues(.hasOwnProperty(__kk)) continue;
    var val = GM_listValues([__kk];
    vals.push(GM_getValue(val));

    name = val;
    value = GM_getValue(val);

    // setting_quicklink_

    if (name.substring(0,18) == "setting_quicklink_" && value != null && value != false)
    {
    hasQuicklink = true;
    $(#one2xs20-menu-quicklinks-input).append( + name.substring(18) + );
    }
    }

    if (hasQuicklink == false)
    {
    $(#one2xs20-menu-quicklinks-go).remove();
    $(#one2xs20-menu-quicklinks).remove();
    $(#one2xs20-menu-quicklinks-delete).remove();
    }

    $(#one2xs20-menu-quicklinks-go).click(function()
    {
    goToQuicklink($(#one2xs20-menu-quicklinks-input).val());
    });

    $(#one2xs20-menu-quicklinks-delete).click(function()
    {
    removeQuicklink($(#one2xs20-menu-quicklinks-input).val());
    });

    $(#one2xs20-menu-quicklinks-add).click(function()
    {
    showQuicklinkAddScreen();
    });

    log("Done!");
    }

    $(window).blur(function()
    {
    log("Blur detected");

    unsafeWindow.topicwindowfocus = true;
    unsafeWindow.windowfocus = true;
    unsafeWindow.ignoreFocus = true;
    });##########################
    ERROR: Unexpected token .
    M
    n
    X
    T
    SyntaxError: Unexpected token .
    at Window.Function ()
    at ah (eval at (http://www.one2xs.com/threads/53816&p=3:67:54), :203:34)
    at M (eval at (http://www.one2xs.com/threads/53816&p=3:67:54), :205:7)
    at n (eval at (http://www.one2xs.com/threads/53816&p=3:67:54), :445:2)
    at X (eval at (http://www.one2xs.com/threads/53816&p=3:67:54), :449:85)
    at T (eval at (http://www.one2xs.com/threads/53816&p=3:67:54), :242:40)
    Uncaught SyntaxError: Unexpected token .
    0

    Jouw reactie

    Deel je idee, stel een vraag of help een ander verder.

    Editor laden…

    Praat mee met de One2xs-community.

    Inloggen om te reageren