forked from graulund/superdAmn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
superdamn.user.js
3284 lines (3167 loc) · 207 KB
/
superdamn.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
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
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// ==UserScript==
// @name SuperdAmn
// @namespace 24bps.com
// @description Next generation dAmn awesomeness. Version 1.0.10.
// @author Andy Graulund <andy@graulund.com>
// @version 1.0.11
// @include http://chat.deviantart.com/chat/*
// @include https://chat.deviantart.com/chat/*
// @include https://chat.deviantart.lan/chat/*
// @grant GM_xmlhttpRequest
// @grant GM_getValue
// @grant GM_setValue
// @grant GM_log
// ==/UserScript==
// LAST UPDATED: 2015-31-12
var superdAmn_GM = !!window.navigator.userAgent.match(/(firefox|iceweasel)/i)
// PROLOGUE:
sd = freeFunctionString((function(){
// JSON madness goes here
if(!("JSON" in window)){ eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('3(!o.p){p={}}(5(){5 f(n){7 n<10?\'0\'+n:n}3(6 1b.z.q!==\'5\'){1b.z.q=5(h){7 o.1C()+\'-\'+f(o.1T()+1)+\'-\'+f(o.1O())+\'T\'+f(o.1D())+\':\'+f(o.1M())+\':\'+f(o.1Q())+\'Z\'};X.z.q=1K.z.q=1I.z.q=5(h){7 o.1V()}}y L=/[\\1W\\13\\1o-\\1l\\1m\\1i\\1n\\1s-\\1p\\1j-\\15\\17-\\14\\18\\1f-\\19]/g,M=/[\\\\\\"\\1B-\\1z\\1w-\\1y\\13\\1o-\\1l\\1m\\1i\\1n\\1s-\\1p\\1j-\\15\\17-\\14\\18\\1f-\\19]/g,8,H,1e={\'\\b\':\'\\\\b\',\'\\t\':\'\\\\t\',\'\\n\':\'\\\\n\',\'\\f\':\'\\\\f\',\'\\r\':\'\\\\r\',\'"\':\'\\\\"\',\'\\\\\':\'\\\\\\\\\'},l;5 N(m){M.1h=0;7 M.11(m)?\'"\'+m.C(M,5(a){y c=1e[a];7 6 c===\'m\'?c:\'\\\\u\'+(\'1k\'+a.1r(0).12(16)).1g(-4)})+\'"\':\'"\'+m+\'"\'}5 E(h,w){y i,k,v,e,K=8,9,2=w[h];3(2&&6 2===\'x\'&&6 2.q===\'5\'){2=2.q(h)}3(6 l===\'5\'){2=l.P(w,h,2)}1u(6 2){J\'m\':7 N(2);J\'S\':7 1v(2)?X(2):\'D\';J\'1x\':J\'D\':7 X(2);J\'x\':3(!2){7\'D\'}8+=H;9=[];3(Q.z.12.1S(2)===\'[x 1R]\'){e=2.e;G(i=0;i<e;i+=1){9[i]=E(i,2)||\'D\'}v=9.e===0?\'[]\':8?\'[\\n\'+8+9.O(\',\\n\'+8)+\'\\n\'+K+\']\':\'[\'+9.O(\',\')+\']\';8=K;7 v}3(l&&6 l===\'x\'){e=l.e;G(i=0;i<e;i+=1){k=l[i];3(6 k===\'m\'){v=E(k,2);3(v){9.1c(N(k)+(8?\': \':\':\')+v)}}}}R{G(k 1t 2){3(Q.1q.P(2,k)){v=E(k,2);3(v){9.1c(N(k)+(8?\': \':\':\')+v)}}}}v=9.e===0?\'{}\':8?\'{\\n\'+8+9.O(\',\\n\'+8)+\'\\n\'+K+\'}\':\'{\'+9.O(\',\')+\'}\';8=K;7 v}}3(6 p.W!==\'5\'){p.W=5(2,A,I){y i;8=\'\';H=\'\';3(6 I===\'S\'){G(i=0;i<I;i+=1){H+=\' \'}}R 3(6 I===\'m\'){H=I}l=A;3(A&&6 A!==\'5\'&&(6 A!==\'x\'||6 A.e!==\'S\')){1a 1d 1E(\'p.W\')}7 E(\'\',{\'\':2})}}3(6 p.Y!==\'5\'){p.Y=5(B,U){y j;5 V(w,h){y k,v,2=w[h];3(2&&6 2===\'x\'){G(k 1t 2){3(Q.1q.P(2,k)){v=V(2,k);3(v!==1L){2[k]=v}R{1J 2[k]}}}}7 U.P(w,h,2)}L.1h=0;3(L.11(B)){B=B.C(L,5(a){7\'\\\\u\'+(\'1k\'+a.1r(0).12(16)).1g(-4)})}3(/^[\\],:{}\\s]*$/.11(B.C(/\\\\(?:["\\\\\\/1G]|u[0-1X-1U-F]{4})/g,\'@\').C(/"[^"\\\\\\n\\r]*"|1A|1P|D|-?\\d+(?:\\.\\d*)?(?:[1N][+\\-]?\\d+)?/g,\']\').C(/(?:^|:|,)(?:\\s*\\[)+/g,\'\'))){j=1F(\'(\'+B+\')\');7 6 U===\'5\'?V({\'\':j},\'\'):j}1a 1d 1H(\'p.Y\')}}}());',62,122,'||value|if||function|typeof|return|gap|partial|||||length|||key||||rep|string||this|JSON|toJSON||||||holder|object|var|prototype|replacer|text|replace|null|str||for|indent|space|case|mind|cx|escapable|quote|join|call|Object|else|number||reviver|walk|stringify|String|parse|||test|toString|u00ad|u206f|u202f||u2060|ufeff|uffff|throw|Date|push|new|meta|ufff0|slice|lastIndex|u17b4|u2028|0000|u0604|u070f|u17b5|u0600|u200f|hasOwnProperty|charCodeAt|u200c|in|switch|isFinite|x7f|boolean|x9f|x1f|true|x00|getUTCFullYear|getUTCHours|Error|eval|bfnrt|SyntaxError|Boolean|delete|Number|undefined|getUTCMinutes|eE|getUTCDate|false|getUTCSeconds|Array|apply|getUTCMonth|fA|valueOf|u0000|9a'.split('|'),0,{})) }
// XPATH madness goes here -- Based upon the $x in Firebug, modified by Zikes
function $x(xpath,root){var got=document.evaluate(xpath,root||document,null,null,null),result=[];while(next=got.iterateNext())result.push(next);return result;}
// RegExp escape madness goes here -- By Simon Willison: https://simonwillison.net/2006/Jan/20/escape/
RegExp.escape=function(a){if(!arguments.callee.sRE){var b=["/",".","*","+","?","|","(",")","[","]","{","}","\\"];arguments.callee.sRE=new RegExp("(\\"+b.join("|\\")+")","g")}return a.replace(arguments.callee.sRE,"\\$1")}
// If we're using Firefox, we must assume "real" Greasemonkey
var superdAmn_GM = window.superdAmn_GM = !!window.navigator.userAgent.match(/(firefox|iceweasel)/i)
// SUPERDAMN
// Made by Andy Graulund / electricnet
// <electricnet.deviantart.com>
// <pongsocket.com>
// <andy@graulund.com>
// On GitHub at github.com/graulund/superdAmn -- contribute your ideas!
// With significant portions made by or inspired by products made by:
// siebenzehn, Zikes, zachriel, exsecror, realillusions, electricjonny,
// sumopiggy, miksago, Kiwanji, Plizzo, KnightAR, deviant-garde, Pickley
// Thank you guys!
// Copyright (c) 2009 - 2015 Andy Graulund / electricnet
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
var superdAmn = window.superdAmn = {
// Variables being initialized
v: "1.0.11",
vd: 1502442622,
imgs: new Array(
/* Brighter faded background*/ "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB8AAAAfCAYAAAAfrhY5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAC5JREFUSMftzTEBADAIAKDZP9Ry6G0QY+gBBYjq/G9JyOVyuVwul8vlcrlcfiYfH9RnijOp+oUAAAAASUVORK5CYII=",
/* Preferences icon */ "data:image/gif;base64,R0lGODlhEAAQAJEAAJifm3CGdmZwbzJAQSH5BAEHAAEALAAAAAAQABAAAAIyjD2px6G/GJzjPAESEA8pkA1gB41iSJ2gmWIrlyYuHGtofVJOeSfew4rsag1i4yc0FAAAOw==",
/* Subheader seperation line*/ "data:image/gif;base64,R0lGODlhFAABAIAAALS9tAAAACH5BAAHAP8ALAAAAAAUAAEAAAIEhI+ZBQA7",
/* FAQ code down arrow */ "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABZ0RVh0Q3JlYXRpb24gVGltZQAwNy8xMS8wOSd6L58AAAAcdEVYdFNvZnR3YXJlAEFkb2JlIEZpcmV3b3JrcyBDUzQGstOgAAAANklEQVQoz2NgQAM5leX/kTEDITAiNAAFF6ArwoMXkKJpASk2LcDl/gVEK8ahaQEDMQCqCatiAEQjlwNkG+8AAAAAAElFTkSuQmCC",
/* Normal tabs */ "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADbCAYAAAAoGt6rAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNAay06AAAAAWdEVYdENyZWF0aW9uIFRpbWUAMTIvMTEvMDm56ACmAAACt0lEQVR42u3XSU7jQBSA4RzNR8ySDftuJpllExBIjK3uhiSMSZgvUvghxzGV9AGQv5K+lb16er9c7vVaZ21nvaiUlQQdFLtf9Fad6kE/Xvo52E5n44s0e59BZ8TOx+7XofRTSstxHPw5TNO3KXRWNDCPpH2tquOYQOe1IikikPLHYCtNXh+AWjQRbUQg6WR0mh5e74FaNBFtfAZy/3IHZBaBPN8CmSaQu+cbINMEcvt0DWSaQG6exkBmEcjjCMg0gVzPhkCmCWQ8uwIyTSCj6SWQaQXyD8g0gQwnf4GMQEAgIBAQCAgEBAICAYGAQEAggEBAICAQEAgIBAQCAgGBgEBAIAIBgYBAQCAgEBAICAQEAg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QiEMBgYBAQCAgEBAICAQEAgIBgYBABAICAYGAQEAgIBAQCAgEBAICAQQCAgGBgEBAICAQEAgIBAQCAhEICAQEAgIBgYBAQCAgEBAICAQQCAgEBAICAYGAQEAgIBAQCAhEICAQEAgIBAQCAgGBgEBAICAQQCAgEBAICAQEAgIBgYBAQCAgEIGAQEAgIBAQCAgEBAK3Gwiw4d/qC7kai1mfi7uf07XVNwbnYzZt2Izj/eOtPLzcl7unHXQj7nzc/VUk58eqac+vjw6LrkUDzXKav3NEPQ4Idu0nyXj5mddjFSyPW6v/gzgYWAgEBAICAYGAQEAgIBAQCAgEBCIQEAgIBAQCAgGBgEBAICAQEAgIRCAgEBAICAQEAgIBgYBAQCAgEIcCAgGBgEBAICAQEAgIBAQCAgGBCAQEAgIBgYBAQCAgEBAICAQEAggEBAICAYGAQEAgIBAQCAgEBCIQEAgIBAQCAgGBgEBAICAQEAggEBAICAQEAgIBgYBAQCAgEBCIQEAgIBAQCAgEBAICAYGAQEAggEBAICAQEAgIBAQCAgGBgEBAIAIBgYBAQCAgEBAICARuM5A/rcCCu43mRbwAAAAASUVORK5CYII=",
/* View emote dev icon */ "data:image/gif;base64,R0lGODlhDAAHALMAAPf39/X29fX19fPz8/Ly8ujp6d3f39DU09DT08bLysTJyMDGxbrAv6Srqo+ZmI+ZlyH5BAEHAAAALAAAAAAMAAcAAAQp8DxHHQIYuzQAWQ9gPAbgCFngYGOxAs0jz3OmsY+rCDyzjiVEhXKxRQAAOw==",
/* Bold button */ "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAK8AAACvABQqw0mAAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNAay06AAAAFmSURBVDjLnZM7T8JQGIb5SST8GV1xFneYYHKDP+AMCjp4AxdiDZdQhUq4CHIttNKAILTFieS1XxO+0LAUh6cn38n7vOk5yfFEYhGvRcsCB0KO12N9pEq9AnNtYmWsXEFZciy3QQUb3dAhqzIG44ErKGuYhv0nVIDFcoGu3D0Icrhg/jNHu//JJO4SOPIfO6C93Qw5XDBbzNDsfjDXmRtbyghPWP+uETwPwX964siQwwXT7ylq7TqTekzZBbTSHAgGEAidOTLkcIE20/DerDLJh+TeEWhvN0MOF3xNJyjXyszl/ZUtpZ/T0E0d0YuYPRfKBc6QwwWqpkKsisz2EmmlORwN23P+Lc8ZcrhgPBmjWCky8dv43hHoPsR3kTPkcMFIHSH3mmManSaW+tJBq9dyZMjhgqEiQygJBzFUhlywUazzCKUXZAtZV1DB7h1IUkOCoinojfquUCYKyNk+Jp9F5x/PmRzfH05SJLB/Hd7gAAAAAElFTkSuQmCC",
/* Italic button */ "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAK8AAACvABQqw0mAAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNAay06AAAAFGSURBVDhPlZM9T8JQFED5SST8GV3FUZ2dCTOIs8YfQMJmwoSpEAgYKF9FoJV+vdqGCpYWN5Lru4258aVLO5wu952T9t00V7or5TlLDmQEnXyOP+TRfATHnyMcokMq8Cw63FUwcAqjEEzHBN3WU4Fno2MUvwkGYB/sQTO1TKBDgd33DlabdSbQoYC/92GhvQu0ui9wdnFOVB4qwhwdCmy/tjBbzQXW+hqaUjOWG80GuFtXmKNDAc/3YLyYJKg91eKArMiJGToU+OT14WyY4Or2Goo3lzBdThMzdCjgeA4MJgOB9qDN5SKU78uJGYIOBWzXht6oR9Sf68IFVh+rwhxBhwKWY0HnrUPIyhiCMCBUQxXmCDoUMJgJUl/KhMEMCpwY/x6p/8p330oFBv7fgYxrYh6DD2uTCuayeLWlv5+pwFGxlhF0Cr/7xDXDumfN4AAAAABJRU5ErkJggg==",
/* Underline button */ "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAA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k/Ufe4WAgWn78Aw5gaJUJDtrQohNoLgyJ+plvP5j98ZTu0PkWIpddgVWOsAAAAASUVORK5CYII=",
/* Thumb button */ "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAK8AAACvABQqw0mAAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNAay06AAAAFKSURBVDjLnZO/SsNQHIW7+RiOroU+gm/gazi6OxRncXATCoK7i6BTIRoMqTax9I9WY5q0NzY0NtokBcHCz3su3IuBYlMPfBku5zskgVuqHlXLnCcOrQmccok/bKtjUTbPaJbOCoEuHO52MbBI0oT8wKfBaFAIdNMsFW+CAYo/Y3J8Zy3gqIHpx5T67rNgVWQPjhqI4oh6zqMA2di7WQoie3DUwOR9Qu1+R4Bs7uu0dZLkwBkie3DUQBiF9NBrCZDtQ4N2zuc5cIbIHhw18DYZU7PdFCC7pyYdGF85cIbIHhw1EIQBNVoNAXJ8cU+X7ncOnCGyB0cNjMYjMixDgFzp1lIQ2YOjBobBkPQ7XbAqsgdHDXjMJ83UBLWz2p/Insc8NbBg/Hs085rqt/VCYOD3P7Dtrk0sZPQ6dAvBxozgyMtU4bz84zrDqfwArwg/H/norJQAAAAASUVORK5CYII=",
/* External image button */ "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAK8AAACvABQqw0mAAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNAay06AAAAFJSURBVDjLnZO/SsNQHIX7Ni4OhW4+gM/g4Obo7qjQXXDSLYOIb6CLUIgUSytNDE1bW2ObPzcmJDa2TdwKP3Mu3IuBYlMPfBku5zskgVupX9SrOa85tCVwqpX8oWumRtl3Rot0UQp04eRuHwOrZbokx3do6k1LgW6apfxNMEDJPCHLsbYCjhyYfc1oNBlzNkX04MiBOIlpYA05yPXBzloQ0YMjB6LPiHojk4PcHe2ScbpfAGeI6MGRA2Ec0svA4CD6yR6Nr44L4AwRPThy4CMKqNvrcpDh+SH595cFcIaIHhw54Ic+dYwOB7Fvz2huqgVwhogeHDngBR61tBYHCR6UtSCiB0cOuL5LzecmZ1NED44csJlDalvlKDfKn4iezWw5sGL596jtR2o8NUqBgd//QNf7OrGQ0bs7KQULGMERl6mW8/aP6wyn9gNiYDwvlb5hJQAAAABJRU5ErkJggg==",
/* Code button */ "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAK8AAACvABQqw0mAAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNAay06AAAAEySURBVDjLnZPLTsJAFED5JBI+pR+Daxa49RtIXBCJYeGapIZIoKWl8lC0Qh/Th22pQuuO5Dq3iTctq46L08XcOSedSabRuek0Oa8cEASdZoN/dG2lQf6TwzE71gL3osPdNQbOp+wEtmfD3t3XAvdmeVb8CQYg/U7BtE0h0KHA4esA292bEOhQIE5j2JgvFXq3PZAkibico0OBKIlguV0RykIppO51F5I0KSjPEXQoEMYhLDYGMXwYFoH+Xb+yXgYdCvhRAPPlnFANtQi0r9qV9TLoUMALPZgZM0J9VmFwP6jcQXmOoEMBN3Bhok0q4Dn9T5+4nKNDAcdzYKyMhUCHAhazQZ7KQljMosCZ8fPI00cYPY1qgYHyHej6WgcWMvhwdrVgAQN0/h5Ti/P+j+eMTusX9Ic23tVnfFwAAAAASUVORK5CYII=",
/* Bcode button */ "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAK8AAACvABQqw0mAAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNAay06AAAAGdSURBVDjLnZNLSwJRGIb7SYE/xbXbbKURSVA7sbIW1iYoLC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ETGERCB1DKAAAAAElFTkSuQmCC",
/* Subscript button */ "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAK8AAACvABQqw0mAAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNAay06AAAAEWSURBVDjLnZPNasJAFIV9JMFHyRu5dBFU+kKCILWYVPxpbVPNz6QJSU2rSXfC6ZyBDLNoIdPFl3PvzD2HzMD0huNhX/IsgSX09Hvy43tbD813g0t96QRn6ZHeHQNu1/qKKI1wSk6d4Gzd1OpPGIDqq0IQBVbQowPOn2ccji9W0KMDyqrEPniygh4dUHwU2By2VtCjA/Iyx+N+jcndFI7jqPo3JZxhT48OeC8yrDYrNUA167+UHh2Q5imW66XapJq1qcSduqqnRwckWYKFt1BwqIvSowPiNMb8Ya7gQBelRweEIsLsfqY2R+5I1VSzb4/Q9qEIdcBNyPNw0QbzDnx/50PkAm/xsRMiE6CnfUwDyes/njM9gx/BSBkoPfKmXwAAAABJRU5ErkJggg==",
/* Website embed button */ "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAQCAYAAADwMZRfAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAK8AAACvABQqw0mAAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNAay06AAAAJDSURBVDgRBcExb5VlHAfQ83/vK1f9CBhDLBfIJYFeFljK5KgTLk4uwAfRL+DekDiZsGoYjCTGuJlIgDZtQi3q4AYtFSvR9n2en+fUF19+vkrVfVxKYqhCiSglAkAiqCqVksqzJJ+OUV99/OFHly58cFHrEylDlYhSIiAoCDCbzez98eulBw8ffD1GrizOLRweHUgCAkFRAEiiqiQxDIPFufOKyyNmU5tM0yQJVSRAUQpQoqNA793Umi5GSGLqjQCFp0+f2nq85fn+c4sLC1dWV1xdXzcUPVFVeu9gLCWJNjUEbG9te/Loib1ne6rK7s6u09NTvXdXV1cJSUgMVYaIlqanab3rvdnZ3rFxc0NVufXJLZv3Nm3c3LCzvWOamtab1rrWu54YhxqkR2td0g012N/bd/a9szbvbSrlzu07YD6fa60hoKcZajBEJNHapLVuaqeWl5cefvfQ3dt3/fbn7wCWl5dab3qP1pr0iBgleu+m1hR6Yv3aysnJid2dXT/98KPr1687/ufY+mpdmyYKSiCM0NO11hCqLC6eV5ifmfvl50eWy6UbN25Yu7jm9fFfeqOK3hvFCOnR2kQVeHV0aO3CmtW1lXfeftebf9/4+/i1w6NDVUWiV0kiiREiWmtUIeDg6KWDVwcCAoSgYCjpUVVGVW02G2c1lDY1CiEAAoBSCGbDzPjWSGKsZPvl4YvV2vtr/js9UQigAAAQEPMzcy8OXijD7qjqzjfff3u/qhalRIAAVSWilJ5uqAEkUeyHz/4HLkRm1OujeC0AAAAASUVORK5CYII=",
/* Multi-line button */ "data:image/gif;base64,R0lGODlhEAAQANUAAP////7+/vz8/Pv7+/n5+fj4+Pf39/X19fT09PPz8/Hx8e/v7+3t7ezs7Orq6unp6ejo6OTk5N/f39vb29fX19PT09DQ0IWSh4WShoSRhYWRhoSRhoOQhISQhYOQhYOPhHWDd15qYP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEHACIALAAAAAAQABAAAAZ1QBFoSCwWRaILYMlsLkHIS2BArVoDUBFGUAh5v4WwIKsZIM7o9CC7ISi+8JCCwDY07vi8gX2AxL8QB1kZCRGGh4gJWR0KEn9eEgpZHgsTlpeYC5MMFI8hFAxZHA0VpaanDVkfDhatrq8Oqg+ztLWzWUa5RCJBADs=",
/* Emotes popup button */ "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAQCAYAAAAS7Y8mAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAK8AAACvABQqw0mAAAABx0RVh0U29m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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEHACEALAAAAAAQABEAAAaqwNDnAwIRicXhUKhoOp9PouJCrVqpkOF0sUgkIpFHYHzJfqaJQUKj4XAiZIn2kghUKgBCh0MAYORndAMcFQEJFR0WAxgTcwsDHRUPCBYeGQWMcw4HHgMPAgweHAaZgQ4LkQ8LFR4dBhuNpmuEFW0dC7CaDmwVBA8ZGgwbFHMPDxoWDaAWGcLEphbBAAANFhYOw3MY29wb3t7PEhIQ4hPmFOjpH0JK7UpG60EAOw==",
/* Remove emote button */ "data:image/gif;base64,R0lGODlhCAAIAKIAAPf39+Pl5bzCwZWfno+ZmAAAAAAAAAAAACH5BAEHAAAALAAAAAAIAAgAAAMaCBIAIYqMEAZZdmRWiWSO9YXSJnwdtDQPkAAAOw=="
),
s: function(){ this.styles = ".damncr .msg .ts { display: table-cell; vertical-align: middle; color: #88938d; font-weight: bold; font-size: 90%; font-style: normal; padding: 0 1ex 0 0; white-space: nowrap; } .damncr .collapsed, .damncr .expanded { top: 0; }\n"
+ ".damncr .gr-box { margin: 0.4em 0.7em; } .damncr .gr-box h2 { font-size: 15px; } .damncr .gr-box .gr-top .gr { padding-bottom: 1px; } .damncr-members { padding-right: 20px; } .damncr-members dl dd { white-space: nowrap; }\n"
+ ".damncrc-chat-window a.lit, .damncrc-topic a.lit, .damncr-title a.lit { text-decoration: none !important; font-style: normal; font-weight: normal; font-variant: normal; } .damncr span.sdltt { height: 133px; display: inline-block; } .damncr span.ffc, .damncr dd.ffc { cursor: pointer; }\n"
+ ".damncr .gr-box .gr-body .gr { padding: 2px 8px; } .damncr .gr-box .superdamnlist { margin: 2px 0; } .damncr .gr-box p { margin: 5px 0; } .gr-box p.nt { margin-top: 0; } .damncr .gr-box p.nt { margin-top: 2px; }\n"
+ ".gr-top a.sdmclose { position: static; float: right; margin: 6px 8px 0 0; width: 15px; height: 15px; background: transparent url(https://st.deviantart.com/minish/messages/close-message.gif) no-repeat 0 0; } .gr-top small.version { float: right; text-align: right; margin: .65em 1.3em 0 0; }\n"
+ ".damncr .gr-top a.sdmclose { margin-top: 4px; } .gr-top a.sdmclose:hover { background-position: -60px 0; } .gr-top a.sdmclose:active { background-position: -75px 0; } .damncri-member { white-space: normal; } .damncri-member .superdamner { color: #728776; }\n"
+ ".damncrc-iconbar .away { background: #ffc url(https://st.deviantart.com/minish/gruzecontrol/icons/devmeet.gif) no-repeat 1px 1px; border: 1px solid #bb9; padding: 1px 4px 1px 20px; margin: 0 5px; display: block; float: left; line-height: 1.4em; overflow: hidden; white-space: nowrap; } .damncrc-iconbar .away .t { color: #9c9e84; } .damncrc-alertbox a { text-decoration: underline; }\n"
+ (($x("//div[@class='damntcf-preload']").length <= 0) ? ".damnc-tabbar { padding-top: 1px; } .damnc-tabbar strong, .damnc-tabbar a { background: transparent url(" + this.imgs[4] + ") no-repeat 0 -110px !important; } .damnc-tabbar strong:not(.withX), .damnc-tabbar a { padding-right: 5px !important; } .damnc-tabbar strong { background-position: 0 0 !important; } .damnc-tabbar a.disconnected { color: #728776 !important; }\n"
+ ".damnc-tabbar strong i, .damnc-tabbar a i { background: transparent url(" + this.imgs[4] + ") no-repeat 100% -110px !important; } .damnc-tabbar strong i { background-position: 100% 0 !important; } #superdamnov .damnc-tabbar a { color: #2c3635; }\n"
+ ".damnc-tabbar strong.sdt-hl, .damnc-tabbar a.sdt-hl, .damnc-tabbar strong.sdt-hl i, .damnc-tabbar a.sdt-hl i, #superdamnov a.sdt-hl { background-image: url(" + this.imgs[5] + ") !important; font-weight: bold; color: #b64242; }\n"
+ ".damnc-tabbar strong.sdt-ho, .damnc-tabbar a.sdt-ho, .damnc-tabbar strong.sdt-ho i, .damnc-tabbar a.sdt-ho i, #superdamnov a.sdt-ho { background-image: url(" + this.imgs[6] + ") !important; font-weight: bold; color: #fff; }\n"
+ ".damnc-tabbar a.sdt-hb { background-position: 0 0 !important; } .damnc-tabbar a.sdt-hb i { background-position: 100% 0 !important; } .damnc-tabbar a.sdt-hl.sdt-hb, #superdamnov a.sdt-hl.sdt-hb { color: #fff; } .damnc-tabbar a.sdt-ho.sdt-hb, #superdamnov a.sdt-ho.sdt-hb { color: #88938d; }\n"
+ ".damnc-tabbar a span.unread { font-size: 85%; background-color: #b64242; color: #fff; margin: 0 -2px 0 5px; padding: 0 .3em; border-radius: .5em; -moz-border-radius: .5em; -webkit-border-radius: .5em; } .damnc-tabbar a.sdt-hl.sdt-hb span.unread { background-color: #fff; color: #b64242; }\n"
+ ".damnc-tabbar a.sdt-ho span.unread { background-color: #fff; color: #88938d; } .damnc-tabbar a.sdt-ho.sdt-hb span.unread { background-color: #88938d; color: #fff; }\n" : "")
+ "#sdprefsbtn { position: absolute; top: 2px; right: 68px; cursor: pointer; } #superdamnov { position: fixed; z-index: 300; top: 0; left: 0; right: 0; bottom: 0; background: transparent url(" + this.imgs[0] + "); overflow-x: auto; /* For some reason, Flash elements don't overlap when this is set */ }\n"
+ "#superdamnov #sdprefs { position: fixed; z-index: 301; top: 0; left: 0; right: 0; width: 800px; margin: 0 auto; } #superdamnov #sdprefs .gr-body .gr { overflow: auto; }\n"
+ "#superdamnov .gr-box { margin-bottom: 0; } .gr-box .sdbicon { display: inline-block; width: 16px; height: 16px; vertical-align: top; margin-top: 1px; }\n"
+ "#superdamnov #sdprefs h3 { background: transparent url(" + this.imgs[2] + ") repeat-x left center; font: bold 100% Verdana, sans-serif; text-shadow: 1px 1px 0 #f7f7f7; /* Standard */ color: #424846; letter-spacing: 0em; margin-bottom: -.5em; }\n"
+ "#superdamnov #sdprefs h3 span { background-color: #dae4d9; padding-right: 7px; } #superdamnov #sdprefs label { margin-right: 1em; } #superdamnov #sdprefs .version strong { color: #e52; }\n"
+ "#superdamnov #sdprefs #bg-prefid { background-color: #e5ebe3; color: #424846; border: 1px solid #b4bdb4; padding: 2px 5px; }\n"
+ "#superdamnov #sdprefs p label.l { float: left; width: 12em; margin: 0; } #superdamnov #sdprefs .subsection { margin-left: 1.5em; margin-top: -.7em; }\n"
+ "#superdamnov #sdprefs .sdp-damnline { display: inline; cursor: default; background-color: #f9fbf9; /*#dce7dc;*/ border: 1px solid #98ae9d; color: #393d3c; padding: 2px 7px; font-size: 92%; } #superdamnov #sdprefs .sdp-damnline.disabled { background-color: #dce7dc; color: #838a85; text-shadow: -1px -1px 0 #f7f7f7; }\n"
+ "#superdamnov #sdprefs .sdp-damnline input { background-color: inherit; padding: 0; margin: 0; font: 100% Verdana, sans-serif; color: inherit; border-width: 0; width: 500px; text-shadow: inherit; letter-spacing: inherit; border-radius: 0; -moz-border-radius: 0; -webkit-border-radius: 0; box-shadow: none; -moz-box-shadow: none; -webkit-box-shadow: none; } #superdamnov #sdprefs .sdp-damnlineaction, #superdamnov #sdprefs .sdp-damnlineaction input { font-style: italic; }\n"
+ "#superdamnov small, .superdamnlist small { color: #6c7977; font-size: 90%; } #superdamnov .gr-top small { color: #98a39f; } #superdamnov small.l { display: block; margin: 0.5em 2.3em 0; } #superdamnov .gmbutton2town small { display: inline-block; margin-top: 6px; } #superdamnov small a, .superdamnlist small a { color: inherit !important; }\n"
+ "#superdamnov small a.newversion { background-color: #060; color: #fff !important; font-weight: bold; padding: 4px 12px; margin: 0 0 0 10px; } #superdamnov small a.newversion:hover { background-color: #090; }\n"
+ "#superdamnov a { color: #196ba7; } #superdamnov a.gmbutton2 { color: #4c645e; } #superdamnov .att { font-weight: bold; background-color: #c00; color: #fff; padding: 1px 5px; }\n"
+ "#superdamnov .damnc-tabbar { float: right; border: 1px solid #607466; background-color: #728776; padding-right: 8px; padding-top: 5px; margin-top: 5px; }\n"
+ ".superdamnlist { border: 1px solid #b4bdb4; color: #57625c; list-style-position: inside; max-height: 18em; overflow: auto; padding: 0; } .superdamnlistbox { height: 12em; }\n"
+ ".superdamnlist li { position: relative; padding: 4px 10px; font-size: 90%; } .damncr .superdamnlist li { font-size: 100%; } .superdamnlist li strong { color: #241b1e; }\n"
+ ".superdamnlist li a.remove { display: none; width: 15px; height: 15px; background: transparent url(https://st.deviantart.com/styles/minimal/minish/close-ad.gif) no-repeat 0 -15px; text-indent: -9999px; position: absolute; top: 4px; right: 10px; }\n"
+ ".superdamnlist li.even { background-color: #cfd9cf; } .superdamnlist li.hint { color: #dae4d9; margin: 1.5em 0; } .damncr .superdamnlist li.hint { margin: .5em 0; } .superdamnlist li.hint em { color: #6c7977; } .superdamnhint { font-size: 90%; color: #6c7977; } .damncr .superdamnhint { font-size: 100%; }\n"
+ ".superdamnlist li a.tofield, #superdamnemotes li a.tofield { display: none; background: #dae4d9 url(" + this.imgs[3] + ") no-repeat right center; color: #6c7977; position: absolute; top: 3px; right: 10px; padding: 0 16px 1px 7px; } .superdamnlist li.even a.tofield { background-color: #cfd9cf; }\n"
+ ".superdamnlist li:hover a.remove, .superdamnlist li:hover a.tofield, #superdamnemotes li:hover a.tofield, #superdamnemotes li:hover a.viewdev, #superdamnemotes li:hover a.remove { display: block; }\n"
+ ".superdamn-buttonbar { display: inline; font-size: 11px; position: relative; top: -3px; margin: 0; } .superdamn-buttonbar2 { display: inline; font-size: 11px; vertical-align: text-bottom; margin: 0; } .superdamnbutton { display: inline-block; cursor: pointer; padding: 0; margin: 0 2px 0 0; width: 16px; height: 16px; background-repeat: no-repeat; text-indent: -900em; }\n"
+ ".superdamnbutton a.ak { display: none; } .damncrc-icon-roomname, .damncrc-icon-roomname:not(:-moz-any-link) { top: 3px; } .superdamnbutton.bold { background-image: url(" + this.imgs[8] + "); } .superdamnbutton.italic { background-image: url(" + this.imgs[9] + "); }\n"
+ ".superdamnbutton.underline { background-image: url(" + this.imgs[10] + "); } .superdamnbutton.link { background-image: url(" + this.imgs[11] + "); } .superdamnbutton.thumb { background-image: url(" + this.imgs[12] + "); } .superdamnbutton.thumb.alt { background-image: url(" + this.imgs[13] + "); }\n"
+ ".superdamnbutton.code { background-image: url(" + this.imgs[14] + "); } .superdamnbutton.code.alt { background-image: url(" + this.imgs[15] + "); } .superdamnbutton.superscript { background-image: url(" + this.imgs[16] + "); } .superdamnbutton.subscript { background-image: url(" + this.imgs[17] + "); }\n"
+ ".superdamnbutton.website { background-image: url(" + this.imgs[18] + "); width: 17px; } .superdamnbutton.multiline { background-image: url(" + this.imgs[19] + "); margin-right: 1em; } .superdamnbutton.emotes { background-image: url(" + this.imgs[20] + "); width: 22px; margin-right: 1em; }\n"
+ "#superdamnemotes { position: absolute; border: 1px solid #98ae9d; border-width: 1px 1px 0; background-color: #d0d9cf; z-index: 20; padding: 3px 7px 0; } #superdamnemotes .close, #superdamnmessage .close { float: right; display: block; width: 12px; height: 12px; margin: 4px 0 0 10px; background: transparent url(https://s.deviantart.com/minish/chat/closebig.gif) no-repeat -4px -4px; }\n"
+ "#superdamnemotes h3 { float: left; } #superdamnemotes .toplinks { font-size: 11px; margin: 0 8px; position: relative; top: 4px; } #superdamnemotes a { color: #40534a; text-decoration: underline; }\n"
+ "#superdamnemotes ul.browse { clear: both; border: 1px solid #98ae9d; background-color: #f7f7f7; max-height: 19em; overflow: auto; font-size: 11px; list-style-type: none; padding: 0 0 5px; margin: 0; width: 319px; }\n"
+ "#superdamnemotes ul.browse li { border-bottom: 1px solid #ccc; padding: 2px 7px; position: relative; } #superdamnemotes ul li.h { font-weight: bold; background-color: #eee; }\n"
+ "#superdamnemotes ul.browse li .votes { position: absolute; right: 45px; z-index: 21; color: #999; } #superdamnemotes li .voteb, #superdamnemotes ul li .img { display: none; font-weight: bold; } #superdamnemotes li .voteb a { color: #6c7977; text-decoration: none; } #superdamnemotes li:hover .voteb { display: inline; }\n"
+ "#superdamnemotes ul.browse li.disabled { color: #728776; font-style: italic; } #superdamnemotes ul.browse li.hint { color: #728776; font-style: italic; margin: 1.5em 0; border-width: 0; text-align: center; }\n"
+ "#superdamnemotes ul.browse li.loading { background: transparent url(https://e.deviantart.net/emoticons/e/eager.gif) no-repeat 3px 2px; padding-left: 22px; }\n"
+ "#superdamnemotes ul.letters { clear: both; list-style-type: none; padding: 0; margin: 0 0 0 8px; color: #728776; font-size: 11px; } #superdamnemotes ul.letters li { float: left; margin: 0 .3em .3em 0; cursor: pointer; } #superdamnemotes ul.letters li:hover { color: #40534a; }\n"
+ "#superdamnemotes ul.letters li.selected { background-color: #98ae9d; font-weight: bold; color: #000; padding: 0 3px .3em; margin-bottom: 0; cursor: auto; } #superdamnemotes ul.letters li.selected:hover { color: #000; }\n"
+ "#superdamnemotes li a.tofield { width: 16px; height: 16px; padding: 0; top: 1px; right: 6px; background-color: transparent; } #superdamnemotes li.disabled a.tofield { display: none !important; }\n"
+ "#superdamnemotes li a.viewdev { width: 12px; height: 7px; position: absolute; top: 6px; right: 23px; background: transparent url(" + this.imgs[7] + ") no-repeat; display: none; }\n"
+ "#superdamnemotes li a.remove { width: 8px; height: 8px; position: absolute; top: 6px; right: 45px; background: transparent url(" + this.imgs[22] + ") no-repeat; display: none; }\n"
+ "#superdamnemotes form { clear: both; border: 1px solid #98ae9d; padding: 8px 10px; font-size: 11px; color: #728776; width: 299px; margin: 0 0 10px; } #superdamnemotes #sde-addemf { margin: 0; } #superdamnemotes #sde-searchf input { margin: 4px 0 0; width: 293px; }\n"
+ "#superdamnemotes form p label.l { float: left; width: 10em; margin: 0; color: #40534a; font-weight: bold; } #superdamnemotes form p.input { border: 1px solid #98ae9d; border-width: 1px 0; padding: 10px 0; } #superdamnemotes form p.loading { background: transparent url(https://e.deviantart.net/emoticons/e/eager.gif) no-repeat right center; }\n"
+ "#superdamnemotes form p label.l select { background-color: #d0d9cf; border-width: 0; padding: 0 5px 0 0; margin: 0; font-family: Verdana, Tahoma, sans-serif; font-size: 11px; font-weight: bold; color: #40534a; } #superdamnemotes form p label.l select.disabled { color: #838a85; text-shadow: -1px -1px 0 #f7f7f7; }\n"
+ "#superdamnemotes form input.loading { background-image: url(https://e.deviantart.net/emoticons/e/eager.gif); background-repeat: no-repeat; background-position: right center; }\n"
+ "#superdamnemotes .bottom { text-align: right; font-size: 11px; margin: .2em 0; } #superdamnemotes .bottom span { float: left; } #superdamnemotes .bottom a.loading, .superdamn-topicer .meta div.loading { background: transparent url(https://e.deviantart.net/emoticons/e/eager.gif) no-repeat left center; padding-left: 20px; }\n"
+ "#superdamnempreview { border: 1px solid #98ae9d; background-color: #dce7dc; padding: 3px; position: absolute; z-index: 40; } #superdamnempreview img { max-width: 100px; max-height: 100px; }\n"
+ "#superdamnmessage { position: absolute; top: 10px; right: 10px; background-color: #728776; border: 1px solid #313f3a; color: #fff; padding: 2px 7px; max-width: 35%; opacity: .8; z-index: 900; font-size: 11px; }\n"
+ "#superdamnmessage.yay { background-color: #090; border-color: #060; } #superdamnmessage.nay { background-color: #900; border-color: #600; } #superdamnmessage a { color: inherit; } #superdamnmessage a.download { text-decoration: underline; }\n"
+ ".damncr-title .superdamn-editbutton, .damncrc-topic .superdamn-editbutton { display: none; position: absolute; top: 2px; right: 2px; width: 22px; height: 20px; cursor: pointer; background: transparent url(https://st.deviantart.net/minish/gruzecontrol/astro-megazord.png) no-repeat; background-position: 0 0; }\n"
+ ".damncr-title:hover .superdamn-editbutton, .damncrc-topic:hover .superdamn-editbutton { display: block; } .superdamn-editbutton:hover { background-position: 0 -27px !important; }\n"
+ ".superdamn-topicer textarea { width: 100%; } .superdamn-topicer .meta { background-color: #bbc6b9; padding: 2px 5px 5px; position: relative; overflow: hidden; } .damncrc-topic .superdamn-topicer .meta { background-color: #9eaea0; }\n"
+ ".superdamn-topicer .meta span { position: relative; top: 2px; z-index: 20; background-color: inherit; } .superdamn-topicer .meta div { position: absolute; top: 2px; right: 5px; z-index: 19; }\n"
+ ".superdamn-devlink { background: #c9d3c8 url(" + this.imgs[21] + ") no-repeat 6px 2px; padding: 3px 6px 3px 28px; text-decoration: none !important; } .superdamn-devlink em { font-style: italic; text-decoration: underline; color: #4a524e; } .superdamn-devlink strong { font-weight: bold; color: #647068;/*#98ae9d;*/ }\n"
+ ".damncrc-chat-window a.superdamn-devlink, .damncrc-topic a.superdamn-devlink, .damncr-title a.superdamn-devlink { text-decoration: none !important; }"
},
// Standard user preferences (not YOURS, they're stored somewhere else. DON'T CHANGE THIS)
P: { "timestamps": true, "useam": true, "awaymsg": "is away: %REASON%", "backmsg": "is back", "beepmsg": "%USER%: I've been away for %TIMESINCE%. Reason: %REASON%", "showbeep": true, "beepinterval": 60, "fixtabs": 1, "formattingbuttons": true, "ignores": {}, "useignore": true, "showignore": false, "retroignore": true, "customemotes": false, "publicemotes": true, "emotes": {}, "pickerright": false, "showsend": false, "ignoreversions": [], "tabscounts": true, "nothumbshighlight": false },
Pt: false, // Temporary P, for while you're changing preferences
off: true,
away: false,
viewing: true,
debug: false,
nac: ["chat:devart", "chat:devious", "chat:fella", "chat:help", "chat:mnadmin", "chat:idlerpg", "chat:irpg", "chat:trivia", "chat:photographers", "chat:daunderworldrpg", "chat:damnidlers", "chat:datashare", "chat:dsgateway", "debug:conn"], // noAwayChats
pe: {}, // Public custom emotes
// "Structured" public and individual emotes
ems: {"a":{},"b":{},"c":{},"d":{},"e":{},"f":{},"g":{},"h":{},"i":{},"j":{},"k":{},"l":{},"m":{},"n":{},"o":{},"p":{},"q":{},"r":{},"s":{},"t":{},"u":{},"v":{},"w":{},"x":{},"y":{},"z":{},"#":{},"*":{}},
spe: false,
sie: false,
postrequests: {},
postcallbacks: {},
ambassadors: [],
newVersion: false,
unread: { count: 0, lastuser: "", process: 0 },
departing: [],
browser: {
version: (navigator.userAgent.match(/(firefox|iceweasel|chrome|safari|version)\/([0-9.]+)/i) || [])[2],
firefox: /(firefox|iceweasel)/i.test(window.navigator.userAgent),
safari: (/safari/i.test(window.navigator.userAgent)) && (!/chrome/i.test(window.navigator.userAgent)),
chrome: /chrome/i.test(window.navigator.userAgent)
},
// Utility functions
addstyle: function(str, id){ var el = document.createElement("style"); el.type = "text/css"; el.className = id ? id : "superdamnstyles"; el.appendChild(document.createTextNode(str)); document.getElementsByTagName("head")[0].appendChild(el) },
pad: function(int){ if(int < 10){ return "0" + int } return int },
oc: function(a){ var o = {}; for(var i=0;i<a.length;i++){ o[a[i]] = ""; } return o }, // Converting an array to an object literal; from https://snook.ca/archives/javascript/testing_for_a_v/
ocl: function(a){ var o = {}; for(var i=0;i<a.length;i++){ o[a[i].toLowerCase()] = ""; } return o }, // Same as above, but lowercase'd
he: function(str){ return str.toString().replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">") }, // Special HTML chars encode
re: function(str){ return str.toString().replace(/"/g, "\"").replace(/</g, "<").replace(/>/g, ">").replace(/&/g, "&") }, // Special HTML chars decode
ac: function(el, cn){ if(!el.className){ el.className = cn } else { el.className = el.className + " " + cn } }, // addClass
hc: function(el, cn){ return ((" " + el.className + " ").indexOf(" " + cn + " ") >= 0) }, // Whether className has class
rc: function(el, cn){ el.className = this.trim((" " + el.className + " ").replace(" " + cn + " ", " ")) },
ol: function(obj){ var l = 0; for(var p in obj){ if(obj.hasOwnProperty(p)){ l++ } } return l }, // Object length
oe: function(obj){ return (this.ol(obj) <= 0) }, // Whether object is empty (e.g. {})
ia: function(a){ return !!(a && a.constructor == Array) }, // Whether argument is an array
time: function(){ return ((new Date()).getTime()) / 1000 }, // Unixtime
trim: function(str){ return str.replace(/^\s+|\s+$/g,"") }, // Thanks to https://www.somacon.com/p355.php
ltrim: function(str){ return str.replace(/^\s+/,"") },
rtrim: function(str){ return str.replace(/\s+$/,"") },
explode: function(str, del, lim){ var s = str.toString().split(del.toString()); var a = s.splice(0, lim); var b = s.join(del.toString()); a.push(b); return a }, // Kudos to PHP-JS; https://phpjs.org/functions/explode
reason: function(str, r){ r = r ? r : "reason"; return str ? str : "(No " + r + ")" },
numeric: function(str){ return !!str.match(/^[0-9]+$/) }, // Is string numeric? (e.g. an int in a string)
oconcat: function(obj1, obj2){ for(var p in obj2){ obj1[p] = obj2[p] } return obj1 }, // Concat with property:value objects (overwriting)
strrev: function(str){ return str.split("").reverse().join("") }, // Reverse a string
// -- MM dependent
notice: function(str, timeout){ return MiddleMan.Interface.chatNotice(false, str, timeout) },
cnotice: function(cmd, str, timeout){ return this.notice(cmd + ": " + str, timeout) },
error: function(cmd, str, timeout){ return this.notice(cmd + " error: " + str, timeout) },
// Our elements
sdov: function(){ return document.getElementById('superdamnov') }, // These (hopefully) always exists
sdsb: function(){ return document.getElementById('sdprefsbtn') },
sdpr: function(){ return document.getElementById('sdprefs') }, // These might exist
sdak: function(){ return document.getElementById('superdamnaccesskeys') },
sdep: function(){ return document.getElementById('superdamnemotes') },
sdev: function(){ return document.getElementById('superdamnempreview') },
sdis: function(){ return document.getElementById('superdamnignores') },
sdm: function(){ return document.getElementById('superdamnmessage') },
// Commands
cmds: {
// 0 1
// Cmd : Name Params
"setaway": ["Set away", 1],
"setback": ["Set back", 1],
"ignore": ["Ignore", 1],
"unignore": ["Unignore", 1],
"chat": ["Chat", 1],
"gettopic": ["Get topic", 0],
"gettitle": ["Get title", 0],
"topicadd": ["Topic add", 1],
"titleadd": ["Title add", 1],
"faqsearch": ["FAQ search", 1],
"clearall": ["Clear all", 0],
"emotes": ["Emotes list", 0],
"emotesearch": ["Emote search", 1],
"kickban": ["Kick + ban", 1],
"depart": ["Depart", 1],
"prefs": ["Preferences", 0]
},
// BASIC PARTS --------------------------------------
// INIT: This function initializes the whole script, adds handlers and other things needed
init: function(){
if(!this.detectincompatibilities()){
dAmn_Client_Agent += " with SuperdAmn " + this.v
if(typeof window.FAQloaded == "undefined"){ window.FAQloaded = false }
if(typeof window.IBLloaded == "undefined"){ window.IBLloaded = false }
if(typeof window.superdAmn_GM == "undefined"){ window.superdAmn_GM = false }
window.onfocus = superdAmn.focus
window.onblur = superdAmn.blur
this.updatecheck()
// Add the styles to the head
this.s()
this.addstyle(this.styles)
// Initialize our accesskey storage
this.accesskeys.init()
// Initialize our pref system
this.prefs.init()
// Initialize our emotes system
this.emotes.init()
// Initialize our ignores system
this.ignores.init()
// Initialize our dAmn bindings
this.dAmn.init()
this.buttons.init()
// Initialize our commands
for(var cmd in this.cmds){
var d = this.cmds[cmd]
MiddleMan.Commands.bind(cmd, d[1], this.commands[cmd])
}
this.updateslows()
this.updatemembers()
this.off = false
this.extend.trigger("ready")
}
},
// COMMANDS -----------------------------------------
// Each method below is run at the corresponding
// /command in a dAmn chatroom.
commands: {
// SETAWAY: Sets your status to away with given reason, notes the time and tells the world
setaway: function(reason){
if(!reason){ reason = "" }
var SD = superdAmn
reason = SD.trim(reason)
SD.away = { r: reason, t: SD.time(), b: SD.time() } // r: Reason, t: Time, b: Timestamp of last beep
var d = new Date(); d.noseconds = true
var display = "<strong>Currently away:</strong> " + (reason ? (reason.length > 70 ? SD.he(reason.substr(0,70)) + "…" : SD.he(reason)) : "<em>No reason</em>") + " <span class=\"t\">(since <strong>" + SD.format.timestamp(d) + "</strong>)</span>"
var tooltip = reason.length > 70 ? reason : ""
Array.prototype.forEach.call($x("//span[@class='away' and (ancestor::div[contains(concat(' ',normalize-space(@class),' '),' damncrc-iconbar ')])]"), function(el){ el.parentNode.removeChild(el) })
for(var ns in dAmnChats){
var ib = dAmnChats[ns].channels.main.iconbar_el
var ab = document.createElement("span")
ab.className = "away"
ab.innerHTML = display
ab.title = tooltip
if(!dAmnChats[ns].channels.main.awayspace_el){
superdAmn.buttons.chatinit(dAmnChats[ns])
}
ab.style.maxWidth = SD.buttons.awaymaxwidth(ns) + "px"
dAmnChats[ns].channels.main.awayspace_el.appendChild(ab)
if(ns.toLowerCase() in SD.oc(SD.nac)){ continue }
if(SD.trim(SD.P.awaymsg) != ""){
MiddleMan.dAmnSend.action(ns, SD.format.awayMsg(SD.P.awaymsg))
}
}
},
// SETBACK: Sets your status to back and tells the world
setback: function(message){
if(!message){ message = "" }
var SD = superdAmn
if(SD.away){
if(SD.trim(SD.P.backmsg) != ""){
for(var ns in dAmnChats){
if(ns.toLowerCase() in SD.oc(SD.nac)){ continue }
MiddleMan.dAmnSend.action(ns, SD.format.awayMsg(SD.P.backmsg, null, message))
}
}
SD.cnotice("setback", "You were away for " + SD.format.tstr(SD.time() - SD.away.t) + ".")
SD.away = false
Array.prototype.forEach.call($x("//span[@class='away' and (ancestor::div[contains(concat(' ',normalize-space(@class),' '),' damncrc-iconbar ')])]"), function(el){ el.parentNode.removeChild(el) })
} else {
SD.error("setback", "You’re not away")
}
},
// IGNORE: Puts the user specified on the ignore list or displays that list
ignore: function(user){
var SD = superdAmn
var ns = dAmnChatTab_active
SD.dAmn.u()
if(SD.P.useignore){
var lcuser = user.toLowerCase()
if(lcuser == SD.u.toLowerCase()){ SD.error("ignore", "You can't ignore yourself"); return false }
if(window.IBLloaded && lcuser in SD.oc(ignoreBlacklist)){ SD.error("ignore", "You can't ignore Message Network Operators"); return false }
if(lcuser == "list" || !user){
// LIST
var a = SD.ol(SD.P.ignores)
var html = "<p class=\"nt\">You are currently ignoring <strong>" + a + "</strong> <span>pe" + ((a == 1) ? "rson" : "ople") + ((a == 0) ? "." : ":") + "</span>" + "</p>"
if(a > 0){
var i = 1
html += "<ol class=\"superdamnlist\">"
for(var u in SD.P.ignores){
var d = new Date()
d.setTime(SD.P.ignores[u]*1000)
html += "<li" + ((i++ % 2) ? " class=\"even\"" : "") + ">"
html += "<strong><a target=\"_blank\" href=\"https://" + SD.he(u) + ".deviantart.com/\">" + SD.he(u) + "</a></strong> "
html += "<small>at " + d.toLocaleString() + "</small> "
html += "<a class=\"remove\" id=\"sdp-unignore-" + SD.he(u) + "\" href=\"javascript://\" title=\"Unignore this user\">Unignore</a>"
html += "</li>"
}
html += "</ol>"
}
b = SD.dAmn.makebox(ns, "<i class=\"sdbicon\" style=\"background:transparent url(https://st.deviantart.net/minish/gruzecontrol/icons-gruser.gif) no-repeat -963px -3px\"></i> Ignore List", html)
rms = $x(".//a[@class='remove']", b)
if(rms.length > 0){
Array.prototype.forEach.call(rms, function(el){
el.un = el.id.substr(13)
el.id = ""
el.addEventListener("click", function(evt){
evt.preventDefault()
superdAmn.commands.unignore(this.un)
var ol = this.parentNode.parentNode
var pt = ol.previousSibling
var na = parseInt(pt.childNodes[1].childNodes[0].data) - 1
ol.removeChild(this.parentNode)
pt.childNodes[1].childNodes[0].data = na
pt.childNodes[3].childNodes[0].data = ((na == 1) ? "person" : "people") + ((na == 0) ? "." : ":")
if(na == 0){ ol.parentNode.removeChild(ol) }
// I'm tree climing, but I made this thing so I won't get lost I swear :(
}, false)
})
}
} else {
var users = user.split(" ")
var lcusers = lcuser.split(" ")
for(var u in users){
if(!/^[a-zA-Z0-9-]+$/.test(lcusers[u])){ SD.error("ignore", users[u] + " is an invalid user name."); continue }
if(lcusers[u] in SD.P.ignores){
SD.error("ignore", users[u] + " is already on your ignore list. Type <em>/ignore list</em> to see it.")
} else {
SD.ignores.add(lcusers[u])
SD.cnotice("ignore", users[u] + " was added to your ignore list.")
if(SD.P.showignore){
MiddleMan.dAmnSend.action(ns, SD.format.userMsg("is ignoring %USER% now", users[u]))
}
}
}
}
} else {
SD.error("ignore", "You do not have ignore functionality turned on. Please open the <a href=\"javascript://\" onclick=\"superdAmn.prefs.show(); return false\">SuperdAmn Preference panel</a> to turn it back on.")
}
},
// UNIGNORE: Removes user specified from your ignore list
unignore: function(user){
var SD = superdAmn
var ns = dAmnChatTab_active
SD.dAmn.u()
if(SD.P.useignore){
var lcuser = user.toLowerCase()
var users = user.split(" ")
var lcusers = lcuser.split(" ")
for(var u in users){
if(lcusers[u] in SD.P.ignores){
SD.ignores.remove(lcusers[u])
SD.cnotice("unignore", users[u] + " was removed from your ignore list.")
if(SD.P.showignore){
MiddleMan.dAmnSend.action(ns, SD.format.userMsg("is not ignoring %USER% anymore", users[u]))
}
} else {
SD.error("unignore", users[u] + " could not be found on your ignore list. Type <em>/ignore list</em> to see it.")
}
}
} else {
SD.error("ignore", "You do not have ignore functionality turned on. Please open the <a href=\"javascript://\" onclick=\"superdAmn.prefs.show(); return false\">SuperdAmn Preference panel</a> to turn it back on.")
}
},
// CHAT: Initiates a private chat session with the supplied user
chat: function(user){ MiddleMan.dAmnSend.chat(user) },
// GETTITLE/GETTOPIC: Gets the current title/topic in the format that they were typed by the user(s) and puts it in the input field
gettitle: function(args, topic){
if(typeof topic == "undefined" || !topic){ t = "title" } else { t = "topic" }
var SD = superdAmn
var ns = dAmnChatTab_active
if(dAmnChats[ns].SD && (dAmnChats[ns].SD[t + "_el_orig"] || dAmnChats[ns].SD[t + "_el_orig"] === "")){
var by = dAmnChats[ns].SD[t + "_el_by"]
var ti = new Date()
ti.setTime(dAmnChats[ns].SD[t + "_el_ts"] * 1000)
setTimeout(function(){
MiddleMan.Interface.setInputText(ns, "/" + t + " " + dAmnChats[ns].SD[t + "_el_orig"])
SD.notice(t + " info: Set by <a href=\"https://" + by.toLowerCase() + ".deviantart.com/\" target=\"_blank\">" + SD.he(by) + "</a> on <em>" + ti.toLocaleString() + "</em>")
}, 100) // This is retarded with a big R. Damn you, MM.
} else {
SD.error("get" + t, "Could not retrieve the " + t + " source. You can <a href=\"javascript://\" onclick=\"superdAmn.dAmn.reloadTopicTitle(dAmnChatTab_active);return false\">click here</a> to try to reload topic and title, then try again.")
}
},
gettopic: function(args){ superdAmn.commands.gettitle(args, true) },
// TITLEADD/TOPICADD: Adds supplied string at the end of current title/topic
titleadd: function(args, topic){
if(typeof topic == "undefined" || !topic){ t = "title" } else { t = "topic" }
var ns = dAmnChatTab_active
if(dAmnChats[ns].SD && (dAmnChats[ns].SD[t + "_el_orig"] || dAmnChats[ns].SD[t + "_el_orig"] === "")){
dAmn_Set(ns, t, dAmnEscape(dAmnChats[ns].SD[t + "_el_orig"] + " " + args))
} else {
SD.error("get" + t, "Could not retrieve the " + t + " source. You can <a href=\"javascript://\" onclick=\"superdAmn.dAmn.reloadTopicTitle(dAmnChatTab_active);return false\">click here</a> to try to reload topic and title, then try again.")
}
},
topicadd: function(args){ superdAmn.commands.titleadd(args, true) },
// FAQSEARCH: Searches through the online FAQ database for questions matching supplied keywords
faqsearch: function(args){
var SD = superdAmn
var ns = dAmnChatTab_active
jQuery.getJSON("https://temple.24bps.com/superdamn/faqsearch.php?q=" + encodeURIComponent(args) + "&jsoncallback=?&" + (new Date()).getDay(),
function(data){
var html = "<p class=\"nt\">"
if(!data || (data.length && data.length == 0) || SD.oe(data)){
html += "Search results for <strong>" + SD.he(args) + "</strong> in the <a href=\"https://help.deviantart.com/\">FAQ</a>:</p><ol class=\"superdamnlist\">"
html += "<li class=\"hint\"><em>No results! Sorry!</em></li>"
} else {
r = SD.ol(data)
html += "We found <strong>" + r + "</strong> search result" + (r == 1 ? "" : "s") + " for <strong>" + SD.he(args) + "</strong> in the <a href=\"https://help.deviantart.com/\">FAQ</a>:</p><ol class=\"superdamnlist\">"
var i = 1
for(var id in data){
html += "<li" + ((i++ % 2) ? " class=\"even\"" : "") + ">"
html += "<strong>FAQ #" + SD.he(id) + ":</strong> <a href=\"https://help.deviantart.com/" + SD.he(id) + "/\">" + SD.he(data[id].question) + "</a> "
html += "<small>in <a href=\"https://help.deviantart.com/" + SD.he(data[id].catpath) + "/\">" + SD.he(data[id].category) + "</a></small> "
html += "<a class=\"tofield\" id=\"sdf-tofield-" + SD.he(id) + "\" href=\"javascript://\">Add code to text field</a>"
html += "</li>\n"
}
}
html += "</ol>"
b = SD.dAmn.makebox(ns, "<span class=\"sdbicon\" style=\"background:transparent url(https://st.deviantart.net/minish/main/icons6.gif) no-repeat -812px -92px\"></span> FAQ Search Results", html)
tfs = $x(".//a[@class='tofield']", b)
if(tfs.length > 0){
Array.prototype.forEach.call(tfs, function(el){
el.faqid = el.id.replace(/[^0-9]/g, "")
el.id = ""
el.addEventListener("click", function(evt){ evt.preventDefault(); superdAmn.dAmn.appendInputText(ns, ":faq" + this.faqid + ":") }, false)
})
}
}
)
},
// CLEARALL: Clears all open chatrooms for content on your screen
clearall: function(){
for(var ns in dAmnChats){
if(dAmnChats[ns] && dAmnChats[ns].channels && dAmnChats[ns].channels.main && dAmnChats[ns].channels.main.Clear){
dAmnChats[ns].channels.main.Clear()
}
}
for(var ns in dAmnChatTabs){
var t = dAmnChatTabs[ns]
if(t.tab_el.style.fontWeight == "bold"){
if("timer" in t){ delete t.timer }
t.flash_count = -1
t.data = 0
t.tab_el.className = ""
//t.tab_el.setAttribute("style", "")
t.tab_el.style.fontWeight = "normal"
t.tab_el.style.color = "inherit"
}
}
},
// EMOTES: Toggles the emotes picker
emotes: function(){
var SD = superdAmn
if(SD.P.customemotes){
if(!SD.sdep()){
SD.error("emotes", "Emotes picker has not yet generated. Please try again in a second!")
return false
} else {
SD.emotes.picker.toggle()
return true
}
} else {
SD.error("emotes", "You do not have custom emote functionality turned on. Please open the <a href=\"javascript://\" onclick=\"superdAmn.prefs.show(); return false\">SuperdAmn Preference panel</a> to turn it back on.")
return false
}
},
// EMOTESEARCH: Shows the emote picker and searches for custom emotes with supplied query
emotesearch: function(args){
var SD = superdAmn
if(SD.commands.emotes()){
SD.emotes.picker.show()
var f = document.getElementById("sde-addemf"), b = document.getElementById("sde-browser")
var sf = document.getElementById("sde-searchf"), sb = document.getElementById("sde-search")
var fb = document.getElementById("sde-addem")
var si = $x(".//input", sf)[0]
sf.style.display = "block"
sb.setAttribute("style", "")
sb.childNodes[0].data = "Cancel search"
if(b.style.display != "block"){
f.style.display = "none"
b.style.display = "block"
fb.nextSibling.data = " / "
fb.childNodes[0].data = "Add emote"
}
si.value = args
SD.emotes.picker.search(si.value)
}
},
// KICKBAN: Kicks the user with the specified reason, then immediately bans them -- makes it easier to give reasons for bans
kickban: function(args){
var SD = superdAmn, ns = dAmnChatTab_active
var seg = SD.explode(args, " ", 1)
MiddleMan.dAmnSend.kick(ns, seg[0], seg[1])
MiddleMan.dAmnSend.ban(ns, seg[0])
},
// DEPART: Parts the current chatroom without closing the tab
depart: function(x){
if(x && superdAmn.trim(x) != ""){ superdAmn.error("depart", "You can only depart the room you are currently in. Please navigate to the room, and then depart it."); return false }
if(dAmnChatTab_active){
superdAmn.departing.push(dAmnChatTab_active)
dAmn_Part(dAmnChatTab_active)
return true
}
},
// PREFS: A command that shows the SuperdAmn Preferences panel
prefs: function(){
superdAmn.prefs.show()
}
},
// dAMN ---------------------------------------------
dAmn: {
// INIT: Implements all the dAmn-related fixes
init: function(){
var SD = superdAmn
// attempting to take advantage of that absurd ass workaround
this.addmaketexthandle()
this.addmsghandle()
this.addtopicstores()
this.addtabfixes()
this.addcmdfixes()
this.addresizefix()
this.addavatarfix()
this.addactivatehandle()
this.addmemberlisthandle()
this.adduserinfohandle()
this.addremovehandle()
this.addmsgextras()
this.addchatextras()
this.addformatextras()
this.addtabextras()
this.updatetitle()
this.u()
},
u: function(){ if(!superdAmn.u){ superdAmn.u = dAmn_Client_Username } }, // If it ain't done already ...
// MAKEBOX: Makes a gruser-style HTML box with specified content and adds it to the chat specified by ns
makebox: function(ns, title, html){
var b = dAmn_MakeDiv("gr-box")
b.innerHTML = "<i class=\"gr1\"><i></i></i><i class=\"gr2\"><i></i></i><i class=\"gr3\"><i></i></i>"
+ "<div class=\"gr-top\"><a class=\"sdmclose\" href=\"javascript://\"></a><div class=\"gr\"><h2>" + title + "</h2></div></div>"
+ "<div class=\"gr-body\"><div class=\"gr\">" + html + "</div></div><i class=\"gr3\"></i><i class=\"gr2\"></i><i class=\"gr1\"></i>"
if(el = $x(".//a[@class='sdmclose']", b)[0]){ el.addEventListener("click", function(evt){ evt.preventDefault(); b = this.parentNode.parentNode; b.parentNode.removeChild(b) }, false) }
dAmnChats[ns].channels.main.addDiv(b, null, 0)
return b
},
// ADDMAKETEXTHANDLE: Adds changes to dAmn's makeText function: Ignores, pchatting, timestamps
addmaketexthandle: function(){
dAmnChanChat.prototype.makeText = function(style, from, input_text, hilite){ // Function-mingling. I feel dirty.
var SD = superdAmn, evr
var fromun = ""
var checkStyle = function(style, str){
return style.substr(0, str.length) == str
}
// Disconnect-ish highlight-preventing
if(
from.substr(0,7) == "*** You" &&
(
checkStyle(style, "disconnect") ||
checkStyle(style, "join") ||
(checkStyle(style, "part") && input_text == "[quit]")
)
){
hilite = -1
}
// Ignores
if(from.substr(0,4) == "<" && from.substr(from.length-4,4) == ">"){ fromun = from.substr(4, from.length-8) } // msg
if(from.substr(0,2) == "* "){ fromun = SD.trim(from.substr(2)) } // action
if(fromun && fromun.indexOf(" ") < 0 && ((this.cr.SD && !this.cr.SD.other) || !this.cr.SD)){
var lcfrom = fromun.toLowerCase()
var ufrom = "u-" + lcfrom
if(style.indexOf(ufrom) < 0){
style += " " + ufrom
}
if(SD.P.useignore && lcfrom in SD.P.ignores && lcfrom != dAmn_Client_Username.toLowerCase()){
if(!SD.P.retroignore){ style += " ignored" }
hilite = -1
}
}
if(from.substr(0,3) == "** " && !SD.trim(from.substr(3)).match(/\s+/)){ fromun = SD.trim(from.substr(3)) } // join, part, etc
// Pchattin' should always highlight you
if(this.cr.SD && this.cr.SD.other && fromun.toLowerCase() == this.cr.SD.other.toLowerCase()){ hilite = 2 }
this.FormatMsg(input_text, (function (text) {
var o, i, ts, f, ff, t, tt
o = dAmn_MakeDiv("msg " + style)
i = dAmn_AddDiv(o, "inner")
o.style.display = "none"
this.chat_el.appendChild(o)
// Timestamps
if(SD.P.timestamps){ ts = dAmn_AddSpan(i, "ts", SD.format.timestamp() + " ") }
f = dAmn_AddSpan(i, "from")
ff = dAmn_AddSpan(f, ((fromun && fromun != from) ? "ffc" : null), from + " ")
if(fromun){ ff.onclick = function(){ superdAmn.dAmn.inputAddUsername(fromun) } } // Username clicks
if(text){
t = dAmn_AddSpan(i, "text")
tt = dAmn_AddSpan(t, null, text)
if("wrapEl" in this){ this.wrapEl(o) }
SD.dAmn.applyrecvextras(tt) // Where the magic happens
}
// Allowing people to extend the functionality
evr = SD.extend.trigger("maketext", [o, i, ts, f, t, tt])
if((typeof evr == "boolean" && evr !== false) || (typeof evr == "object" && evr[0] !== false)){ // err detection
if(typeof evr == "object" && evr.length == 6){
o = evr[0] // Change the HTML objects to the perhaps changed values
i = evr[1]
ts = evr[2]
f = evr[3]
t = evr[4]
tt = evr[5]
}
// Unread counters
if(hilite >= 2){
if(!SD.viewing){
SD.unread.count++
if(fromun && fromun != from && fromun != SD.u){
SD.unread.lastuser = fromun
}
SD.dAmn.updatetitle()
}
if(this.cr.ns != dAmnChatTab_active){
if(!this.cr.SD){ this.cr.SD = {} }
if(!this.cr.SD.unread || typeof this.cr.SD.unread != "number"){
this.cr.SD.unread = 1
} else {
this.cr.SD.unread++
}
}
}
// Adding message to chat
this.addDiv(o, true, hilite)
// Neutralize "display" property
if(fromun && fromun.indexOf(" ") < 0){
o.setAttribute("style", (o.getAttribute("style") || "").replace(/display\s*:\s*[a-z-]+\s*;?/, ""))
}
}
}).bind(this));
}
},
// ADDMSGHANDLE: Adds changes to dAmn's onMsg function: telling people that you're away
addmsghandle: function(){
MiddleMan.Event.bind("dAmnChat_recv", "msg", "superdAmn_recv_msg", function(pkt){
var SD = superdAmn
var recv = dAmn_ParsePacket(pkt.body)
var body = MiddleMan.parseMsg(recv.body)
var lcfrom = recv.args.from.toLowerCase()
// The below line is taken from dAmn's own code to determine whether your username is in the message
if(-1 != body.search(RegExp("([^A-Za-z]+|^)" + dAmn_Client_Username + "([^A-Za-z]+|$|s$|s[^A-Za-z]+)", "im")) && body.indexOf("away") < 0 && !(SD.P.useignore && lcfrom in SD.P.ignores) && !(pkt.param.toLowerCase() in SD.oc(SD.nac))){
if(SD.away && SD.P.showbeep && recv.args.from != dAmn_Client_Username && (SD.time() - SD.away.b) > SD.P.beepinterval){
MiddleMan.dAmnSend.msg(pkt.param, SD.format.awayMsg(SD.P.beepmsg, recv.args.from))
SD.away.b = SD.time()
}
}
return pkt
})
/*MiddleMan.Event.bind("dAmnChat_recv", "action", "superdAmn_recv_action", function(pkt){
var SD = superdAmn
var recv = dAmn_ParsePacket(pkt.body)
var body = MiddleMan.parseMsg(recv.body)
if(-1 != body.search(RegExp("([^A-Za-z]+|^)" + dAmn_Client_Username + "([^A-Za-z]+|$|s$|s[^A-Za-z]+)", "im"))){
// Something...
}
return pkt
})*/
},
// ADDTOPICSTORES: Stores various metadata about the topic in our designated objects once we receive them
addtopicstores: function(){
// Storing information about topic and title
MiddleMan.Event.bind("dAmnChat_property", "title", "superdAmn_gettitle", function(pkt){
var SD = superdAmn
var ns = pkt.param
if(!dAmnChats[ns].SD){ dAmnChats[ns].SD = {} }
dAmnChats[ns].SD.title_el_orig = SD.dAmn.deformatMsg(pkt.body) // The originally user-entered title
dAmnChats[ns].SD.title_el_by = pkt.args.by // By (who set it)
dAmnChats[ns].SD.title_el_ts = pkt.args.ts // Timestamp (when title was set)
window.setTimeout(function(){ SD.dAmn.applyrecvextras(dAmnChats[ns].title_el); SD.dAmn.applytopicextras(dAmnChats[ns].title_el, ns, "title") }, 500)
return pkt
})
MiddleMan.Event.bind("dAmnChat_property", "topic", "superdAmn_gettopic", function(pkt){
var SD = superdAmn
var ns = pkt.param
//var c = pkt.args.c ? pkt.args.c : "main"
if(!dAmnChats[ns].SD){ dAmnChats[ns].SD = {} }
dAmnChats[ns].SD.topic_el_orig = SD.dAmn.deformatMsg(pkt.body) // The originally user-entered topic
dAmnChats[ns].SD.topic_el_by = pkt.args.by // By (who set it)
dAmnChats[ns].SD.topic_el_ts = pkt.args.ts // Timestamp (when topic was set)
window.setTimeout(function(){ SD.dAmn.applyrecvextras(dAmnChats[ns].channels.main.topic_el); SD.dAmn.applytopicextras(dAmnChats[ns].channels.main.topic_el, ns, "topic") }, 500)
return pkt
})
},
// ADDTABFIXES: Adds support for tab "fixing" with different highlighting colours
addtabfixes: function(){
if($x("//div[@class='damntcf-preload']").length <= 0){
dAmnChatTabs_flashTab_SD = dAmnChatTabs_flashTab
dAmnChatTabs_newData_SD = dAmnChatTabs_newData
dAmnChatTabs_flashTab = function(tab){
if(dAmnChatTab_active != tab.id && tab.tab_el.tagName == "A"){
var SD = superdAmn, c
var old = (SD.P.fixtabs == 3), red = (SD.P.fixtabs == 2), off = (!SD.P.fixtabs)
var hlc = old ? "sdt-ho" : "sdt-hl"
switch(tab.data){
case 1: // People are talking
c = off ? "#333" : (old ? "maroon" : "#356271") // standard dAmn value here, #333, is indistinguisable from normal text color #2c3635 -- wtf?
break
case 2: // People are talking to you
if(!off){
if(!SD.hc(tab.tab_el, hlc)){ SD.ac(tab.tab_el, hlc) } // adding class
if((tab.flash_count & 1) != red){
SD.ac(tab.tab_el, "sdt-hb")
c = old ? "#88938d" : "#fff"
} else {
SD.rc(tab.tab_el, "sdt-hb")
c = old ? "#fff" : "#b64242"
}
} else { c = "#b64242" }
break
}
if(tab.tab_el.style.color != c){
tab.tab_el.style.color = c
tab.tab_el.style.fontWeight = "bold"
}
if(tab.tab_el.firstChild && (tab.data != 2 || off)){ // No hidin' when it's highlightin'
tab.tab_el.firstChild.style.visibility = (tab.flash_count & 1) ? "hidden" : "visible"
if(SD.P.tabscounts && tab.tab_el.childNodes[1] && tab.tab_el.childNodes[1].tagName.toUpperCase() != "I"){
tab.tab_el.childNodes[1].style.visibility = (tab.flash_count & 1) ? "hidden" : "visible"
}
}
if(tab.flash_count--){
tab.timer = window.setTimeout(function(){ dAmnChatTabs_flashTab(tab) }, 500)
}
}
}
dAmnChatTabs_newData = function(id, level){
if(dAmnChatTab_active != id){
var tab = dAmnChatTabs[id], off = (!superdAmn.P.fixtabs)
if(tab && (!tab.data || tab.data < level) && level >= 0){
if("timer" in tab){ window.clearTimeout(tab.timer) }
tab.data = level
tab.flash_count = 6 // has to be even
if(tab.data == 2 && !off){ tab.flash_count = 10 }
dAmnChatTabs_flashTab(tab)
}
// Unread count
if(superdAmn.P.tabscounts && level == 2 && !off){
if(tab.tab_el.firstChild && dAmnChats[id].SD.unread){
if(tab.tab_el.childNodes[1] && tab.tab_el.childNodes[1].tagName.toUpperCase() != "I"){
var cel = tab.tab_el.childNodes[1]
} else {
var cel = document.createElement("span")
cel.className = "unread"
cel.appendChild(document.createTextNode(""))
if(tab.tab_el.childNodes[1]){
tab.tab_el.insertBefore(cel, tab.tab_el.childNodes[1])
} else {
tab.tab_el.appendChild(cel)
}
}
cel.firstChild.data = dAmnChats[id].SD.unread > 100 ? "100+" : parseInt(dAmnChats[id].SD.unread)
}
}
}
}
}
},
// ADDCMDFIXES: Applies small fixes and enhancements to current dAmn commands (not new ones) and tabbings
addcmdfixes: function(){
MiddleMan.Event.bind("dAmnChat", "key", "superdAmn_fixcmds", function(args){
if(typeof args != "object" || !args.length){
if(!window.SUPERDAMN_WARNED){
superdAmn.error("superdAmn", "SuperdAmn not first MiddleMan userscript in userscript list. Please drag the userscript further up on your list in Tools > Greasemonkey > Manage User Scripts.")
window.SUPERDAMN_WARNED = true
}
return args
}
var e = args[0], kc = args[1], force = args[2]
var ci = dAmnChats[dAmnChatTab_active].channels.main.input // Substituting "this"
var el = ci.chatinput_el
if(kc == 9 && !e.ctrlKey && !e.shiftKey && !ci.tablist){
// Make tabbing work for #chatrooms and :dev...: & :icon...: codes
var results = []
ci.tabstart = el.value.lastIndexOf(" ") + 1
ci.tabindex = 0
var tabstr = el.value.substr(ci.tabstart)
var pretab = el.value.substr(0, ci.tabstart)
var admining = false, privclassing = false, nosort = false
// DEVS AND ICONS
var modre = /^(\:[(dev)|(icon)])[a-zA-Z0-9|-]+/
var modif, modst
if(modst = modre.exec(tabstr)){
modif = (modst[1] == ":d") ? ":dev" : ":icon"
tabstr = tabstr.substring(modif.length).replace(/:$/, "")
}
// ADMINING w/ action+privclass autocomplete
var admincmds = [
"create privclass",
"move users",
"remove privclass",
"rename privclass",
"show privclass",
"show users",
"showverbose privclass",
"showverbose users",
"update privclass"
]
if(pretab.match(/^\/admin/)){
admining = true
}
if(pretab.match(/^\/(admin ((update|rename|remove) privclass|move users)|(de|pro)mote\s+[a-zA-Z0-9-]+)\s*$/)){ // Only certain actions are legible for privclasses
privclassing = true
}
if(pretab.match(/^\/admin [a-z]+\s*$/)){ // Admin actions should allow ONE space
var arg = pretab.split(" ")[1]
tabstr = arg + " " + tabstr
ci.tabstart -= arg.length + 1 // Push the tabstart left
pretab = "/admin "
}
// Does we has something to tab at?
if(tabstr.length){
var prefix = tabstr.charAt(0)
if(prefix == "#" && !modif && !admining){ // Search chatrooms
var search = new RegExp("^" + tabstr.substr(1) + "\\S*", "i")
for(var ns in dAmnChats){
if(ns.substr(0,5) == "chat:" && ns.substr(5).match(search)){
results = results.concat("#" + ns.substr(5))
}
}
}
if(prefix != "#" && prefix != "/" && modif && !admining){ // Search usernames when :dev/:icon'ing
results = ci.cr.members.MatchMembers(new RegExp("^" + tabstr + "\\S*", "i"))
for(var i in results){ results[i] = modif + results[i] + ":" }
}
if(admining && !privclassing && !modif){ // Search admin actions
var search = new RegExp("^" + tabstr + "\\S*", "i")
nosort = true // It's best to put showverbose after the normal show's, so no sorting here
for(var cmd in admincmds){
if(admincmds[cmd].match(search)){
results = results.concat(admincmds[cmd])
}
}
}
if(privclassing && !modif){ // Search privclasses when /admining or /privchging
var pclist = dAmnChats[dAmnChatTab_active].members.pclist
var to = admining ? pretab.match(/\/admin (rename privclass|move users)/) : false
var search = new RegExp("^" + tabstr + "\\S*", "i")
for(var pc in pclist){
if(pclist[pc].name.match(search)){
results = results.concat(pclist[pc].name + (to ? " to " : (admining ? " " : "")))
}
}
}
// Tab results!
if(results && results.length){
if(!nosort){
results.sort(function(a,b){ var x = String(a).toLowerCase(); var y = String(b).toLowerCase(); return x < y ? -1 : (x > y ? 1 : 0) })
}
results.splice(0, 0, results.pop()) // Fix some serious fuckup somewhere
el.value = pretab + results[0] // Add first result to input
if(results.length > 1){ // Then allow tabbing through results
ci.tablist = results
ci.tabindex = 0
}
}
}
}
// Below code is stolen from MiddleMan, which in turn took it directly from dAmn -- I compressed it slightly
if(kc != 9){
dAmnChatTabs_activate(ci.cr.ns, true); delete ci.tablist
if(kc == 13 && (force || !ci.multiline || e.shiftKey || e.ctrlKey) && el.value){
if(e.shiftKey || (!ci.multiline && e.ctrlKey)){ dummy = null }
else {
var cmdre = el.value.match(/^\/([a-z]+)([\s\S]*)/m); if(!cmdre){ dummy = null }
else {
var cmd = cmdre[1].toLowerCase(), args = null
if(cmdre[2]){ var tmp = cmdre[2].match(/^\s([\s\S]*)/); if(tmp && tmp.length) args = tmp[1] }
if(!ci.cmds[cmd]){ dummy = null } else if(typeof ci.cmds[cmd][0] == "number"){
// SuperdAmn additions start here
var continuing = true
if(args && args.indexOf(" ") > -1){ // Commands where args are required
var allargs = superdAmn.trim(args).split(" "), p
switch(cmd){
case "join": // Multi-join
for(var arg in allargs){
if(p = allargs[arg].match(/^\s*(\S*)\s*$/)){
dAmn_Join("chat:" + p[1].match(/^#?(.*)/)[1])
} else {
superdAmn.error("syntax", "/join #chatroom")
}
}
continuing = false
break
case "part": // Yes, I know that args are actually optional for part, but if it doesn't match here, it'll just go to standard dAmn part
for(arg in allargs){
if(p = allargs[arg].match(/^\s*(\S*)\s*$/)){
dAmn_Part("chat:" + p[1].match(/^#?(.*)/)[1])
} else {
superdAmn.error("syntax", "/part #chatroom")
}
}
continuing = false
break
case "whois": // Multi-whois
for(var arg in allargs){
if(p = allargs[arg].match(/^\s*(\S*)\s*$/)){
dAmn_Get("login:" + p[1], "info")
} else {
superdAmn.error("syntax", "/whois username")
}
}
continuing = false