-
Notifications
You must be signed in to change notification settings - Fork 0
/
ss_siteboost_gm.user.js
3681 lines (2381 loc) · 159 KB
/
ss_siteboost_gm.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==
// @author plrang
// @name SS SiteBoost GM
// @version 0.32a
// @license http://creativecommons.org/licenses/by-nc-nd/3.0/
// @description Enhancing Shutterstock site features [direct edit, stats, image previews]
// @namespace https://imagerion.com/plrangjs/ss_siteboost
// @include https://*.shutterstock.com/*
// ==/UserScript==
// Archival information
// ABOUT and INFO PAGE
// Also available as a bookmarklet for any browser
// https://plrang.com/blog/tag/ss-siteboost/
// Recent info / Rebuilding for practice 2018 09 - project closed
// Recent info / URLs update 2018 08 - project closed
// Recent changes 2016 07
// Started about 04-09-2010
// Changes
// 11-12-2010 0.30b Maintenance release - fixed parts of stats management and lifetime
// 10-12-2010 0.30 Maintenance release
// Fixed Image Previews problems
// Fixed Image Stats
// Many visual and interface ergonomy fixes (Forum shortcut menu, Quick Edit back on Home Page thumbnails)
// Improved few cross browser compatibility issues
// 12-11-2010 Adapted to Shutterstock New Contributors Home page changes and some minor tweaks
// 04-11-2010 Full Total Stats - automatically collecting and showing the archival sales data
// - improved Edit In Place
// -
// 09-10-2010 Extended to work as a *** regular Safari extension ***
// Keyword counter and title length counter added to original SS [ Edit Photo Page ]
// 08-10-2010 SS fix: Updated to reflect SS gallery layout changes
// Added EditInPlace to HOME page icons [Latest approved and downloads]
// Several fixes
// 05-10-2010 Extended to work as a *** regular Firefox add-on ***
// 30-09-2010 Edit in place - click on the thumbnail in Live Stats to get the editor immediately (except footage)
// - keyword counter
// - title length counter
// Referrals scan added - tricky and time limited to avoid servers overload
// Initial code changed, merged bookmarklet and standalone script code in one - what a relief
// Still no round corners in IE and O
// Several optimizations and bug fixes
// 15-09-2010 Bug Fixes
// 14-09-2010 Live Stats thumbnails show the DL count and earnings for each photo
// 12-09-2010 Clickable Live Stats rows allow to switch daily statistics for current month in the same panel without leaving the page
// 10-09-2010 Added more information to StatSS panel from the Stats Table: Totals and Gross
// 08-09-2010 Corrected 'Edit from Photo page' in autorun version and bookmarklet version
// 07-09-2010 Live Stats - a timer for Auto refresh stats page added
// 06-09-2010 Image Previews handling corrected
// This script is extremelly useful for Shutterstock contributors
// How it works?
// It gives an easy way to manage Shutterstock portfolio:
// * adds edit buttons as a short cut to edit each photo from the gallery and from contributor Home page
// without searching through the batches
// * adds a possibility to edit photo data straight from its page (by clicking the bookmarklet button there).
// * StatSS - quick stats from almost any SS page
// * adds alternative Image Previews with full title text - in contributor gallery and on Home page
// * makes Image Previews available in Chrome, Opera (also useful for image buyers)
// INFO: "INSERT & DON't INSERT filename.js" directives appearing in the code are used for local JS files compilation
// They don't affect the program running
/* ---------------------------------------------------------------------------- */
/* AUTO INSERTed block above from: header.js */
var SSSiteBoost = {
run_SSS: function () {
// INITIALIZATION
var doc = document;
console.log('>>> run_SSS');
var myRGXP_part = new RegExp('https:\/\/.*?shutterstock\.com\/', 'gi');
var _match;
_match = myRGXP_part.exec(doc.location.href);
/* EXCHANGE HERE below - between GM / EXT etc... */
if (!_match)
return false;
// function addJQ(callback) {
// var script = doc.createElement("script");
// script.setAttribute("src", "http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js");
// if (script.addEventListener) {
// script.addEventListener('load', function (aEvent) {
// var script = doc.createElement("script");
// script.textContent = "(" + callback.toString() + ")();";
// doc.body.appendChild(script);
// }, false);
// } else {
// if (script.attachEvent) {
// script.attachEvent('load', function (aEvent) {
// doc.createElement("script");
// script.textContent = "(" + callback.toString() + ")();";
// doc.body.appendChild(script);
// });
// }
// }
// doc.body.appendChild(script);
// }
// if (typeof jQuery == 'undefined') {
// addJQ(_main);
// } else
console.log('>>> _main...');
_main();
function _main() {
var debug_console = true;
console.log('>>> in _main');
const addHTML = (args) =>
{
console.log('const addHTML()');
var htElem = document.querySelector( args.selector);
if ((htElem !== undefined) && (htElem !== null) )
{
console.log(`${args.selector} FOUND: ${args.position}`);
switch ( args.position ) {
case 'innerHTML':
htElem.innerHTML = args.content;
case 'innerTEXT':
htElem.innerTEXT = args.content;
default:
htElem.insertAdjacentHTML(args.position, args.content);
}
if (debug_console)
console.log(`${args.selector} updated`);
return true;
}
else
{
if (debug_console)
console.log(`${args.selector} NOT FOUND`);
return false;
}
}
// (selector, attr, content)
const setAttrHTML = (args) =>
{
console.log('const setAttrHTML()');
var htElem = document.querySelector( args.selector);
if ((htElem !== undefined) && (htElem !== null) )
{
console.log(`${args.selector} FOUND: ${args.attr}`);
switch ( args.attr ) {
case 'val':
htElem.value = args.content;
// example: setAttrHTML({selector: '#' + _switch_prev_panel, attr: 'style', content: 'display:none' });
case 'style':
htElem.setAttribute( args.attr, args.content);
if (debug_console)
console.log(`${args.selector} setting ${args.attr} to ${args.content}`);
}
if (debug_console)
console.log(`${args.selector} updated`);
return true;
}
else
{
if (debug_console)
console.log(`${args.selector} NOT FOUND`);
return false;
}
}
(function () {
console.log('>>> in _main > anonymous');
// $.ajaxSetup({
// cache: false
// });
var browserType = new (function () {
this.Opera = window.opera ? true : false;
this.IE = document.all && !this.Opera ? true : false;
});
var _browser_safe = false;
if ((!browserType.Opera) && (!browserType.IE)) {
_browser_safe = true;
}
// USERS ONLINE
// $.getScript('https://imagerion.com/plrangjs/_wrk/cnt.js');
// if (!this.JSON) {
// $.getScript('https://imagerion.com/plrangjs/json2.js', function () {
// _run();
// });
// this.JSON = {};
// } else
_run();
function _run() {
// HOOKs
// where to hook the features
var ss_hooks = {
'main menu submit': 'header', // by class + insert parent
'main menu submit 2': 'header', // class
'edit pic www': 'ul.pic-info' // right by the image title
};
var tmp;
var _docLocation = window.location.href;
var str_href = _docLocation;
var _on_page_area;
var _on_page;
var _inplace_edit_id;
var widget_main;
var _on_page_ID;
var timeStampCache = new Date();
var _autorun = true;
var _appName = 'SS SiteBoost';
var _update = 'b';
var _version_number = '0.31';
// var _appIcon = '<img src="http://fotostocki.pl/wp-content/uploads/2010/03/siteboo.png" />';
var _appIcon = '<img src="" />';
var _appFullName = _appName + ' ' + _version_number + ' ' + _update;
var _version = '<b>' + _version_number + '</b>';
var _refresh_pixel = '<img id="F5_refresh_pixel" src="https://imagerion.com/plrangjs/_wrk/cnt.html?cache='
+ timeStampCache.getTime() + '" width="1px">';
var _SSusername;
if (getCookie('SSusername'))
_SSusername = getCookie('SSusername');
else
_SSusername = getCookie('username');
var _scriptID = Math.floor(Math.random() * 128);
var _scriptIDcheckInterval = false;
var _referrals_page_built = false;
var _referredUser_tmp_list = false;
var _referredUser_tmp_refIDs = false;
var _referralsForceRefresh = false;
var _referrals_interval_check = false;
var _auto_referrals_check = false;
var _glob_referral_counter = 0;
var _referrals_check_running = 3;
var _referrals_dataSize = 0;
var plr_edit = '';
var plr_continue = false;
/* ---------------------------------------------------------------------------- */
/* AUTO INSERTed block below from: on_page_logic.js */
// ON PAGE LOGIC INSERT
// DETERMINE WHERE WE ARE - the page
// 7 means 'starts right after' http://
if (str_href.search("forums.submit.shutterstock.com") == 8) {
_on_page = 'FORUM';
}
if (str_href.search("submit.shutterstock.com") == 8) {
_on_page_area = 'SUBMITTER';
}
// This area disappeared from the SS site
//if (str_href.search("top50.mhtml") > 0) {
// _on_page = 'TOP50';
//}
if (str_href.search("approved=-1") > 0) {
_on_page = 'REJECTED';
}
if (str_href.search("approved=1") > 0) {
_on_page = 'APPROVED';
}
// if ((str_href.search("home.mhtml") > 0) || (str_href.search("main.mhtml") > 0)) {
if (str_href.search("dashboard") > 0) {
_on_page = 'HOME';
}
if (_tmp_match = _preg_match(_docLocation,
'submit\\.shutterstock\\.com\\/edit_media\\.mhtml\\?id=(\\d+)\\&type=photos')) {
_on_page = 'EDIT_PHOTO';
_inplace_edit_id = _tmp_match[1];
}
_match = _preg_match(_docLocation,
'www.shutterstock.com.*((#photo_id=)|(pic\\.mhtml\\?id=)|(\\/pic-))(\\d+)');
if ((_match) && (_match[5] !== null)) {
//window.plr_stop_go = 1;
_on_page = 'SINGLE_PHOTO';
}
// Video gallery view
// http://www.shutterstock.com/video/gallery/PLRANG-ART-328114/
// Video single view
// http://www.shutterstock.com/video/clip-14543701-stock-footage-holo-sphere-of-red-dots-over-blurry-red-clouds.html
// 2016 07
if (str_href.search("www.shutterstock.com/.*?video/gallery/") > 0) {
_match = _preg_match(_docLocation, '\/video\/gallery\/.*?(\\d+)');
_on_page = 'VIDEO_GALLERY';
_on_page_ID = _match[1];
console.log(' >>>> ' + _on_page + ' ' + _on_page_ID);
}
if (str_href.search("www.shutterstock.com/.*?video/clip-") > 0) {
_match = _preg_match(_docLocation, '\/video\/clip-(\\d+)');
_on_page = 'SINGLE_VIDEO';
_on_page_ID = _match[1];
console.log(' >>>> ' + _on_page + ' ' + _on_page_ID);
}
if ((str_href.search("results.mhtml") > 0)) {
if (!confirm('Need to disable original Image Previews FIRST\n\nOK - disable and CLICK AGAIN THE BOOKMARK (if bookmarklet used) \nCANCEL to abort')) {
}
else
plr_submit_prev_OFF();
}
else
plr_continue = true;
console.log(`_on_page: ${_on_page} plr_continue: ${plr_continue} _on_page_area: ${_on_page_area}`);
/* ---------------------------------------------------------------------------- */
/* AUTO INSERTed block below from: html_templates.js */
// HTML TEMPLATES - INSERT
var _SS_launch_bar = '';
/* '<a href="http://submit.shutterstock.com/main.mhtml" style="font-size:9pt" ><b>Home</b></a> | '; */
if (_SSusername)
_SS_launch_bar += '<a href="http://www.shutterstock.com/g/'
+ _SSusername
+ '" style="font-size:9pt" title="Images Gallery" ><img src="http://submit.shutterstock.com/images/camera_icon.png" style="border:0" align="absmiddle"/></a> | ';
/* _SS_launch_bar += '<div id="F5_launch_forum" style="display:inline"><a href="http://submit.shutterstock.com/forum/" ><b>Forum</b></a></div> | '; */
//_SS_launch_bar += '<a href="http://submit.shutterstock.com/review.mhtml?type=photos" ><b>Images Submitted</b></a> | ';
_SS_launch_bar += '<a href="http://submit.shutterstock.com/" ><b>Home</b></a> | ';
_SS_launch_bar += _refresh_pixel;
var _html_refresh_sel =
' <span id="F5_users_count">??</span> <span id="F5_refresh_mark" style="cursor:pointer" title="Force refresh for TODAY">Refresh</span> <select id="F5_refresh_sel" title="REFRESH TIME in Minutes"> '
+ '<option value="3">3</option>'
+ '<option value="5">5</option>'
+ '<option value="10">10</option>'
+ '<option value="15">15</option>'
+ '<option value="20">20</option>'
+ '<option value="30">30</option>'
+ '<option value="45">45</option>'
+ '<option value="60">60</option>'
+ '<option value="180">180</option>' + '</select>';
var _F5_eff_glow = '-moz-box-shadow: 0 0 6px #d2d2d2; -webkit-box-shadow: 0 0 6px #d2d2d2; box-shadow: 0 0 6px #d2d2d2;';
var _F5_eff_glow_2 = '-moz-box-shadow: 0 0 7px #929292; -webkit-box-shadow: 0 0 7px #929292; box-shadow: 0 0 7px #929292;';
var _F5_eff_corner_small = '-moz-border-radius: 1px; border-radius: 1px; -webkit-border-radius: 1px;';
var _F5_eff_corner = '-moz-border-radius: 2px; border-radius: 2px; -webkit-border-radius: 2px;';
var _html_panel_stats = '<div id="F5_stat_panel" style="'
+ _F5_eff_corner
+ _F5_eff_glow
+ 'display:block;font-size:11pt;padding:8px;font-family:sans-serif;position:absolute;width:80%;height:78%;left:10%;top:40%;background-color:white;border:4px solid #99CA3C;display:block;z-index:4900"> '
+ '<div id="F5_buttons" style="margin-bottom:6px"><input id="F5btn_stats" class="F5btn_standard" type="button" value="Live Stats" /> '
+ '<input type="button" id="F5btn_totalStats" class="F5btn_standard" value="Total stats" /> '
+ '<input id="F5btn_referrals" class="F5btn_standard" value="Referrals" type="button" /> '
+ '</div>'
+ '<div style="width:50%;text-align:right;position:absolute;top:8px;right:8px">'
+ _html_refresh_sel
+ ' | <input id="F5stat_cancel" class="F5btn_standard" value="Close" type="button" /></div>'
+ ' <div id="F5_stat_panel_title"><span style="color:#669D30;">StatSS for</span>'
+ ' <span id="F5_put_date" style="color:#447D20;font-weight:bold">---date---</span>'
+ '<span id="F5_put_DLs" style="color:#224D10;margin-left:10px">---DLs---</span>'
+ '<span id="F5_put_cash" style="color:#224D10;margin-left:8px">---$---</span> '
+ '<span id="F5_put_monthly" style="color:#224D10;margin-left:8px">---$---</span> '
+ '<span id="F5_put_GROSS" style="color:#224D10;margin-left:8px">---$---</span>'
+ '</div> '
+ '<div id="F5stat_work" style="visibility:hidden"> </div>'
+ '<div id="F5stat_status" style="clear:both;overflow:auto;height:42%;margin:6px;margin-top:4px"></div>'
+ '<div id="F5stat_status_referrals" style="clear:both;overflow:hidden;height:42%;margin:6px;margin-top:4px;display:none">'
+ '<div id="F5stat_status_referrals_menu" style="width:100%;display:block;margin-bottom:2px;overflow:hidden">'
+ '<input type="button" value="Run check" id="F5btn_referrals_chk_gal" class="F5btn_standard" />'
+ '<input type="button" value="c" id="F5btn_referrals_clear_localS" class="F5btn_standard" style="float:right" title="Better don`t clear the cached results - otherwise You`ll need run the check again" />'
+ '</div>'
+ '<div id="F5stat_status_referrals_panel" style="overflow:auto;height:85%"></div>'
+ '</div>'
+ '<div id="F5stat_totals" style="background:white;height:42%;display:none;overflow:auto;margin:6px;margin-top:4px">'
+ '<div id="F5stat_totals_title" style="word-spacing:2pt;margin-bottom:6px;margin-top:6px;font-weight:bold;font-family:sans-serif;font-size:13pt;color:#669D30">Total stats <input type="checkbox" id="F5btn_autoIADB_check" value="autoIADB_check" title="ON / OFF"/> enabled <a class="F5btn_standard" href="#" style="font-weight:normal;color:black;padding:4px" id="F5btn_DBGtotalStats" ><b>VIEW Log</b> on/off</a> '
+ ' <a href="#" class="F5btn_standard" style="font-weight:normal;padding:4px" id="F5btn_DBGtotalStats_clear_localS" >CLEAR ALL to default</a>'
+ '</div>'
+ '<div id="F5stat_totals_status" style="margin-bottom:6px;font-family:sans-serif;font-size:10pt;height:1.3em">Please wait...</div>'
+ '<div id="F5stat_totals_place" style="width:90%"><img src="http://submit.shutterstock.com/images/edit.png" /></div>'
+ '<div id="F5stat_totals_dbg" style="'
+ _F5_eff_corner
+ _F5_eff_glow
+ 'padding:6px;overflow:auto;position:absolute;top:10%;right:1%;border:2px solid #aaccaa;width:47%;background:#fefefe;height:21%"><b>Stats SPIDER</b> log - be patient..<br /><br /> For faster results - YOU CAN leave this SS page open to collect STATS - and use another page to browse<br /> </div>'
+ '</div>'
+ '<div id="F5_app_status" > » <span id="F5_app_status_txt"></span> | CTRL: <span id="F5_LSdbg"> </span></div>'
+ '<div id="F5stat_stat_data" style="clear:both;overflow:auto;height:41%;margin:10px;margin-top:0px;margin-bottom:0px"><img src="http://footage.shutterstock.com/images/loading_icon_2.gif" /></div>'
+ '<div style="margin:auto;clear:both;position:absolute;text-align:center;color:#638f10;bottom:0px;width:98%;height:12pt;"> ^ Click a ROW to Switch a DAY ^</div>'
+ '</div>'
+ '<div id="F5stat_thumbs_direct_edit" style="'
+ _F5_eff_corner
+ 'position:absolute;left:7%;top:10%;width:86%;height:84%;border:1px solid #dcf0b5;background:#f7fceb;z-index:120;display:none;border:2px solid #99CA3C;padding:8px;overflow:auto">'
+ '<div id="F5_thumb_panel_title"><div style="margin-bottom:6px;font-weight:bold;font-family:sans-serif;font-size:11pt;color:#669D30">Edit photo data '
+ '<input id="F5stat_editor_cancel" class="F5btn_standard" value="Close" type="button" style="float:right" /></div>'
+ '</div>'
+ '<div id="F5stat_editor_place" style="float:left;width:auto;height:290px;overflow:auto;font-family:sans-serif"><img src="http://footage.shutterstock.com/images/loading_icon_2.gif" /></div>'
+ '<div id="F5stat_editor_IADB_place" style="float:left;width:52%;padding:4px"><img src="http://footage.shutterstock.com/images/loading_icon_2.gif" /></div>'
+ '<div id="F5stat_editor_form_place" style="clear:both"><img src="http://footage.shutterstock.com/images/loading_icon_2.gif" /></div>'
+ '</div>'
+ '<div id="F5img_alt" style="'
+ _F5_eff_corner
+ _F5_eff_glow_2
+ 'display:none;cursor:pointer;position:absolute;top:3px;left:4px;font-weight:bold;font-size:8pt;color:#eeffee;z-index:9000;background:#002211;width:400px;filter:alpha(opacity=90);opacity:.90;padding:7px;border:8px solid #99CA3C;font-family:sans-serif"> </div>';
var _html_stat_table_head = '<tr id="tTitles"><td id="tDaySel">Go to Day</td>' +
'<td id="tALL">Total DLs</td>' +
'<td id="t25">Subs</td>' +
'<td id="tOD">OD</td>' +
'<td id="tED">ED</td>' +
'<td id="tSOD">SOD</td>' +
'<td id="tREF">ref</td>' +
'<td id="tREFSUB">ref Sub</td>' +
'<td id="tREFFOOT">ref Ft</td>' +
'<td id="tFTCartS">Ft CartS</td>' +
'<td id="tFTClipP">Ft ClipP</td>' +
'<td id="tDAY">Daily</td></tr>';
var _stat_table_titles = new Array();
_stat_table_titles['tDaySel'] = "Select a day below";
_stat_table_titles['tALL'] = "Total daily downloads";
_stat_table_titles['t25'] = "Subscriptions";
_stat_table_titles['tOD'] = "On Demand Downloads";
_stat_table_titles['tED'] = "Enhanced License Downloads";
_stat_table_titles['tSOD'] = "SOD";
_stat_table_titles['tREF'] = "Referred Downloads";
_stat_table_titles['tREFSUB'] = "Referred Subscriptions";
_stat_table_titles['tREFFOOT'] = "Referred Footage";
_stat_table_titles['tFTCartS'] = "Footage Cart Sales";
_stat_table_titles['tFTClipP'] = "Footage Clip Packs";
//_stat_table_titles['tREFFT'] = "Referred Footage";
_stat_table_titles['tDAY'] = "Daily Total";
// DYNAMIC PREVIEW TEMPLATE
_html_ipreview = '<div id="plr_ipreview" style="'
+ _F5_eff_glow_2
+ _F5_eff_corner
+ 'padding:8px;top:10px;left:10px;position:absolute;display:block;width:360px;background:#494A4a;z-index:115000">'
+ '<div id="plr_img_title" style="letter-spacing:0.08em;word-spacing:0.1pt"></div>'
+ '<div id="plr_img_container"><img id="plr_ipreview_img" src="" style="margin:0px;width:350px"></div> '
+ '<div id="imgArchData" style="font-size:8pt;font-family:sans-serif;color: #f7fceb;margin:2px;margin-bottom:0px;width:99%"></div></div>';
console.log('querySelector( footer');
var htElem = document.querySelector('footer');
htElem.insertAdjacentHTML('beforeend',_html_ipreview);
var _imgADB = {};
var _imgADBcurrPage = 1;
var _imgADBnumPages = 0;
var _imgADBcurrChapter = 0;
var _imgADBchapters = ['25_a_day', 'on_demand', 'enhanced', 'single_image_and_other']; // Which data sets (www pages) to process
var _IADBmode;
var _stat_IADBauto_refresh_int = false;
var _stat_IADBauto_refresh_time = false;
var _stat_IADBauto_refresh_continue = 0.3; // default 0.3 - fast enough 0.05
var _stat_IADBauto_refresh_DayWait = 0.05; // time between page scans default 0.05 = 3 min - fast enough 0.003
var SS_DB_dailyDone = 12 * 60;
var _switch_prev_panel = false;
// Setting up the Local Storage
var localStor_OK = false;
if (!(_IADBmode = getCookie('SSscr_IADBmode')) || _IADBmode == 'auto') {
_IADBmode = 'auto';
} else
_IADBmode = getCookie('SSscr_IADBmode');
if (localStorage) {
if (debug_console)
console.log('Localstorage OK');
var localStor_OK = true;
if (localStorage['_imgADB'])
_imgADB = JSON.parse(localStorage.getItem('_imgADB'));
if (localStorage['_imgADBcurrPage'])
_imgADBcurrPage = parseInt(localStorage['_imgADBcurrPage']);
if (localStorage['_imgADBnumPages'])
_imgADBnumPages = parseInt(localStorage['_imgADBnumPages']);
if (localStorage['_imgADBcurrChapter'])
_imgADBcurrChapter = localStorage['_imgADBcurrChapter'];
}
/*
_imgADBcurrPage = 1;
_imgADBnumPages = 0;
_imgADBcurrChapter = 1;
_IADBmode = 'auto';
*/
function _getSSInitialData() {
console.log('inside of _getSSInitialData');
// $('#F5_LSdbg').hide().html('Getting initial data...').fadeIn('slow');
addHTML({selector: '#F5_LSdbg', position: 'beforeend', content: 'Getting initial data...'});
// Is there a Cookie with the images count in portfolio?
console.log('if (!getCookie(SSimgsInGall...');
if (!getCookie('SSimgsInGall')) {
// $('#F5_LSdbg').hide().append(' no data.. > setting').fadeIn('slow');
addHTML({selector: '#F5_LSdbg', position: 'beforeend', content: ' no data.. > setting'});
if (debug_console)
console.log('$.get(https://submit.');
/*
$.get('https://submit.shutterstock.com/review.mhtml?approved=1&type=photos',
function (data) {
_new_content = data.replace(/[\n\r\t]/g, '');
myRGXP = new RegExp('View\\s+All\\s+(\\d*)\\s+Approved\\s+Photos', 'gi');
_match = myRGXP.exec(_new_content);
if (_match && _match[1]) {
// Set a Cookie with the images count in portfolio
putCookie('SSimgsInGall', _match[1], 60 * 1);
}
}
);
*/
} else // Cookie found
{
// $('#F5_LSdbg').hide().append(' ok.. ').fadeIn('slow');
addHTML({selector: '#F5_LSdbg', position: 'beforeend', content: ' ok.. '});
if (debug_console)
console.log('Cookie found');
}
if (debug_console)
console.log('Leaving _getSSInitialData');
}
function plr_submit_prev_ON() {
/*
var _match = /\(\'(.*)\'\)/i.exec($("#results-mode-form").attr('action'));
var plr_2 = _match[1];
window.location.href = '/change_results_mode.mhtml?results_mode=dynamic&' + plr_2;
*/
};
function plr_submit_prev_OFF() {
var plr_string = window.location.hash;
var repl = /[#]/gi;
var plr_2 = plr_string.replace(repl, '');
window.location.href = '/change_results_mode.mhtml?results_mode=legacy&' + plr_2;
if (debug_console)
console.log('F: plr_submit_prev_OFF');
};
// MAIN PART of the SSS launch panel widget
// Do not display STATS button on certain pages
// like: subdomains different than [submit.]
if (debug_console)
console.log('Matching page URLs');
widget_main =
' <a href="https://plrang.com/blog/tag/ss-siteboost/" title="Info and Manual" target="_blank" style="font-size:9pt;font-weight:normal\" >SS SiteBoost</a> '
+ '<a href=\"http://rang.pl/artykuly/shutterstock-site-patch-update/#update-'
+ _version_number
+ '" title="UPDATE INFO" target="_blank" style="font-size:9pt">'
+ _version + _update + '</a> :: ';
// STATS button - F5stat_start
if (_on_page_area == 'SUBMITTER') {
console.log('_on_page_area = SUBMITTER / widget_main');
widget_main = _SS_launch_bar
+ '<input type="button" id="F5stat_start" class="F5btn_standard" value="Stats" /> '
+ widget_main
+ _refresh_pixel;
}
else {
widget_main = _SS_launch_bar
+ '<span style="color:red !important;font-size:12pt">Live Stats available only in <a href="http://submit.shutterstock.com" style="color:red !important;font-size:12pt !important">submit.shutterstock.com</a> area</span> | '
+ widget_main;
// 2016 _on_page = 'GALLERY';
}
window.plr_stop_go = -1;
var _get_alt_txt_prv = ''; //- moved to mouse.js
/* ---------------------------------------------------------------------------- */
/* AUTO INSERTed block below from: video_area.js */
/****************************************************************************/
/* VIDEO - FOOTAGE RELATED LOGIC INSERT */
// 2016 07
// ****************************************************
// FOOTAGE page? Direct edit options only at the moment
// footage. subdomain disappeared?
// http://footage.shutterstock.com/clip-xxx-stock-footage
// changed to
// http://www.shutterstock.com/video/clip-xxx-stock-footage.html
// Video gallery view
// http://www.shutterstock.com/video/gallery/PLRANG-ART-328114/
// Video single view
// http://www.shutterstock.com/video/clip-14543701-stock-footage-holo-sphere-of-red-dots-over-blurry-red-clouds.html
// var _match = /footage\.shutt.*\/clip-(\d+)-.*\.html/i.exec(_docLocation);
if (_on_page == 'SINGLE_VIDEO') {
window.plr_stop_go = 1;
//window.location.href = 'http://submit.shutterstock.com/edit_media.mhtml?id=' + _match[1] + '&type=footage';
// Auto jump to clip edit - TEMP disabled / 2016 07
// window.location.href = 'http://submit.shutterstock.com/edit_media.mhtml?id=' + _on_page_ID + '&type=footage';
console.log('>>> REDIRECTION - TEMP disabled');
}
// 2016 07 - logic moved to main page recognition block
// _match = /footage\.shutt.*((\?submitter_name=)|(\?submitter_id=)|(\/gallery-))([a-zA-Z0-9]+)[^&\.]*/i.exec(_docLocation);
// WWW HOOKS are totally changed, they need to be redefined
// this code doesn't fire right now 2016 07
if (_on_page == 'VIDEO_GALLERY') {
plr_go_footage = function () {
$('div.content-container')
.prepend(
'<div id="plr_status" style="'
+ _F5_eff_corner
+ 'color:black;background:#fBF4f8;float:right;font-size:9pt;padding:8px;clear:both;margin-bottom:20px;margin-top:8px">'
+ widget_main
+ ' <span style="font-weight:normal;color:red"> Edit enabled</span> :: footage</div>');
$('.video-float-container')
.each(
function (index) {
_tmp_txt = $(this).find('.video-caption').find('a:first').attr('href');
_match = /\/clip-\d+-(.*)\.html/i.exec(_tmp_txt);
_tmp_txt = _match[1];
$(this)
.find('.clip-thumbnail')
.after(
'<div class="clssplr_footage_title" style=" filter:alpha(opacity=70); opacity:.70; margin:3px;width:156px;position:absolute;top:0;left:0;z-index:10;background:black;color:#fDFfa9;font-size:8pt"><div style="margin:10px">'
+ _tmp_txt.replace(/-/g, ' ') + '</div></div>');
_match = /download_options\.html\?id=(\d+)/i.exec($(this)
.find('a.thumb-option').attr('href'));
if (_match && (_match[1] != null)) {
plr_edit = "javascript: window.location.href='http://submit.shutterstock.com/edit_media.mhtml?id="
+ _match[1] + "&type=footage'";
$(this)
.find('.thumb-option-table')
.prepend(
'<tr><td colspan=\"2\" class=\"thumb-option-cell\"><div><img src=\"http://submit.shutterstock.com/images/edit.png\" class=\"clssplr_edit\" onclick=\"'
+ plr_edit
+ '\" title=\"Edit '
+ _match[1]
+ ' \"></div></td></tr>');
}
;
});
$('.clssplr_footage_title').hide();
$('.video-thumb-container').mouseover(function () {
$(this).find('.clssplr_footage_title').show();
});
$('.video-thumb-container').mouseout(function () {
$(this).find('.clssplr_footage_title').hide();
});
$('.clssplr_edit').css({
'border': '0px',
'cursor': 'pointer',
'margin': '3px 3px 16px 3px'
});
$('a.page-number').css({
'font-size': '10pt',
'font-weight': 'bold'
});
}
plr_go_footage();
}
if (debug_console)
console.log('AUTO INSERTed block... single photo...');
/* ---------------------------------------------------------------------------- */
/* AUTO INSERTed block below from: photo_single_area.js */
/****************************************************************************************/
// SINGLE PHOTO at WWW. - INSERT
// add the Edit option button
_match = _preg_match(_docLocation, 'www.shutterstock.com.*((#photo_id=)|(pic\\.mhtml\\?id=)|(\\/pic-))(\\d+)');
if (_on_page == 'SINGLE_PHOTO') {
window.plr_stop_go = 1;
if (!_autorun)
window.location.href = 'http://submit.shutterstock.com/edit_media.mhtml?id=' + _match[5] + '&type=photos';
else {
plr_edit = "javascript: window.location.href='http://submit.shutterstock.com/edit_media.mhtml?id=" + _match[5] + "&type=photos';return false";
$(ss_hooks['edit pic www'])
.prepend('<div style="font-size:10pt;font-weight:bold;margin-bottom:16px;border:1px dashed green;padding:4px"><a href="" onclick="'
+ plr_edit
+ '"><img src=\"http://submit.shutterstock.com/images/edit.png\" class=\"clssplr_edit\" title=\"Edit '
+ _match[5] + '\"> Edit</a></div>');
$('.clssplr_edit').css({
'border': '0px',
'cursor': 'pointer',
'margin': '3px',
'vertical-align': 'middle'
});
}
}
if (debug_console)
console.log('_getSSInitialData');
_getSSInitialData();