-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtesting.user.js
More file actions
4109 lines (3623 loc) · 146 KB
/
testing.user.js
File metadata and controls
4109 lines (3623 loc) · 146 KB
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 Testing 1
// @version 0.03.0034
// @description
// @exclude http://beta.musicbrainz.org/artist/create*
// @exclude http://beta.musicbrainz.org/artist/*/credit
// @exclude http://beta.musicbrainz.org/artist/*/credit/*
// @exclude http://beta.musicbrainz.org/artist/*/credit/*/*
// @exclude http://beta.musicbrainz.org/artist/*/edit
// @exclude http://beta.musicbrainz.org/artist/*/edit_annotation
// @exclude http://beta.musicbrainz.org/artist/*/split
// @exclude http://beta.musicbrainz.org/label/*/*
// @exclude http://musicbrainz.org/artist/create*
// @exclude http://musicbrainz.org/artist/*/credit
// @exclude http://musicbrainz.org/artist/*/credit/*
// @exclude http://musicbrainz.org/artist/*/credit/*/*
// @exclude http://musicbrainz.org/artist/*/edit
// @exclude http://musicbrainz.org/artist/*/edit_annotation
// @exclude http://musicbrainz.org/artist/*/split
// @exclude http://musicbrainz.org/label/*/*
// @exclude http://test.musicbrainz.org/artist/create*
// @exclude http://test.musicbrainz.org/artist/*/credit
// @exclude http://test.musicbrainz.org/artist/*/credit/*
// @exclude http://test.musicbrainz.org/artist/*/credit/*/*
// @exclude http://test.musicbrainz.org/artist/*/edit
// @exclude http://test.musicbrainz.org/artist/*/edit_annotation
// @exclude http://test.musicbrainz.org/artist/*/split
// @exclude http://test.musicbrainz.org/label/*/*
// @include http://beta.musicbrainz.org/artist/*
// @include http://beta.musicbrainz.org/artist/*/releases
// @include http://beta.musicbrainz.org/label/*
// @include http://beta.musicbrainz.org/release-group/*
// @include http://musicbrainz.org/artist/*
// @include http://musicbrainz.org/artist/*/releases
// @include http://musicbrainz.org/label/*
// @include http://musicbrainz.org/release-group/*
// @include http://test.musicbrainz.org/artist/*
// @include http://test.musicbrainz.org/artist/*/releases
// @include http://test.musicbrainz.org/label/*
// @include http://test.musicbrainz.org/release-group/*
// ==/UserScript==
/*global console JpegMeta Blob BlobBuilder File GM_xmlhttpRequest jscolor requestFileSystem webkitRequestFileSystem TEMPORARY URL postMessage */
/*jshint regexp:true, latedef: true, nonew: true, esnext:true, smarttabs:true, bitwise:false, forin:true, noarg:true, noempty:true, eqeqeq:true, es5:true, expr:true, strict:true, undef:true, curly:true, nonstandard:true, browser:true, jquery:true, maxerr:500, laxbreak:true, newcap:true, laxcomma:true, evil:true */
/* ----------------------------------------------------------------------------------------------------------|
Installation and requirements:
Firefox: Requires version 11 or higher. Install as normal. When the script is run the first time, a
confirmation prompt will be displayed. Make sure to click "accept"!
Chrome:
1) Install script.
2) (Newer versions of Chrome have removed this checkbox and the need for this step.)
Go to settings --> extensions ( chrome://chrome/extensions/ ). If there is an
"Allow access to file URLs" checkbox next to this extension, make sure that it is checked.
3) Restart Chrome.
If you reinstall or upgrade the script, you may need to restart the browser before the script works again.
Opera: Not compatible, sorry.
|------------------------------------------------------------------------------------------------------------|
Translations are handled at https://www.transifex.net/projects/p/CAABatch/
|---------------------------------------------------------------------------------------------------------- */
//TODO: Make preview minimizable.
//TODO: Figure why the .pngs are getting a border when converted
//TODO: Handle dataURL length limits; 2MB in Chrome,
//TODO: Check for the "improveable" URLS - http://wiki.musicbrainz.org/User:Nikki/CAA
//TODO: Parse/load from URL ARs
//TODO: Allow drag/drop directly onto dropbox, rather than only from sidebox
//TODO: Display resolution info (somewhere) for each image
//TODO: Add JSHint to tools
//TODO: online/offline
//TODO: Finish refactoring image editor
//TODO: "Submit all"
//TODO: Edit submission queing
//TODO: Fix loading CAA types (see http://musicbrainz.org/artist/056e19d1-e8aa-4b63-8e83-69556e8b31f3 )
//TODO: Fix the overflow on the RG page (see http://musicbrainz.org/artist/056e19d1-e8aa-4b63-8e83-69556e8b31f3 )
// seems to only affect dropboxes added when CAA images need more boxes
//TODO: Add remove all images button
//TODO: Refactor loading images from helper script while this script is running (load at start already works)
//TODO: Use the persistent parse webpages setting
//TODO: Add support for editing MB's existing CAA image data
//TODO: Add support for removing existing CAA images
//TODO: Add support for positioning/repositioning CAA images
//TODO: import images from linked ARs - Discogs, ASIN, other databases, others? What UI?
//TODO: Add webp support for Firefox
//TODO: Apply rotation, if any, after a flip is done in the image editor
//TODO: Resize Images/Preview area on screen resize
//TODO: Fullsize image editor option
//TODO: HSL controls in image editor
//TODO: handle http://e621.net/post/show/164512/
document.body = document.body || document.getElementsByTagName('body')[0];
/* Initialize constants. */
var OUTERCONTEXT =
{ CONTEXTS: {}
, UTILITY:
{ extend :
function (objOne, objTwo) {
'use strict';
var temp
, len
;
if (!Object.keys(objOne).length) {
return objTwo;
}
if (2 < arguments.length) {
for (temp = 1, len = arguments.length; temp < len; temp++) {
this.extend(objOne, arguments[temp]);
}
} else {
Object.keys(objTwo).forEach(function (key) {
objOne[key] = objTwo[key];
});
}
return objOne;
}
, height :
function get_client_height(id) {
'use strict';
return document.getElementById(id).clientHeight;
}
}
};
OUTERCONTEXT.CONSTANTS =
{ DEBUGMODE : false
, VERSION : '0.03.0021'
, NAMESPACE : 'Caabie'
, DEBUG_VERBOSE : false
, BORDERS : '1px dotted #808080'
, COLORS :
{ ACTIVE : '#B0C4DE'
, CAABOX : '#F2F2FC'
, CAABUTTONS : '#4B0082'
, EDITOR : '#F9F9F9'
, EDITORMENU : '#D5D5FF'
, INCOMPLETE : '#FFFF7A'
, COMPLETE : '#C1FFC1'
, REMOVE : '#B40000'
, MASK : '#000'
}
, COVERTYPES : /* The order of items in this array is important! */
[ 'Front' // 1
, 'Back' // 2
, 'Booklet' // 3
, 'Medium' // 4
, 'Obi' // 5
, 'Spine' // 6
, 'Track' // 7
, 'Other' // 8
, 'Tray' // 9
, 'Sticker' // 10
]
, IESHADOWLVL : 75
, FILESYSTEMSIZE : 50 /* This indicates the number of megabytes to use for the temporary local file system. */
, IMAGESIZES : [ 50, 100, 150, 300 ]
, LANGUAGE : 'en'
, SIDEBARWIDTH : ( Math.max(window.innerWidth / 500 << 0, 3) * 107 ) + 15
, SIDEBARHEIGHT : window.innerHeight - OUTERCONTEXT.UTILITY.height( 'header' ) - OUTERCONTEXT.UTILITY.height( 'footer' ) - 25
, THROBBER : localStorage.getItem( 'throbber' )
, PREVIEWSIZE : 300
, IMAGEFORMATS : [ 'bmp', 'gif', 'jpg', 'png' ]
, BEINGDRAGGED :
{ OPACITY : 0.4
, SHRINK : 0.7
}
, CREDITS :
{ 'Developer and programmer':
[
{ name: 'Brian Schweitzer (“BrianFreud”)'
, urlN: 'userscripts.org/users/28107'
, mb : 'brianfreud'
}
]
, Translations:
[
{ name: 'Calvin Walton (“kepstin”)'
, what: 'Canadian English'
, urlN: 'www.kepstin.ca'
, mb : 'kepstin'
}
]
, Icons:
[
{ name: '“Mapto”'
, what: 'Magnifying glass icons'
, urlN: 'commons.wikimedia.org/wiki/User:Mapto'
, urlW: 'commons.wikimedia.org/wiki/File:View-zoom-in.svg'
}
, { name: '“Inductiveload”'
, what: 'Magnifying glass icons'
, urlN: 'commons.wikimedia.org/wiki/User:Inductiveload'
, urlW: 'commons.wikimedia.org/wiki/File:View-zoom-out.svg'
}
, { name: '“ablonevn”'
, what: 'Gear icon'
, urlW: 'www.clker.com/clipart-169255.html'
}
, { name: '“El T”'
, what: 'Information icon'
, urlN: 'en.wikipedia.org/wiki/User:El_T'
, urlW: 'en.wikipedia.org/wiki/File:Information_icon.svg'
}
, { name: 'Timur Gafforov & Avraam Makhmudov'
, what: 'Throbber image'
, urlW: 'preloaders.net'
}
]
, Plugins:
[
{ name: 'Ben Barnett'
, what: 'jQuery.animate-enhanced v0.91'
, urlN: 'benbarnett.net'
, urlW: 'github.com/benbarnett/jQuery-Animate-Enhanced'
}
, { name: 'Ryan Wheale & Tim Banks'
, what: 'jQuery.getHiddenDimensions'
, urlN: 'www.foliotek.com/devblog/author/timlanit'
, urlW: 'www.foliotek.com/devblog/getting-the-width-of-a-hidden-element-with-jquery-using-width'
}
, { name: 'Brian Schweitzer & Naftali Lubin'
, what: 'jQuery.appendAll'
}
, { name: 'James Padolsey'
, what: 'jQuery.single'
, urlN: 'james.padolsey.com'
, urlW: 'james.padolsey.com/javascript/76-bytes-for-faster-jquery'
}
, { name: '“Cowboy” Ben Alman'
, what: 'jQuery.detach+ v0.1pre'
, urlN: 'benalman.com'
, urlW: 'gist.github.com/978520'
}
, { name: 'Mathieu \'P01\' Henri'
, what: 'chain method and CanvasRenderingContext2D chaining from "Hypno trip down the fractal rug"'
, urlN: 'www.p01.org'
, urlW: 'www.p01.org/releases/20_lines_hypno_trip_down_the_fractal_rug'
}
]
, Polyfills:
[
{ name: 'Eric Bidelman'
, what: 'idb.filesystem.js v0.0.1'
, urlN: 'ericbidelman.tumblr.com'
, urlW: 'github.com/ebidel/idb.filesystem.js'
}
, { name: 'Jan Odvarko'
, what: 'jscolor v1.3.13'
, urlW: 'jscolor.com'
}
, { name: 'Jonathan Stipe'
, what: 'number polyfill'
, urlW: 'github.com/jonstipe/number-polyfill'
}
, { name: 'Sebastian Tschan (“blueimp”)'
, what: 'javaScript canvas to blob 2.0'
, urlN: 'blueimp.net'
, urlW: 'github.com/blueimp/JavaScript-Canvas-to-Blob'
}
]
, Tools:
[
{ name: 'Jeff Schiller'
, what: 'Scour'
, urlW: 'www.codedread.com/scour'
}
, { name: 'Google'
, what: 'Google Closure Compiler'
, urlW: 'closure-compiler.appspot.com/home'
, urlN: 'google.com'
}
, { name: 'Site Project ApS'
, what: 'JavaScript string encoder'
, urlW: 'www.htmlescape.net/stringescape_tool.html'
}
, { name: 'Yahoo!'
, what: 'Yahoo! Query Language'
, urlW: 'developer.yahoo.com/yql/'
, urlN: 'yahoo.com'
}
]
, Libraries:
[
{ name: 'Tim Smart'
, what: 'data_string function'
, urlN: 'github.com/Tim-Smart'
, urlW: 'pastebin.ca/1425789'
}
, { name: 'Tyler Akins, Bayron Guevara, Thunder.m, Kevin van Zonneveld, Pellentesque Malesuada, Rafał Kukawski & Brian Schweitzer'
, what: 'base64_encode function from PHPJS'
, urlN: 'rumkin.com'
, urlW: 'phpjs.org/functions/base64_encode'
}
, { name: 'Steven Thurlow (“Stoive”)'
, what: 'dataURItoBlob'
, urlN: 'github.com/stoive'
, urlW: 'stackoverflow.com/questions/4998908/convert-data-uri-to-file-then-append-to-formdata'
}
, { name: 'Ben Leslie'
, what: 'jsjpegmeta'
, urlN: 'benno.id.au/'
, urlW: 'code.google.com/p/jsjpegmeta/'
}
, { name: 'John Resig and the rest of the jQuery team'
, what: 'jQuery 1.7.2'
, urlN: 'jquery.org/team'
, urlW: 'jquery.com'
}
, { name: 'The jQueryUI team'
, what: 'jQuery UI 1.8.19'
, urlN: 'jqueryui.com/about'
, urlW: 'jqueryui.com'
}
]
}
, TEXT: {
en: {
'languageName' : 'English'
, 'Add cover art' : 'Add cover art'
, 'Add image one release' : 'Add a box for another image.'
, 'Bottom' : 'Bottom'
, 'bytes' : 'bytes'
, 'Changed colors note' : 'Changes to the color settings will take effect the next time that this script is run.'
, 'Changed language note' : 'Changes to the language setting will take effect the next time that this script is run.'
, 'Click to edit this image' : 'Left click to edit this image'
, 'Close' : 'Close'
, 'Colors' : 'Colors'
, 'Crop image' : 'Crop'
, 'default' : 'default'
, 'degrees' : 'degrees'
, 'File size' : 'File size'
, 'Flip image' : 'Flip'
, 'How dark the bkgrnd' : 'Image editor shadow'
, 'How many degrees' : 'How many degrees to rotate the image'
, '(Image) Resolution' : 'Resolution'
, 'Images' : 'Images'
, 'Language' : 'Language'
, 'Left' : 'Left'
, 'Load CAA images for all' : 'Load image data for all releases'
, 'Load CAA images' : 'Load image data for this release'
, 'Submit all complete edits': 'Submit all edits'
, 'loading' : 'Loading data from the Cover Art Archive, please wait...'
, 'Load text all releases' : 'Loads images for all displayed releases.'
, 'Load text one release' : 'Loads any images already in the Cover Art Archive for this release.'
, 'Crop mask color' : 'Mask color'
, 'Magnify image' : 'Zoom in'
, 'Options' : 'Options'
, 'Parse (help)' : 'Check this box to enable parsing web pages whenever you drop in a link to a web page or a list of webpage URLs.'
, 'Parse web pages' : 'Parse web pages'
, 'Preview Image' : 'Preview'
, 'Queued' : 'Queued'
, 'Remove image' : 'Click to remove this image'
, 'Remove images' : 'Toggle remove images mode'
, 'Remove stored images nfo' : 'This removes any images from other websites that you have stored while this script was not running.'
, 'Remove stored images' : 'Remove stored images'
, 'Right' : 'Right'
, 'Rotate image' : 'Rotate'
, 'Shrink image' : 'Zoom out'
, 'Submit as autoedits' : 'Submit edits as autoedits'
, 'Submit edit' : 'Submit edit'
, 'Submit edits' : 'Submit edits'
, 'Switch to full screen' : 'Switch to full screen view'
, 'Submitting' : 'Submitting'
, 'take effect next time' : 'Changes to the language and color settings will take effect the next time that this script is run.'
, 'Top' : 'Top'
, 'Version' : 'Version'
, 'coverType:Back' : 'Back'
, 'coverType:Booklet' : 'Booklet'
, 'coverType:Front' : 'Front'
, 'coverType:Medium' : 'Medium'
, 'coverType:Obi' : 'Obi'
, 'coverType:Other' : 'Other'
, 'coverType:Spine' : 'Spine'
, 'coverType:Track' : 'Track'
, 'coverType:Tray' : 'Tray'
, 'coverType:Sticker' : 'Sticker'
, 'About' : 'About'
, 'Developer and programmer' : 'Developer and programmer'
, 'Icons' : 'Icons'
, 'Plugins' : 'Plugins'
, 'Polyfills' : 'Polyfills'
, 'Translations' : 'Translations'
, 'Tools' : 'Tools'
, 'Libraries' : 'Libraries'
, 'Save' : 'Save'
, 'Save changes' : 'Save changes'
, 'Cancel' : 'Cancel'
, 'Error' : 'Error'
, 'Error too much cropping' : 'Cropping this much would remove the entire image!'
, 'Apply' : 'Apply'
, 'ACTIVE' : 'Droppable area'
, 'CAABOX' : 'Empty coverart box'
, 'CAABUTTONS' : 'Load info buttons'
, 'EDITOR' : 'Image editor background'
, 'EDITORMENU' : 'Image editor menu'
, 'INCOMPLETE' : 'Incomplete edits'
, 'COMPLETE' : 'Edits ready to submit'
, 'REMOVE' : 'Remove image highlight'
, 'MASK' : 'Default crop mask color'
, 'image with incorrect extension type':'image with incorrect extension type'
, 'converted' : 'converted'
}
}
};
/* Special case Canadian English. */
OUTERCONTEXT.CONSTANTS.TEXT['en-ca'] = JSON.parse(JSON.stringify(OUTERCONTEXT.CONSTANTS.TEXT.en));
OUTERCONTEXT.UTILITY.extend( OUTERCONTEXT.CONSTANTS.TEXT['en-ca'],
{ 'languageName': 'English (Canadian)'
, 'Colors': 'Colours'
, 'Changed colors note': OUTERCONTEXT.CONSTANTS.TEXT['en-ca']['Changed colors note'].replace('color', 'colour')
, 'take effect next time': OUTERCONTEXT.CONSTANTS.TEXT['en-ca']['take effect next time'].replace('color', 'colour')
}
);
/* Conditionally add the debug "language". */
if (OUTERCONTEXT.CONSTANTS.DEBUGMODE) {
OUTERCONTEXT.CONSTANTS.TEXT.test =
{ strings: {}
, generateMorse:
function() {
'use strict';
var chars = [' ', '-', '·']
, morseString = ''
, repeats = Math.random() * 50 >> 0;
while (repeats--) {
morseString += chars[Math.random() * 3 >> 0];
}
return morseString;
}
, init:
function() {
'use strict';
var self = this;
Object.keys(OUTERCONTEXT.CONSTANTS.TEXT.en).forEach(function(text) {
self.strings[text] = self.generateMorse();
});
this.strings.languageName = 'pseudo-Morse code';
return this.strings;
}
}.init();
}
OUTERCONTEXT.UTILITY.extend( OUTERCONTEXT.UTILITY,
{ getColor:
// Gets a color value stored in localStorage.
function getColor(colors, color) {
'use strict';
var thisColor = localStorage.getItem('Caabie_colors_' + color);
if (arguments.length === 1) {
color = colors;
colors = OUTERCONTEXT.CONSTANTS.COLORS;
}
thisColor === null && (thisColor = colors[color]);
return thisColor;
}
, hexToRGBA:
// Converts a hex color string into an rgba color string
function hexToRGBA(hex, opacity) {
'use strict';
hex = ('#' === hex.charAt(0) ? hex.substring(1, 7) : hex);
var R = parseInt(hex.substring(0, 2), 16)
, G = parseInt(hex.substring(2, 4), 16)
, B = parseInt(hex.substring(4, 6), 16)
;
return 'rgba(' + [R, G, B, opacity || 1].join(',') + ')';
}
}
);
/* Define repeated css strings used while defining the CSS constants. */
OUTERCONTEXT.CSSSTRINGS = { SHRINK : ['scale', '(', OUTERCONTEXT.CONSTANTS.BEINGDRAGGED.SHRINK, ')'].join('') };
/* Initialize CSS constants which are persistantly stored in localStorage. */
null === localStorage.getItem('Caabie_editorShadow') && localStorage.setItem('Caabie_editorShadow', 75);
/* Define the CSS constants. */
OUTERCONTEXT.CONSTANTS.CSS =
{ '.CAAbutton':
{ 'background-color' : '#C7C7C7'
, border : '1px outset #EEE!important'
, 'border-radius' : '6px'
, cursor : 'pointer'
, 'font-family' : 'Bitstream Vera Sans, Verdana, Arial, sans-serif'
, 'font-size' : '100%'
, 'margin-right' : 0
, 'outline' : 'none'
, padding : '3px'
, width : '79px'
}
, '.CAAbutton:active':
{ border : '1px inset #D3D3D3'
, opacity : 1
}
, 'select.CaabieOptions':
{ 'background-color' : 'rgba(200, 200, 255, .8)'
, 'border-top-left-radius' : '10px'
, 'border-bottom-left-radius' : '10px'
, 'border-top-right-radius' : '6px'
, 'border-bottom-right-radius' : '6px'
, 'border' : '1px dotted navy'
, 'border-right' : 0
, outline : 'none'
}
, '#Options‿input‿button‿default, #Options‿input‿color‿colors':
{ float : 'right'
}
, '.CAAbutton:hover, select.CaabieOptions:hover':
{ 'box-shadow' : 'inset 0px 0px 20px 3px rgba(0, 0, 150, .15)'
, 'background-color' : 'rgba(100, 100, 100, .2)'
}
, '.CAAversion':
{ 'float' : 'right'
, 'font-size' : '75%'
, 'margin-top' : '-15px'
}
, '#Options‿input‿color‿colors, #ImageEditor‿input‿color‿ieMaskColorControl':
{ border : '1px outset #D3D3D3'
}
, '#Options‿select‿colors':
{ 'float' : 'left'
, padding : '5px'
}
, '#Options‿input‿number‿shadow':
{ 'margin-left' : '5px'
, width : '3.5em'
}
, '#Options‿label‿shadow::after':
{ content : '"%"'
}
, '#ImageEditor‿canvas‿ieCanvas':
{ 'background-color' : '#FFF'
}
, 'div.removeMode img.localImage':
{ cursor : 'crosshair!important'
}
, '#ImageEditor‿input‿number‿ieRotateControl':
{ 'margin-right' : '2px'
, width : '4em'
}
, 'figure.CAA_COMPLETE':
{ 'background-color' : OUTERCONTEXT.UTILITY.getColor('COMPLETE')
}
, 'figure.CAA_INCOMPLETE':
{ 'background-color' : OUTERCONTEXT.UTILITY.getColor('INCOMPLETE')
}
, 'figure.CAA_NULL > fieldset, figure.CAA_INCOMPLETE > fieldset, figure.CAA_EXISTING > fieldset, div.CAAedit_Submitting, div.CAAedit_Queued':
{ display : 'none'
}
, 'figure.CAA_EXISTING > fieldset':
{ border : 'none!important'
}
, 'figure.CAA_COMPLETE.CAA_SUBMITTING select, figure.CAA_COMPLETE.CAA_QUEUED select':
{ opacity : 0.2
}
, 'figure.CAA_COMPLETE.CAA_SUBMITTING div.CAAedit_Submitting, figure.CAA_COMPLETE.CAA_QUEUED div.CAAedit_Queued':
{ display : 'block!important'
, 'font-size' : '125%'
, 'font-weight' : 900
, 'padding-top' : '3em'
, 'font-weight' : '900'
, 'text-shadow' : '0 0 3px white, 0 0 7px white, 0 0 12px white, 0 0 25px navy, 0 0 45px navy, 0 0 100px navy, 0 0 150px purple'
, 'color' : '#020'
, 'font-family' : 'Georgia'
}
, '#ImageEditor‿div‿ieMenu':
{ 'background-color' : OUTERCONTEXT.UTILITY.getColor('EDITORMENU')
, 'border-radius' : '20px'
, border : '1px dotted navy'
, height : '60%'
, padding : '16px'
, position : 'absolute'
, right : '40px'
, top : '20%'
}
, '#ImageEditor‿div‿ieCanvasDiv':
{ position : 'relative'
}
, '.CAAmask':
{ position : 'absolute'
, height : 0
, width : 0
}
, '.maskHorizontal':
{ height : '100%'
}
, '.maskVertical':
{ width : '100%'
}
, '.maskLeft':
{ 'z-index' : 300
, left : 0
, top : 0
}
, '.maskRight':
{ 'z-index' : 301
, right : 0
, top : 0
}
, '.maskTop':
{ 'z-index' : 302
, left : 0
, top : 0
}
, '.maskBottom':
{ 'z-index' : 303
, left : 0
, bottom : 0
}
, '.cropLabel':
{ clear : 'both'
, display : 'block'
, 'margin-bottom' : '4px'
}
, '.cropControl':
{ height : '24px'
, margin : '0 4px 2px 0!important'
, 'vertical-align' : 'middle'
, width : '45px'
}
, '.flipControl':
{ 'border-radius' : '21px'
, 'border-width' : '1px'
, 'font-size' : '130%'
, 'font-weight': 600
, padding : '0px 15px'
}
, '#Options‿div‿shadow':
{ display : 'inline-block'
, 'margin-top' : '4px'
}
, '#Main‿div‿imageContainer':
{ height : (OUTERCONTEXT.CONSTANTS.SIDEBARHEIGHT - 25) + 'px'
, 'max-height' : (OUTERCONTEXT.CONSTANTS.SIDEBARHEIGHT - 25) + 'px'
}
, '#Main‿div‿imageHolder':
{ 'margin-bottom' : '1em'
, 'overflow-y' : 'auto'
, width : '100%'
}
, '#Main‿h1‿imageHeader':
{ 'float' : 'left'
, width : '30%'
}
, '#Main‿div‿image_size':
{ 'float' : 'right'
, 'height' : '24px'
, width : '25%'
}
, '#Options‿select‿language':
{ height : '5em'
, padding : '6px'
, 'text-transform' : 'capitalize'
}
, '#Main‿div‿options_control, #Main‿div‿about_control':
{ display : 'inline-block'
, 'float' : 'right'
, opacity : 0.4
}
, '#Main‿div‿options_control':
{ 'margin-right' : '-26px'
, 'margin-top' : '-3px'
}
, '#Main‿div‿about_control':
{ 'margin-top' : '-1px'
, height : '23px'
, width : '23px'
}
, '#Options‿fieldset‿main, #About‿fieldset‿main':
{ border : '1px solid #D3D3D3'
, 'border-radius' : '8px'
, 'line-height' : '2!important'
, margin : '10px 3px'
, padding : '8px'
}
, '#Options‿fieldset‿main * select':
{ 'font-size' : '105%'
, width : '100%'
}
, '#Options‿fieldset‿main > label > select':
{ padding : '3px'
}
, '#Options‿fieldset‿main > label, #Options‿fieldset‿main > label > select':
{ 'margin-left' : '5px'
, 'margin-top' : '12px'
}
, '#Options‿div‿note':
{ 'font-size' : '85%'
, 'font-style' : 'oblique'
}
, '#page':
{ 'min-height' : (OUTERCONTEXT.CONSTANTS.SIDEBARHEIGHT - 50) + 'px'
}
, '#Preview‿dl‿info':
{ 'line-height' : '140%'
, margin : '0 auto'
, 'padding-top' : '6px'
, width : '60%'
}
, '#Preview‿dl‿info > dd':
{ 'float' : 'right'
}
, '#triggerLink':
{ 'cursor' : 'pointer'
}
, '#xhrComlink':
{ display : 'none'
}
, '#ImageEditor‿div‿CAAoverlay':
{ background : '#000'
, bottom : 0
, left : 0
, opacity : localStorage.getItem('Caabie_editorShadow') / 100
, position : 'fixed'
, top : 0
, width : '100%'
, 'z-index' : 400
}
, '#ImageEditor‿div‿ie':
{ 'background-color' : OUTERCONTEXT.UTILITY.getColor('EDITOR')
, 'box-shadow' : 'inset 0 0 10px #FFF, 2px 2px 8px 3px #111'
, border : '1px outset grey'
, 'border-radius' : '20px'
, height : '86%'
, left : '50%'
, margin : '0 auto'
, 'margin-left' : '-43%'
, 'margin-top' : '5%'
, padding : '2%'
, position : 'fixed'
, width : '86%'
, 'z-index' : 500
}
, '#ImageEditor‿div‿ieDiv':
{ height : '96%'
, margin : '2%'
, width : '96%'
}
, '.beingDragged':
{ opacity : OUTERCONTEXT.CONSTANTS.BEINGDRAGGED.OPACITY
, transform : OUTERCONTEXT.CSSSTRINGS.SHRINK
}
, 'figure.CaabieDropBox':
{ 'border-radius' : '6px'
, display : 'inline-block'
, margin : '8px'
, 'min-height' : '126px'
, padding : '3px'
, 'vertical-align' : 'top'
, width : '140px'
}
, 'div.CaabieDropBox':
{ clear : 'both'
, display : 'block'
, 'font-size' : '80%'
, height : '120px'
, margin : '0 auto'
, width : '100%'
}
, 'fieldset.CaabieDropBox':
{ border : 'none'
, 'text-align' : 'center'
}
, 'img.CaabieDropBox':
{ display : 'block'
, height : 'auto'
, 'image-rendering' : 'optimizeQuality'
, margin : 'auto'
, 'max-height' : '120px'
, 'max-width' : '120px'
, width : 'auto'
}
, 'figcaption.CaabieDropBox':
{ position : 'relative'
, 'text-align' : 'center'
}
, 'input.CaabieDropBox':
{ clear : 'both'
, 'font-size' : '12px'
, 'margin-bottom' : '.4em'
, 'margin-top' : '.4em'
, padding : '2px'
, width : '94%'
}
, 'select.CaabieDropBox':
{ 'appearance' : 'caret'
, 'background-color' : 'transparent'
, border : '0 none transparent'
, clear : 'both'
, clip : 'rect(auto 7em auto auto)'
, color : '#555'
, display : 'block'
, 'font-size' : 'inherit'
, 'margin-left' : '40px'
, outline : 'none'
, 'padding-right' : '40px'
, position : 'absolute'
, 'text-align' : 'center'
, 'vertical-align' : 'top'
}
, '.caaAdd, .caaRemoveMode':
{ 'border-radius' : '7px'
, 'font-size' : '150%'
, 'font-weight' : '900!important'
, opacity : 0.3
, 'padding-bottom' : 0
, 'padding-top' : 0
}
, '.caaAdd':
{ border : '0 none #FAFAFA!important'
, 'background-color' : 'green!important'
, color : '#FFF!important'
, 'float' : 'left'
, left : '2em'
, 'margin-left' : '-1.2em'
, position : 'absolute'
}
, '.caaRemoveMode':
{ border : '1px solid red'
, 'float' : 'right'
, height : '22px'
, 'margin-right' : '5px'
, 'margin-top' : 0
, opacity : 0.3
, 'padding-bottom' : 0
, 'padding-top' : 0
, width : '23px'
}
, '.caaRemoveMode.caa_Deactive':
{ 'background-color' : 'red'
, color : '#FFF'
}
, '.caaRemoveMode.caa_Active':
{ 'background-color' : '#FFF'
, color : 'red'
}
, '.caaSubmitAll':
{ 'margin-left' : '2em!important'
}
, '.caaAdd:active, .caaSubmitAll:active, .caaAll:active, .caaLoad:active: .caaRemoveMode:active':
{ 'border-style' : 'inset!important'
, color : '#FFF'
, opacity : 1
}
, '.caaAdd:hover, .caaAll:hover, .caaSubmitAll:hover, .caaLoad:hover, .caaRemoveMode:hover':
{ color : '#D3D3D3'
, opacity : 0.9
}
, '.caaDiv':
{ display : 'inline-block'
, 'overflow-x' : 'auto!important'
, 'overflow-y' : 'hidden'
, 'padding-left' : '25px'
, 'white-space' : 'nowrap'
, width : '100%'
}
, '.caaLoad, .caaAll, .caaSubmitAll':
{ 'background-color' : OUTERCONTEXT.UTILITY.getColor('CAABUTTONS') + '!important'
, border : '1px outset #FAFAFA!important'
, 'border-radius' : '7px'
, color : '#FFF!important'
, 'font-size' : '90%'
, opacity : '.35'
, padding : '3px 8px'
}
, '.caaLoad':
{ 'margin-bottom' : '16px'
, 'margin-top' : '1px!important'
}
, '.caaAll, .caaSubmitAll':
{ margin : '1em 0'
}
, '.caaMBCredit':
{ 'font-size' : '85%'
, 'white-space' : 'nowrap'
}
, '.dropBoxImage':
{ background : '#FFF'
, height : '96%'
, padding : '1%'
, width : '96%'
}
, '.newCAAimage':
{ 'background-color' : OUTERCONTEXT.UTILITY.getColor('CAABOX')
, height : '120px!important'
, width : '120px!important'
}
, '.newCAAimage > div':
{ 'background-color' : '#E0E0FF'
, border : OUTERCONTEXT.CONSTANTS.BORDERS
, 'margin-bottom' : '6px!important'
}
, '.tintWrapper':
{ 'background-color' : OUTERCONTEXT.UTILITY.hexToRGBA(OUTERCONTEXT.UTILITY.getColor('REMOVE'), 0.8)
, 'border-radius' : '5px'
, display : 'inline-block'
, margin : 0
, opacity : 0.8
, outline : 0
, padding : 0
, 'vertical-align' : 'baseline'
}
, '#Main‿div‿previewContainer':
{ bottom : 0
, 'border-top' : OUTERCONTEXT.CONSTANTS.BORDERS
, height : (OUTERCONTEXT.CONSTANTS.PREVIEWSIZE + 59) + 'px'
, 'max-height' : (OUTERCONTEXT.CONSTANTS.PREVIEWSIZE + 59) + 'px'
, 'padding-top' : '1em'
, position : 'absolute'
}
, '#Preview‿img‿preview_image':
{ cursor : 'pointer'
, display : 'block'
, height : 'auto'
, margin : '0 auto'
, 'max-height' : (OUTERCONTEXT.CONSTANTS.PREVIEWSIZE + 15) + 'px'
, 'max-width' : (OUTERCONTEXT.CONSTANTS.PREVIEWSIZE + 15) + 'px'
, padding : '15px 0 0 0'
, width : 'auto'
}
, '.CAAsidebar':
{ 'border-left' : OUTERCONTEXT.CONSTANTS.BORDERS
, 'padding-left' : '8px'
, position : 'fixed'
, right : '20px'
, width : OUTERCONTEXT.CONSTANTS.SIDEBARWIDTH + 'px!important'
}
, '.CAAcreditWho':
{ 'text-indent' : '-2em'
}
, '.closeButton':
{ 'background-color' : '#FFD0DB'
, border : '1px solid #EEC9C8'
, 'border-radius' : '8px'
, cursor : 'pointer'
, 'float' : 'right'
, 'line-height' : '9px'
, 'margin-right' : '-1em'
, 'margin-top' : '-11px'
, opacity : 0.9
, padding : '2px 4px 5px'
}
, '.closeButton:hover':
{ 'background-color' : '#FF82AB'
, 'font-weight' : 900
, opacity : 1
}
, '.maximizeButton':
{ 'background-color' : '#EEF'
, border : '1px solid #444'
, 'border-top-width' : '7px'
, 'border-radius' : '2px'
, cursor : 'pointer'
, 'float' : 'right'
, height : '17px'
, 'margin-right' : '0.75em'
, 'margin-top' : '-10px'
, opacity : 0.7
, width : '16px'
}
, '.maximizeButton:hover':
{ 'background-color' : '#DDF'
, opacity : 1
}
, '.existingCAAimage':
{ 'background-color' : '#FFF'
, border : '0 none'
}
, '.existingCAAimage > div > img':
{ border : '0 none'
, 'image-rendering' : 'optimizeQuality'
}
, '.imageRow':
{ 'padding-bottom' : '1em!important'
}
, '.imageSizeControl, #Main‿div‿options_control, #Main‿div‿about_control':
{ cursor : 'pointer'
, 'float' : 'right'
}
, '.imageSizeControl, #Main‿div‿options_control':
{ height : '26px'
, width : '26px'
}
, '.imageSizeControl:hover, #Main‿div‿options_control:hover, #Main‿div‿about_control:hover':
{ opacity : 1
}
, '.localImage':
{ padding : '3px'