Blog2Social: Social Media Auto Post & Scheduler - Version 6.2.0

Version Description

Usability Optimization, Snip.ly integration, Re-poster

Download this release

Release Info

Developer PR-Gateway
Plugin Icon 128x128 Blog2Social: Social Media Auto Post & Scheduler
Version 6.2.0
Comparing to
See all releases

Code changes from version 6.1.2 to 6.2.0

Files changed (47) hide show
  1. assets/css/b2s/autopost.css +89 -0
  2. assets/css/b2s/calendar.css +26 -0
  3. assets/css/b2s/repost.css +559 -0
  4. assets/css/b2s/settings.css +5 -0
  5. assets/css/general.css +10 -5
  6. assets/images/settings/sniply.png +0 -0
  7. assets/js/b2s/autopost.js +209 -0
  8. assets/js/b2s/calendar.js +32 -5
  9. assets/js/b2s/curation.js +6 -6
  10. assets/js/b2s/repost.js +752 -0
  11. assets/js/b2s/settings.js +6 -249
  12. assets/js/b2s/ship.js +14 -11
  13. assets/lib/fullcalendar/fullcalendar.min.css +1 -1
  14. blog2social.php +2 -2
  15. includes/Ajax/Get.php +2 -2
  16. includes/Ajax/Post.php +263 -79
  17. includes/B2S/Api/Network/Pinterest.php +2 -2
  18. includes/B2S/AutoPost.php +2 -1
  19. includes/B2S/AutoPost/Item.php +251 -0
  20. includes/B2S/Calendar/Filter.php +4 -0
  21. includes/B2S/Calendar/Item.php +23 -1
  22. includes/B2S/Network/Item.php +2 -7
  23. includes/B2S/Post/Filter.php +6 -3
  24. includes/B2S/Post/Item.php +117 -29
  25. includes/B2S/Post/Tools.php +1 -0
  26. includes/B2S/RePost/Item.php +251 -0
  27. includes/B2S/RePost/Save.php +397 -0
  28. includes/B2S/Settings/Item.php +10 -235
  29. includes/B2S/Ship/Item.php +9 -8
  30. includes/B2S/Ship/Save.php +1 -1
  31. includes/B2S/Support/Check/System.php +7 -5
  32. includes/Loader.php +102 -70
  33. includes/System.php +2 -48
  34. includes/Tools.php +43 -1
  35. languages/blog2social-de_DE.mo +0 -0
  36. languages/blog2social-de_DE.po +1449 -2570
  37. languages/blog2social.pot +1137 -1691
  38. readme.txt +16 -7
  39. views/b2s/autopost.php +80 -0
  40. views/b2s/dashboard.php +0 -1
  41. views/b2s/html/footer.php +40 -0
  42. views/b2s/html/header.php +12 -7
  43. views/b2s/html/post.navbar.php +2 -1
  44. views/b2s/html/sidebar.php +7 -1
  45. views/b2s/network.php +3 -0
  46. views/b2s/repost.php +174 -0
  47. views/b2s/settings.php +1 -24
assets/css/b2s/autopost.css ADDED
@@ -0,0 +1,89 @@
1
+ /*Custom*/
2
+ .error{
3
+ border: 1px solid #FF0000 !important;
4
+ }
5
+
6
+ .b2s-auto-post-publish-label, .b2s-auto-post-update-label{
7
+ font-style:italic;
8
+ }
9
+
10
+ .b2s-post-type-list{
11
+ float: left;
12
+ margin-bottom: 5px;
13
+ width: 50%;
14
+ }
15
+
16
+ .b2s-post-type-select-btn{
17
+ padding: 0 0 1px !important;
18
+ }
19
+
20
+ .b2s-network-auth-count {
21
+ font-size: 12px;
22
+ font-style: italic;
23
+ color: #777;
24
+ font-weight: normal;
25
+ line-height: 1;
26
+ }
27
+
28
+ .list-group-item{
29
+ border: 0px !important;
30
+ }
31
+
32
+ .b2s-img-network {
33
+ width: 36px !important;
34
+ margin-top: 8px !important;
35
+ }
36
+
37
+ .b2s-input-text-size-45{
38
+ width: 45px;
39
+ }
40
+
41
+ .chosen-container{
42
+ min-width: 50% !important;
43
+ }
44
+
45
+ .padding-bottom-3{
46
+ padding-bottom: 3px;
47
+ }
48
+
49
+ .b2s-bold{
50
+ font-weight: 600;
51
+ }
52
+
53
+ ul.chosen-choices {
54
+ background-image: none !important;
55
+ border-radius: 3px;
56
+ border: 1px solid #d7d7d7 !important;
57
+ box-shadow: none;
58
+ }
59
+
60
+ .b2s-auto-post-own-update-warning, .b2s-auto-post-own-general-warning{
61
+ border: 1px solid #aaa !important;
62
+ }
63
+
64
+ .b2s-network-tos-auto-post-import-warning{
65
+ display: none;
66
+ }
67
+
68
+ .b2s-network-tos-auto-post-import-warning > .alert{
69
+ margin-bottom: 0px !important;
70
+ }
71
+
72
+ #b2s-auto-post-profil-dropdown-twitter option:disabled {
73
+ color: #ff4f68;
74
+ }
75
+
76
+ .b2s-w-100 {
77
+ width: 100%;
78
+ padding: 0px;
79
+ }
80
+
81
+ .b2s-auto-post-header {
82
+ display: inline-block;
83
+ margin-right: 5px;
84
+ }
85
+
86
+ /*prevent themes to overwrite line-height, causing the words to shift to the top*/
87
+ .toggle-off, .toggle-on {
88
+ line-height: 1.2em !important;
89
+ }
assets/css/b2s/calendar.css CHANGED
@@ -345,4 +345,30 @@ body .fc-day-grid-event .fc-content{
345
.emoji-picker__tab.active {
346
color: #79b333;
347
border-bottom: 3px solid #79b333;
348
}
345
.emoji-picker__tab.active {
346
color: #79b333;
347
border-bottom: 3px solid #79b333;
348
+ }
349
+
350
+ .fc-basicWeek-view .fc-day-header{
351
+ text-align: inherit !important;
352
+ }
353
+
354
+ .b2s-calendar-sched-new-post-btn{
355
+ font-size: 11px;
356
+ font-weight: 400;
357
+ }
358
+
359
+ .fc-basicWeek-view .b2s-calendar-sched-new-post-btn{
360
+ float: right;
361
+ }
362
+
363
+ .fc-basicWeek-view .fc-day-header{
364
+ padding: 2px 4px;
365
+ }
366
+
367
+ .fc-month-view .b2s-calendar-sched-new-post-btn{
368
+ padding: 1px 4px;
369
+ position: absolute;
370
+ }
371
+
372
+ .b2sFavoriteStar {
373
+ display: none !important;
374
}
assets/css/b2s/repost.css ADDED
@@ -0,0 +1,559 @@
1
+ .chosen-container {
2
+ width: 100% !important;
3
+ margin-top: 2px;
4
+ margin-bottom: 12px;
5
+ }
6
+
7
+ .b2s-bold{
8
+ font-weight: 600;
9
+ }
10
+
11
+ .b2s-w-100 {
12
+ width: 100%;
13
+ }
14
+
15
+ .b2s-mt-10 {
16
+ margin-top: 10px;
17
+ }
18
+
19
+ .b2s-ml-22 {
20
+ margin-left: 22px !important;
21
+ }
22
+
23
+ .b2s-pb-10 {
24
+ padding-bottom: 10px;
25
+ }
26
+
27
+ .b2s-re-post-h3 {
28
+ margin-top: 0px;
29
+ margin-bottom: 15px;
30
+ }
31
+
32
+ .b2s-re-post-input-time {
33
+ height: 30px !important;
34
+ }
35
+
36
+ .b2s-icon-size {
37
+ margin-top: 1px;
38
+ font-size: 16px;
39
+ }
40
+
41
+ .b2s-re-post-number-input {
42
+ width: 55px;
43
+ }
44
+
45
+ .b2s-re-post-input-time {
46
+ width: 85px !important;
47
+ display: inline-block !important;
48
+ }
49
+
50
+ .b2s-re-post-weekday-label {
51
+ margin-right: 10px;
52
+ }
53
+
54
+ .b2s-re-post-share-option {
55
+ margin-top: 0px !important;
56
+ }
57
+
58
+ .b2s-re-post-settings-option {
59
+ margin-bottom: 5px !important;
60
+ }
61
+
62
+ .b2s-re-post-state {
63
+ margin: 0px 5px !important;
64
+ }
65
+
66
+ .b2s-re-post-settings-area input[type="checkbox"] {
67
+ margin: 0px;
68
+ }
69
+
70
+ .checkbox-item {
71
+ margin-top: 10px !important;
72
+ margin-right: 10px !important;
73
+ }
74
+
75
+ .b2s-re-post-settings-toggle {
76
+ float: right;
77
+ cursor: pointer;
78
+ }
79
+
80
+ .b2s-re-post-settings-header, .b2s-re-post-settings-area, .b2s-re-post-queue-header {
81
+ border: 1px solid lightgray;
82
+ padding: 10px;
83
+ }
84
+
85
+ .b2s-re-post-settings-header {
86
+ background-color: #f5f5f5;
87
+ cursor: pointer;
88
+ }
89
+
90
+ .b2s-re-post-queue-header {
91
+ margin-top: 20px;
92
+ }
93
+
94
+ .b2s-re-post-queue-header, .b2s-re-post-settings-header {
95
+ border-top-left-radius: 4px;
96
+ border-top-right-radius: 4px;
97
+ }
98
+
99
+ .b2s-re-post-settings-area {
100
+ border-bottom-left-radius: 4px;
101
+ border-bottom-right-radius: 4px;
102
+ background-color: #f5f5f5;
103
+ }
104
+
105
+ .b2s-re-post-limit {
106
+ width: auto;
107
+ height: 30px;
108
+ min-height: 30px;
109
+ display: inline-block;
110
+ }
111
+
112
+ .b2s-re-post-submit-btn, .b2s-re-post-submit-premium {
113
+ margin-top: 44px;
114
+ }
115
+
116
+ .b2s-re-post-queue-delete-area {
117
+ padding: 10px 0px;
118
+ border-left: 1px solid lightgray;
119
+ border-right: 1px solid lightgray;
120
+ }
121
+
122
+ .list-group-item:first-child {
123
+ border-top-left-radius: 0px !important;
124
+ border-top-right-radius: 0px !important;
125
+ }
126
+
127
+ .b2s-post-sched-area .list-group-item:first-child {
128
+ border-top-left-radius: 4px !important;
129
+ border-top-right-radius: 4px !important;
130
+ }
131
+
132
+ .b2s-post-sched-area .checkbox-item {
133
+ margin: 25px 5px 0 !important;
134
+ }
135
+
136
+ .checkbox-all-label-btn {
137
+ padding-left: 0px !important;
138
+ }
139
+
140
+ .b2s-re-post-settings-area {
141
+ border-top: none;
142
+ }
143
+
144
+ .b2s-re-post-queue-area {
145
+ display: inline-block;
146
+ }
147
+
148
+ .b2s-re-post-headline {
149
+ font-size: 18px;
150
+ }
151
+
152
+ .b2s-re-post-date-start, .b2s-re-post-date-end {
153
+ margin-top: 2px;
154
+ margin-bottom: 12px;
155
+ height: 30px !important;
156
+ padding-left: 5px !important;
157
+ border: 1px solid #aaa !important;
158
+ }
159
+
160
+ .b2s-re-post-date-start:disabled, .b2s-re-post-date-end:disabled {
161
+ opacity: 0.5 !important;
162
+ }
163
+
164
+ .b2s-re-post-share-option-area {
165
+ display: inline-table;
166
+ margin-left: 4px;
167
+ }
168
+
169
+ .b2s-mt-12 {
170
+ margin-top: 12px;
171
+ }
172
+
173
+ .b2s-re-post-weekday-select {
174
+ margin-top: -2px;
175
+ margin-left: 5px;
176
+ }
177
+
178
+ .chosen-choices {/*form-control*/
179
+ display: block;
180
+ width: 100%;
181
+ height: 30px !important;
182
+ padding: 0px 12px;
183
+ font-size: 14px;
184
+ line-height: 1.42857143;
185
+ color: #555;
186
+ background-color: #fff;
187
+ background-image: none;
188
+ border: 1px solid #ccc;
189
+ border-radius: 4px;
190
+ -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
191
+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
192
+ -webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;
193
+ -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
194
+ transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
195
+ }
196
+
197
+ .chosen-search-input:disabled {
198
+ background-color: #eee !important;
199
+ cursor: not-allowed;
200
+ }
201
+
202
+ .chosen-container-multi .chosen-choices li.search-field input[type="text"] {
203
+ margin: -1px 0px !important;
204
+ }
205
+
206
+ .chosen-container-multi .chosen-choices {
207
+ background-image: none !important;
208
+ }
209
+
210
+ .chosen-disabled .chosen-choices {
211
+ background-color: #eee !important;
212
+ }
213
+
214
+ #b2s-re-post-profil-dropdown-twitter option:disabled {
215
+ color: #ff4f68;
216
+ }
217
+
218
+ /*Custom*/
219
+ .b2s-sched-btn {
220
+ margin-top: 0px;
221
+ }
222
+ .media {
223
+ width: 100%;
224
+ }
225
+ .form-inline {
226
+ width: 100%;
227
+ margin-bottom: 20px;
228
+ }
229
+ .form-inline .form-group {
230
+ margin-left: 2px;
231
+ }
232
+ .media-head {
233
+ width: 100% !important;
234
+ }
235
+ @media(max-width: 549px) {
236
+ .b2s-post-btn {
237
+ width: 100%;
238
+ }
239
+ .form-inline button, .form-inline a {
240
+ width: 100%;
241
+ margin-bottom: 10px;
242
+ }
243
+ }
244
+ @media(max-width: 767px) {
245
+ .form-inline {
246
+ display: none;
247
+ }
248
+ .filterHide {
249
+ display: none;
250
+ }
251
+ .form-inline button ,.form-inline a {
252
+ width: 49%;
253
+ margin-bottom: 10px;
254
+ }
255
+ }
256
+
257
+ .datepicker table tr td.event {
258
+ background-color: #ffdb99;
259
+ border-color: #ffb733;
260
+ color: #000;
261
+ }
262
+ .datepicker table tr td.today {
263
+ background-color: #fff !important;
264
+ border-color: #fff !important;
265
+ color: #000;
266
+ font-weight: 700;
267
+ font-size: 15px;
268
+ }
269
+ .datepicker table tr td.active {
270
+ background-color: #337ab7 !important;
271
+ border-color: #2e6da4 !important;
272
+ color: #fff;
273
+ }
274
+ .datepicker-inline{
275
+ width: 100% !important;
276
+ }
277
+ .table-condensed{
278
+ width: 100%;
279
+ }
280
+ #b2s-sched-datepicker-area{
281
+ background-color: #fff;
282
+ border: 1px solid #ddd;
283
+ border-radius: 4px;
284
+ padding: 10px 15px;
285
+ margin-top: 10px;
286
+ }
287
+ .datepicker-switch, .prev, .next{
288
+ background: #eee no-repeat;
289
+ border-radius: 0px !important;
290
+ }
291
+ .prev, .next{
292
+ font-size: 24px;
293
+ }
294
+
295
+ .b2s-calendar-legend-active{
296
+ color: #337ab7 ;
297
+ border-color: #2e6da4;
298
+ border-radius: 4px;
299
+ }
300
+ .b2s-calendar-legend-event{
301
+ color: #ffdb99;
302
+ border-color: #ffb733;
303
+ border-radius: 4px;
304
+ }
305
+ .b2s-loading-area{
306
+ width: 100% !important;
307
+ }
308
+ .checbox-item-empty{
309
+ padding: 15px;
310
+ float:left;
311
+ }
312
+
313
+
314
+
315
+ /**edit post **/
316
+ .network-name{
317
+ font-weight: bold;
318
+ }
319
+ .network-profile{
320
+ margin-bottom: 5px;
321
+ }
322
+ .b2s-post-item-thumb {
323
+ width: 5%;
324
+ margin-right: 8px;
325
+ }
326
+
327
+ .b2s-post-item-thumb img {
328
+ border-radius: 50%;
329
+ width: 48px;
330
+ }
331
+
332
+ .b2s-post-item-details {
333
+ width: 93%;
334
+ }
335
+
336
+ .b2s-post-item-details, .b2s-post-item-thumb {
337
+ float: left;
338
+ }
339
+ .b2s-post-item-details h4 {
340
+ font-size: 16px;
341
+ font-weight: 600;
342
+ text-transform: uppercase;
343
+ margin: 3px 3px 3px 0px;
344
+ }
345
+ .b2s-post-item-network-deprecated {
346
+ font-weight: 600;
347
+ font-size: 14px;
348
+ margin: 3px 3px 3px 0px;
349
+ }
350
+
351
+ .btn-circle {
352
+ width: 30px;
353
+ height: 30px;
354
+ text-align: center;
355
+ padding: 6px 0;
356
+ font-size: 12px;
357
+ line-height: 1.428571429;
358
+ border-radius: 15px;
359
+ }
360
+ .fb-url-image, .xing-url-image, .linkedin-url-image, .reddit-url-image, .tw-url-image, .b2s-image-border {
361
+ margin-right: 10px;
362
+ margin-bottom: 20px;
363
+ border: 1px dashed #bdbfc2;
364
+ box-shadow: none;
365
+ padding: 5px;
366
+ }
367
+ textarea.form-control {
368
+ height: auto;
369
+ }
370
+ .fb-textarea-input, .tw-textarea-input, .xing-textarea-input, .reddit-textarea-input, .linkedin-textarea-input, .b2s-post-item-details-item-message-input {
371
+ font-size: 14px;
372
+ font-weight: normal;
373
+ line-height: 1.125;
374
+ width: 100%;
375
+ border: medium none;
376
+ border-radius: 0;
377
+ margin-bottom: 10px;
378
+ font-family: helvetica,arial,sans-serif;
379
+ }
380
+ .b2s-post-item-details-item-message-input{
381
+ min-height: 100px;
382
+ }
383
+ .b2s-post-item-details-url-image{
384
+ cursor: pointer;
385
+ }
386
+ .b2s-user-network-settings-post-format-area label > input {
387
+ visibility: hidden;
388
+ position: absolute;
389
+ }
390
+ .b2s-settings-checked + img {
391
+ border: 3px solid #79b232 !important;
392
+ }
393
+ .b2s-image-item {
394
+ background-color: #fff;
395
+ border: 1px solid #ddd;
396
+ display: block;
397
+ float: left;
398
+ height: 200px;
399
+ line-height: 1.42857;
400
+ margin-bottom: 15px;
401
+ margin-left: 15px;
402
+ margin-top: 15px;
403
+ overflow: hidden;
404
+ padding: 4px;
405
+ transition: border 0.2s ease-in-out 0s;
406
+ width: 185px;
407
+ }
408
+ .b2s-image-item-thumb {
409
+ height: 150px;
410
+ }
411
+ .b2s-image-change-all-network,.b2s-upload-image-free-version,.b2s-image-change-this-network, .b2s-image-change-meta-network{
412
+ margin-right: 5px !important;
413
+ }
414
+ .b2s-image-remove-btn {
415
+ position: absolute;
416
+ top: -5px;
417
+ right: 0px;
418
+ font-weight: 700 !important;
419
+ }
420
+ .b2s-calendar-delete{
421
+ cursor: pointer;
422
+ }
423
+ .b2s-btn-label-premium{
424
+ color: #fff;
425
+ text-decoration: none !important;
426
+ cursor: default !important;
427
+ }
428
+ .b2s-btn-label-premium:hover{
429
+ color: #fff;
430
+ text-decoration: none !important;
431
+ cursor: default !important;
432
+ }
433
+ .b2s-post-item .label-success{
434
+ display: none;
435
+ }
436
+ .og_title, .og_desc, .card_desc, .card_title, .b2s-post-item-details-item-title-input, .b2s-select, .b2s-select-area{
437
+ margin-bottom: 8px !important;
438
+ }
439
+
440
+ .b2s-post-item-info-area {
441
+ font-size: 11px !important;
442
+ }
443
+
444
+ .b2s-post-ship-item-full-text, .b2s-post-ship-item-message-delete, .b2s-post-ship-item-network-settings, .b2s-post-ship-item-post-format{
445
+ line-height: 1.5 !important;
446
+ padding: 0 1px 3px !important;
447
+ }
448
+
449
+ .b2s-load-info-meta-tag-modal{
450
+ margin-top: 8px !important;
451
+ display: block !important;
452
+ margin-right: auto !important;
453
+ margin-left: auto !important;
454
+ }
455
+
456
+ .b2s-post-item-details-tag-add-div {
457
+ border: 0px !important;
458
+ box-shadow: 0px 0px 0px #000 !important;
459
+ }
460
+
461
+ .b2s-post-item-details-tag-input-elem {
462
+ margin: 2px 4px;
463
+ max-width: 145px !important;
464
+ }
465
+ .b2s-calendar-sched-post-btn{
466
+ font-size: 11px;
467
+ float: right;
468
+ padding: 2px 4px 0px 4px;
469
+ }
470
+
471
+
472
+ .form-inline {
473
+ width: 100%;
474
+ margin-bottom: 20px;
475
+ }
476
+ .form-inline .form-group {
477
+ margin-left: 2px;
478
+ }
479
+
480
+ @media(max-width: 549px) {
481
+ .b2s-post-btn {
482
+ width: 100%;
483
+ }
484
+ .form-inline button, .form-inline a {
485
+ width: 100%;
486
+ margin-bottom: 10px;
487
+ }
488
+ }
489
+ @media(max-width: 767px) {
490
+ .form-inline {
491
+ display: none;
492
+ }
493
+ .filterHide {
494
+ display: none;
495
+ }
496
+ .form-inline button ,.form-inline a {
497
+ width: 49%;
498
+ margin-bottom: 10px;
499
+ }
500
+ }
501
+
502
+ .img-thumbnail{
503
+ display: block !important;
504
+ height: auto;
505
+ margin-left: auto;
506
+ margin-right: auto;
507
+ max-height: 100%;
508
+ }
509
+
510
+ .b2s-post-item-details-item-group-select {
511
+ max-width: 100% !important;
512
+ }
513
+
514
+ .glyphicon-refresh-animate {
515
+ -animation: spin .7s infinite linear;
516
+ -webkit-animation: spin2 .7s infinite linear;
517
+ }
518
+
519
+ @-webkit-keyframes spin2 {
520
+ from { -webkit-transform: rotate(0deg);}
521
+ to { -webkit-transform: rotate(360deg);}
522
+ }
523
+
524
+ @keyframes spin {
525
+ from { transform: scale(1) rotate(0deg);}
526
+ to { transform: scale(1) rotate(360deg);}
527
+ }
528
+
529
+ .b2s-post-item-details-item-message-area {
530
+ display: inline-block;
531
+ position: relative;
532
+ min-width: 100%;
533
+ }
534
+
535
+ .emoji-picker__content .active {
536
+ background-color: #fff;
537
+ }
538
+
539
+ .emoji-picker__content {
540
+ height: 21.5rem;
541
+ }
542
+
543
+ .emoji-picker__preview {
544
+ display: none;
545
+ }
546
+
547
+ .emoji-picker {
548
+ height: auto;
549
+ z-index: 1060;
550
+ }
551
+
552
+ .emoji-picker__tab.active {
553
+ color: #79b333;
554
+ border-bottom: 3px solid #79b333;
555
+ }
556
+
557
+ .list-group-item:first-child{
558
+ border-top: none !important;
559
+ }
assets/css/b2s/settings.css CHANGED
@@ -144,4 +144,9 @@ ul.chosen-choices {
144
.b2s-auto-post-header {
145
display: inline-block;
146
margin-right: 5px;
147
}
144
.b2s-auto-post-header {
145
display: inline-block;
146
margin-right: 5px;
147
+ }
148
+
149
+ /*prevent themes to overwrite line-height, causing the words to shift to the top*/
150
+ .toggle-off, .toggle-on {
151
+ line-height: 1.4 !important;
152
}
assets/css/general.css CHANGED
@@ -2988,7 +2988,7 @@ select[multiple].input-lg {
2988
}
2989
.btn {
2990
display: inline-block;
2991
- padding: 6px 12px;
2992
margin-bottom: 0;
2993
font-size: 14px;
2994
font-weight: normal;
@@ -3425,7 +3425,7 @@ fieldset[disabled] .btn-link:focus {
3425
}
3426
.btn-sm,
3427
.btn-group-sm > .btn {
3428
- padding: 5px 10px;
3429
font-size: 12px;
3430
line-height: 1.5;
3431
border-radius: 3px;
@@ -4804,9 +4804,9 @@ fieldset[disabled] .navbar-inverse .btn-link:focus {
4804
}
4805
.label {
4806
display: inline;
4807
- padding: .2em .6em .3em;
4808
font-size: 75%;
4809
- font-weight: bold;
4810
line-height: 1;
4811
color: #fff;
4812
text-align: center;
@@ -6961,6 +6961,7 @@ p {
6961
.b2s-select,.b2s-input,.b2s-select-area{
6962
height: 30px !important;
6963
margin-bottom: 8px !important;
6964
}
6965
6966
.b2s-btn-logo{
@@ -7633,4 +7634,8 @@ CSS CheckBOX
7633
7634
.b2s-post-per-page {
7635
margin: 20px 0px;
7636
- }
2988
}
2989
.btn {
2990
display: inline-block;
2991
+ padding: 6px 8px;
2992
margin-bottom: 0;
2993
font-size: 14px;
2994
font-weight: normal;
3425
}
3426
.btn-sm,
3427
.btn-group-sm > .btn {
3428
+ padding: 5px 6px;
3429
font-size: 12px;
3430
line-height: 1.5;
3431
border-radius: 3px;
4804
}
4805
.label {
4806
display: inline;
4807
+ padding: .2em .3em .2em;
4808
font-size: 75%;
4809
+ font-weight: 600;
4810
line-height: 1;
4811
color: #fff;
4812
text-align: center;
6961
.b2s-select,.b2s-input,.b2s-select-area{
6962
height: 30px !important;
6963
margin-bottom: 8px !important;
6964
+ padding: 0 19px 0 1px !important;
6965
}
6966
6967
.b2s-btn-logo{
7634
7635
.b2s-post-per-page {
7636
margin: 20px 0px;
7637
+ }
7638
+
7639
+ .fc-other-month{
7640
+ opacity: 1 !important;
7641
+ }
assets/images/settings/sniply.png ADDED
Binary file
assets/js/b2s/autopost.js ADDED
@@ -0,0 +1,209 @@
1
+ jQuery.noConflict();
2
+ jQuery(window).on("load", function () {
3
+
4
+ if (jQuery('#b2sUserLang').val() == 'de') {
5
+ showMeridian = false;
6
+ }
7
+
8
+ jQuery(".b2s-import-auto-post-type").chosen();
9
+
10
+ jQuery('.b2s-network-item-auth-list[data-network-count="true"]').each(function () {
11
+ jQuery('.b2s-network-auth-count-current[data-network-id="' + jQuery(this).attr("data-network-id") + '"').text(jQuery(this).children('li').length);
12
+ });
13
+
14
+ var length = jQuery('.b2s-post-type-item-update').filter(':checked').length;
15
+ if (length > 0) {
16
+ jQuery('.b2s-auto-post-own-update-warning').show();
17
+ }
18
+
19
+ //TOS Twitter 032018 - none multiple Accounts - User select once
20
+ checkNetworkTos(2);
21
+
22
+ jQuery('#b2s-auto-post-profil-dropdown').trigger('change');
23
+
24
+ });
25
+
26
+ //TOS Twitter 032018 - none multiple Accounts - User select once
27
+ jQuery(document).on('change', '.b2s-network-tos-check', function () {
28
+ var networkId = jQuery(this).attr('data-network-id');
29
+ if (networkId == 2) {
30
+ checkNetworkTos(networkId, false);
31
+ }
32
+ return false;
33
+ });
34
+
35
+ //TOS Twitter 032018 - none multiple Accounts - User select once
36
+ function checkNetworkTos(networkId) {
37
+ var len = jQuery('.b2s-network-tos-check[data-network-id="' + networkId + '"]:checked').length;
38
+ if (len > 1) {
39
+ jQuery('.b2s-network-tos-auto-post-import-warning').show();
40
+ jQuery('#b2s-auto-post-settings-btn').attr('disabled', 'disabled');
41
+ return false;
42
+ } else {
43
+ jQuery('.b2s-network-tos-auto-post-import-warning').hide();
44
+ jQuery('#b2s-auto-post-settings-btn').attr('disabled', false);
45
+ return true;
46
+ }
47
+ }
48
+
49
+ jQuery(document).on('change', '.b2s-post-type-item-update', function () {
50
+ var length = jQuery('.b2s-post-type-item-update').filter(':checked').length;
51
+ if (length == 0) {
52
+ jQuery('.b2s-auto-post-own-update-warning').hide();
53
+ } else {
54
+ jQuery('.b2s-auto-post-own-update-warning').show();
55
+ }
56
+ return false;
57
+ });
58
+
59
+ jQuery('#b2s-user-network-settings-auto-post-own').validate({
60
+ ignore: "",
61
+ errorPlacement: function () {
62
+ return false;
63
+ },
64
+ submitHandler: function (form) {
65
+ jQuery('.b2s-settings-user-success').hide();
66
+ jQuery('.b2s-settings-user-error').hide();
67
+ jQuery(".b2s-loading-area").show();
68
+ jQuery(".b2s-autopost-area").hide();
69
+ jQuery('.b2s-server-connection-fail').hide();
70
+ jQuery.ajax({
71
+ processData: false,
72
+ url: ajaxurl,
73
+ type: "POST",
74
+ dataType: "json",
75
+ cache: false,
76
+ data: jQuery(form).serialize() + '&b2s_security_nonce=' + jQuery('#b2s_security_nonce').val(),
77
+ error: function () {
78
+ jQuery('.b2s-server-connection-fail').show();
79
+ return false;
80
+ },
81
+ success: function (data) {
82
+ jQuery(".b2s-loading-area").hide();
83
+ jQuery(".b2s-autopost-area").show();
84
+ if (data.result == true) {
85
+ jQuery('.b2s-settings-user-success').show();
86
+ } else {
87
+ if(data.error == 'nonce') {
88
+ jQuery('.b2s-nonce-check-fail').show();
89
+ }
90
+ jQuery('.b2s-settings-user-error').show();
91
+ }
92
+ }
93
+ });
94
+ return false;
95
+ }
96
+ });
97
+
98
+ jQuery(document).on('click', '.b2s-post-type-select-btn', function () {
99
+ var type = jQuery(this).attr('data-post-type');
100
+ var tempCurText = jQuery(this).text();
101
+ if (jQuery(this).attr('data-select-toogle-state') == "0") { //0=select
102
+ jQuery('.b2s-post-type-item-' + type).prop('checked', true);
103
+ jQuery(this).attr('data-select-toogle-state', '1');
104
+ if (type == 'update') {
105
+ jQuery('.b2s-auto-post-own-update-warning').show();
106
+ }
107
+ } else {
108
+ jQuery('.b2s-post-type-item-' + type).prop('checked', false);
109
+ jQuery(this).attr('data-select-toogle-state', '0');
110
+ if (type == 'update') {
111
+ jQuery('.b2s-auto-post-own-update-warning').hide();
112
+ }
113
+ }
114
+ jQuery(this).text(jQuery(this).attr('data-select-toogle-name'));
115
+ jQuery(this).attr('data-select-toogle-name', tempCurText);
116
+ return false;
117
+ });
118
+
119
+ jQuery(document).on('click', '.b2sInfoAutoPosterMModalBtn', function () {
120
+ jQuery('#b2sInfoAutoPosterMModal').modal('show');
121
+ });
122
+ jQuery(document).on('click', '.b2sInfoAutoPosterAModalBtn', function () {
123
+ jQuery('#b2sInfoAutoPosterAModal').modal('show');
124
+ });
125
+ jQuery(document).on('click', '.b2sTwitterInfoModalBtn', function () {
126
+ jQuery('#b2sTwitterInfoModal').modal('show');
127
+ });
128
+
129
+ jQuery(document).on('change', '.b2s-auto-post-area-toggle', function() {
130
+ if(jQuery(this).is(':checked')) {
131
+ jQuery('.b2s-auto-post-area[data-area-type="'+jQuery(this).data('area-type')+'"]').show();
132
+ } else {
133
+ jQuery('.b2s-auto-post-area[data-area-type="'+jQuery(this).data('area-type')+'"]').hide();
134
+ }
135
+ });
136
+
137
+ jQuery(document).on('change', '#b2s-auto-post-profil-dropdown', function () {
138
+ jQuery('.b2s-auto-post-error[data-error-reason="no-auth-in-mandant"]').hide();
139
+ var tos = false;
140
+ if (jQuery('#b2s-auto-post-profil-data-' + jQuery(this).val()).val() == "") {
141
+ tos = true;
142
+ } else {
143
+ //TOS Twitter Check
144
+ var len = jQuery('#b2s-auto-post-profil-dropdown-twitter').children('option[data-mandant-id="' + jQuery(this).val() + '"]').length;
145
+ if (len >= 1) {
146
+ jQuery('.b2s-auto-post-twitter-profile').show();
147
+ jQuery('#b2s-auto-post-profil-dropdown-twitter').prop('disabled', false);
148
+ jQuery('#b2s-auto-post-profil-dropdown-twitter').show();
149
+ jQuery('#b2s-auto-post-profil-dropdown-twitter option').attr("disabled", "disabled");
150
+ jQuery('#b2s-auto-post-profil-dropdown-twitter option[data-mandant-id="' + jQuery(this).val() + '"]').attr("disabled", false);
151
+ jQuery('#b2s-auto-post-profil-dropdown-twitter option[data-mandant-id="' + jQuery(this).val() + '"]:first').attr("selected", "selected");
152
+ } else {
153
+ tos = true;
154
+ }
155
+
156
+ }
157
+ //TOS Twitter 032018
158
+ if (tos) {
159
+ jQuery('.b2s-auto-post-twitter-profile').hide();
160
+ jQuery('#b2s-auto-post-profil-dropdown-twitter').prop('disabled', 'disabled');
161
+ jQuery('#b2s-auto-post-profil-dropdown-twitter').hide();
162
+ }
163
+ });
164
+
165
+ jQuery(document).on('click', '#b2s-auto-post-settings-btn', function() {
166
+ var submit = true;
167
+ if(jQuery('.b2s-auto-post-area-toggle[data-area-type="manuell"]').is(':checked')) {
168
+ var publish = jQuery('.b2s-post-type-item-publish').is(':checked');
169
+ var update = jQuery('.b2s-post-type-item-update').is(':checked');
170
+ if(publish == false && update == false) {
171
+ submit = false;
172
+ jQuery('.b2s-auto-post-error[data-error-reason="no-post-type"]').show();
173
+ jQuery('.b2s-post-type-item-publish').css('border-color', 'red');
174
+ jQuery('.b2s-post-type-item-update').css('border-color', 'red');
175
+ }
176
+ if(jQuery('#b2s-auto-post-profil-data-'+jQuery('#b2s-auto-post-profil-dropdown').val()).val() == "") {
177
+ submit = false;
178
+ jQuery('.b2s-auto-post-error[data-error-reason="no-auth-in-mandant"]').show();
179
+ }
180
+ }
181
+
182
+ if(jQuery('.b2s-auto-post-area-toggle[data-area-type="import"]').is(':checked')) {
183
+ if(jQuery('.b2s-network-tos-check').is(':checked') == false) {
184
+ submit = false;
185
+ jQuery('.b2s-auto-post-error[data-error-reason="import-no-auth"]').show();
186
+ jQuery('.b2s-network-tos-check').css('border-color', 'red');
187
+ }
188
+ }
189
+
190
+ if(submit) {
191
+ jQuery('#b2s-user-network-settings-auto-post-own').submit();
192
+ }
193
+ });
194
+
195
+ jQuery(document).on('change', '.b2s-post-type-item-publish', function() {
196
+ jQuery('.b2s-auto-post-error[data-error-reason="no-post-type"]').hide();
197
+ jQuery('.b2s-post-type-item-publish').css('border-color', '');
198
+ jQuery('.b2s-post-type-item-update').css('border-color', '');
199
+ });
200
+ jQuery(document).on('change', '.b2s-post-type-item-update', function() {
201
+ jQuery('.b2s-auto-post-error[data-error-reason="no-post-type"]').hide();
202
+ jQuery('.b2s-post-type-item-publish').css('border-color', '');
203
+ jQuery('.b2s-post-type-item-update').css('border-color', '');
204
+ });
205
+
206
+ jQuery(document).on('change', '.b2s-network-tos-check', function() {
207
+ jQuery('.b2s-auto-post-error[data-error-reason="import-no-auth"]').hide();
208
+ jQuery('.b2s-network-tos-check').css('border-color', '');
209
+ });
assets/js/b2s/calendar.js CHANGED
@@ -6,9 +6,20 @@ var newSource = new Array();
6
7
jQuery(document).ready(function () {
8
jQuery('#b2s_calendar').fullCalendar({
9
editable: b2s_has_premium,
10
locale: b2s_calendar_locale,
11
- eventLimit: 2,
12
timeFormat: 'H:mm',
13
eventSources: [curSource[0]],
14
eventRender: function (event, element) {
@@ -16,13 +27,17 @@ jQuery(document).ready(function () {
16
$header = jQuery("<div>").addClass("b2s-calendar-header").attr('data-b2s-id', event.b2s_id);
17
$isRelayPost = '';
18
$isCuratedPost = '';
19
if (event.post_type == 'b2s_ex_post') {
20
$isCuratedPost = ' (Curated Post)';
21
}
22
if (event.relay_primary_post_id > 0) {
23
$isRelayPost = ' (Retweet)';
24
}
25
- $network_name = jQuery("<span>").text(event.author + $isRelayPost + $isCuratedPost).addClass("network-name").css("display", "block");
26
element.find(".fc-time").after($network_name);
27
element.html(element.html());
28
$parent = element.parent();
@@ -46,13 +61,19 @@ jQuery(document).ready(function () {
46
}
47
},
48
dayRender: function (date, element) {
49
- //TODO state to load
50
if (!jQuery(element[0]).hasClass('fc-past')) {
51
var date = jQuery(element[0]).attr('data-date');
52
- var sel_element = jQuery(element[0]).closest('div').next('div').find('td[data-date="' + date + '"]');
53
$header = jQuery("<a>").html("+ <span class=\"hidden-sm hidden-xs\">" + jQuery("#b2sJSTextAddPost").val() + "</span>").addClass("b2s-calendar-sched-new-post-btn").attr('href', '#');
54
sel_element.append($header);
55
}
56
},
57
eventDrop: function (event, delta, revertFunc) {
58
jQuery.ajax({
@@ -373,7 +394,13 @@ jQuery(document).on('click', '.b2s-calendar-sched-new-post-btn', function () {
373
return false;
374
}
375
jQuery('#b2s-show-post-type-modal').modal('show');
376
- var selSchedDate = jQuery(this).parent('td').attr('data-date');
377
jQuery('#b2sSelSchedDate').val(selSchedDate);
378
return false;
379
});
6
7
jQuery(document).ready(function () {
8
jQuery('#b2s_calendar').fullCalendar({
9
+ header: {
10
+ left: 'title',
11
+ right: 'month,basicWeek, prev,next'
12
+ },
13
+ views: {
14
+ month: {
15
+ eventLimit: 2
16
+ },
17
+ basicWeek: {
18
+ eventLimit: false
19
+ }
20
+ },
21
editable: b2s_has_premium,
22
locale: b2s_calendar_locale,
23
timeFormat: 'H:mm',
24
eventSources: [curSource[0]],
25
eventRender: function (event, element) {
27
$header = jQuery("<div>").addClass("b2s-calendar-header").attr('data-b2s-id', event.b2s_id);
28
$isRelayPost = '';
29
$isCuratedPost = '';
30
+ $isRePost = '';
31
if (event.post_type == 'b2s_ex_post') {
32
$isCuratedPost = ' (Curated Post)';
33
}
34
if (event.relay_primary_post_id > 0) {
35
$isRelayPost = ' (Retweet)';
36
}
37
+ if (event.b2s_sched_type == 5) {
38
+ $isRePost = ' (Re-Share)';
39
+ }
40
+ $network_name = jQuery("<span>").text(event.author + $isRelayPost + $isCuratedPost + $isRePost).addClass("network-name").css("display", "block");
41
element.find(".fc-time").after($network_name);
42
element.html(element.html());
43
$parent = element.parent();
61
}
62
},
63
dayRender: function (date, element) {
64
+ var view = jQuery('#b2s_calendar').fullCalendar('getView');
65
if (!jQuery(element[0]).hasClass('fc-past')) {
66
var date = jQuery(element[0]).attr('data-date');
67
+ var sel_element = '';
68
+ if (view.type == 'month') {
69
+ sel_element = jQuery(element[0]).closest('div').next('div').find('td[data-date="' + date + '"]');
70
+ } else {
71
+ sel_element = jQuery('.fc-basicWeek-view').find('th[data-date="' + date + '"]');
72
+ }
73
$header = jQuery("<a>").html("+ <span class=\"hidden-sm hidden-xs\">" + jQuery("#b2sJSTextAddPost").val() + "</span>").addClass("b2s-calendar-sched-new-post-btn").attr('href', '#');
74
sel_element.append($header);
75
}
76
+
77
},
78
eventDrop: function (event, delta, revertFunc) {
79
jQuery.ajax({
394
return false;
395
}
396
jQuery('#b2s-show-post-type-modal').modal('show');
397
+ var view = jQuery('#b2s_calendar').fullCalendar('getView');
398
+ var selSchedDate;
399
+ if (view.type == 'month') {
400
+ selSchedDate = jQuery(this).parent('td').attr('data-date');
401
+ } else {
402
+ selSchedDate = jQuery(this).parent('th').attr('data-date');
403
+ }
404
jQuery('#b2sSelSchedDate').val(selSchedDate);
405
return false;
406
});
assets/js/b2s/curation.js CHANGED
@@ -255,8 +255,8 @@ jQuery(document).on('click', '#b2s-btn-curation-share', function () {
255
jQuery('.b2s-post-item-details-url-image').addClass('error');
256
noContent = true;
257
}
258
- if (jQuery('.b2s-post-item-details-item-message-input').val().length === 0) {
259
- jQuery('.b2s-post-item-details-item-message-input').addClass('error');
260
noContent = true;
261
}
262
}
@@ -399,8 +399,8 @@ jQuery(document).on('click', '#b2s-btn-curation-customize', function () {
399
jQuery('.b2s-post-item-details-url-image').addClass('error');
400
noContent = true;
401
}
402
- if (jQuery('.b2s-post-item-details-item-message-input').val().length === 0) {
403
- jQuery('.b2s-post-item-details-item-message-input').addClass('error');
404
noContent = true;
405
}
406
}
@@ -509,8 +509,8 @@ jQuery(document).on('click', '#b2s-btn-curation-draft', function () {
509
jQuery('.b2s-post-item-details-url-image').addClass('error');
510
noContent = true;
511
}
512
- if (jQuery('.b2s-post-item-details-item-message-input').val().length === 0) {
513
- jQuery('.b2s-post-item-details-item-message-input').addClass('error');
514
noContent = true;
515
}
516
}
255
jQuery('.b2s-post-item-details-url-image').addClass('error');
256
noContent = true;
257
}
258
+ if (jQuery('#b2s-post-curation-comment-image').val().length === 0) {
259
+ jQuery('#b2s-post-curation-comment-image').addClass('error');
260
noContent = true;
261
}
262
}
399
jQuery('.b2s-post-item-details-url-image').addClass('error');
400
noContent = true;
401
}
402
+ if (jQuery('#b2s-post-curation-comment-image').val().length === 0) {
403
+ jQuery('#b2s-post-curation-comment-image').addClass('error');
404
noContent = true;
405
}
406
}
509
jQuery('.b2s-post-item-details-url-image').addClass('error');
510
noContent = true;
511
}
512
+ if (jQuery('#b2s-post-curation-comment-image').val().length === 0) {
513
+ jQuery('#b2s-post-curation-comment-image').addClass('error');
514
noContent = true;
515
}
516
}
assets/js/b2s/repost.js ADDED
@@ -0,0 +1,752 @@
1
+ jQuery.noConflict();
2
+ jQuery(window).on("load", function () {
3
+
4
+ jQuery(".b2s-re-post-type").chosen();
5
+ jQuery(".b2s-re-post-categories").chosen();
6
+ jQuery(".b2s-re-post-author").chosen();
7
+
8
+ var dateFormat = "yyyy-mm-dd";
9
+ var language = "en";
10
+ if (jQuery('#b2sUserLang').val() == "de") {
11
+ dateFormat = "dd.mm.yyyy";
12
+ language = "de";
13
+ }
14
+ jQuery(".b2s-re-post-date-start").datepicker({
15
+ format: dateFormat,
16
+ language: language,
17
+ maxViewMode: 2,
18
+ todayHighlight: true,
19
+ calendarWeeks: true,
20
+ autoclose: true
21
+ });
22
+
23
+ jQuery(".b2s-re-post-date-end").datepicker({
24
+ format: dateFormat,
25
+ language: language,
26
+ maxViewMode: 2,
27
+ todayHighlight: true,
28
+ calendarWeeks: true,
29
+ autoclose: true
30
+ });
31
+
32
+ var showMeridian = true;
33
+ if (jQuery('#b2sUserLang').val() == "de") {
34
+ dateFormat = "dd.mm.yyyy";
35
+ language = "de";
36
+ showMeridian = false;
37
+ }
38
+ jQuery('.b2s-re-post-input-time').timepicker({
39
+ minuteStep: 15,
40
+ appendWidgetTo: 'body',
41
+ showSeconds: false,
42
+ showMeridian: showMeridian,
43
+ snapToStep: true
44
+ });
45
+
46
+ jQuery('.b2s-re-post-queue-count').html(jQuery('.b2s-re-post-queue-area .list-group-item[data-type="post"]').length);
47
+ if(jQuery('.b2s-re-post-queue-area .list-group-item[data-type="post"]').length == 0) {
48
+ jQuery('.b2s-re-post-queue-delete-area').hide();
49
+ }
50
+ jQuery('.b2s-re-post-settings-option').trigger('change');
51
+ jQuery('#b2s-re-post-profil-dropdown').trigger('change');
52
+
53
+ });
54
+
55
+ jQuery(document).on('click', '.b2s-re-post-settings-header', function() {
56
+ if(jQuery('.b2s-re-post-settings-area').is(':visible')) {
57
+ jQuery('.b2s-re-post-settings-area').hide();
58
+ jQuery('.b2s-re-post-settings-toggle').removeClass('glyphicon-chevron-up').addClass('glyphicon-chevron-down');
59
+ } else {
60
+ jQuery('.b2s-re-post-settings-area').show();
61
+ jQuery('.b2s-re-post-settings-toggle').removeClass('glyphicon-chevron-down').addClass('glyphicon-chevron-up');
62
+ }
63
+ });
64
+
65
+ jQuery(document).on('change', '#b2s-re-post-best-times-active', function() {
66
+ if(jQuery(this).is(':checked')) {
67
+ jQuery('.b2s-re-post-input-time').prop('disabled', true);
68
+ } else {
69
+ jQuery('.b2s-re-post-input-time').prop('disabled', false);
70
+ }
71
+ });
72
+
73
+ jQuery(document).on('change', '.b2s-re-post-settings-option', function() {
74
+ if(jQuery('.b2s-re-post-settings-option:checked').val() == 1) {
75
+ jQuery('.b2s-re-post-settings-customize-area input').prop('disabled', false);
76
+ jQuery(".b2s-re-post-type").prop('disabled', false).trigger("chosen:updated");
77
+ jQuery(".b2s-re-post-categories").prop('disabled', false).trigger("chosen:updated");
78
+ jQuery(".b2s-re-post-author").prop('disabled', false).trigger("chosen:updated");
79
+ } else {
80
+ jQuery('.b2s-re-post-settings-customize-area input').prop('disabled', true);
81
+ jQuery(".b2s-re-post-type").prop('disabled', true).trigger("chosen:updated");
82
+ jQuery(".b2s-re-post-categories").prop('disabled', true).trigger("chosen:updated");
83
+ jQuery(".b2s-re-post-author").prop('disabled', true).trigger("chosen:updated");
84
+ }
85
+ });
86
+
87
+ jQuery(document).on('click', '.b2s-re-post-submit-btn', function() {
88
+ if(jQuery('.b2s-re-post-date-active').is(':checked') && (jQuery('.b2s-re-post-date-start').val() == "" || jQuery('.b2s-re-post-date-end').val() == "") && !(jQuery('.b2s-re-post-date-start').val() == "" && jQuery('.b2s-re-post-date-end').val() == "")) {
89
+ if(jQuery('.b2s-re-post-date-start').val() == "") {
90
+ jQuery('.b2s-re-post-date-start').addClass('error');
91
+ }
92
+ if(jQuery('.b2s-re-post-date-end').val() == "") {
93
+ jQuery('.b2s-re-post-date-end').addClass('error');
94
+ }
95
+ return false;
96
+ }
97
+ jQuery('.b2s-repost-options-area').hide();
98
+ jQuery('.b2s-repost-queue-area').hide();
99
+ jQuery('.b2s-re-post-no-content').hide();
100
+ jQuery('.b2s-re-post-limit-error').hide();
101
+ jQuery('.b2s-loading-area').show();
102
+ jQuery.ajax({
103
+ url: ajaxurl,
104
+ type: "POST",
105
+ dataType: "json",
106
+ cache: false,
107
+ data: jQuery('#b2s-re-post-settings').serialize() + '&b2s-re-post-queue-count=' + jQuery('.b2s-re-post-queue-count').html() + '&action=b2s_re_post_submit&b2s_security_nonce=' + jQuery('#b2s_security_nonce').val(),
108
+ error: function () {
109
+ jQuery('.b2s-repost-options-area').show();
110
+ jQuery('.b2s-repost-queue-area').show();
111
+ jQuery('.b2s-loading-area').hide();
112
+ jQuery('.b2s-server-connection-fail').show();
113
+ return false;
114
+ },
115
+ success: function (data) {
116
+ jQuery('.b2s-repost-options-area').show();
117
+ jQuery('.b2s-repost-queue-area').show();
118
+ jQuery('.b2s-loading-area').hide();
119
+ if(data.result == true) {
120
+ if(data.queue != "") {
121
+ jQuery('.b2s-repost-queue-area').html(data.queue);
122
+ jQuery('.b2s-re-post-queue-count').html(jQuery('.b2s-re-post-queue-area .list-group-item[data-type="post"]').length);
123
+ if(jQuery('.b2s-re-post-queue-area .list-group-item[data-type="post"]').length == 0) {
124
+ jQuery('.b2s-re-post-queue-delete-area').hide();
125
+ }
126
+ }
127
+ } else {
128
+ if (data.error == 'nonce') {
129
+ jQuery('.b2s-nonce-check-fail').show();
130
+ return false;
131
+ }
132
+ if (data.error == 'no_content') {
133
+ jQuery('.b2s-re-post-no-content').show();
134
+ return false;
135
+ }
136
+ if (data.error == 'limit') {
137
+ jQuery('.b2s-re-post-limit-error').show();
138
+ return false;
139
+ }
140
+ jQuery('.b2s-server-connection-fail').show();
141
+ }
142
+ }
143
+ });
144
+ });
145
+
146
+ jQuery(document).on('click', '.b2s-re-post-select-all', function() {
147
+ jQuery('.b2s-re-post-queue-checkbox').prop('checked', true);
148
+ jQuery('.b2s-re-post-queue-checkbox').trigger('change');
149
+ });
150
+
151
+ jQuery(document).on('change', '.b2s-re-post-queue-checkbox', function() {
152
+ if(jQuery('.b2s-re-post-queue-checkbox:checked').length) {
153
+ jQuery('.b2s-re-post-delete-checked').show();
154
+ } else {
155
+ jQuery('.b2s-re-post-delete-checked').hide();
156
+ }
157
+ });
158
+
159
+ jQuery(document).on('change', '.b2s-re-post-limit', function() {
160
+ if(jQuery(this).children("option:selected").data('limit') == 0) {
161
+ jQuery(this).children('option:selected').prop('selected', false);
162
+ jQuery(this).children('option[data-limit="1"]:last').prop('selected', 'selected');
163
+ jQuery('.b2s-re-post-limit-info').show();
164
+ } else {
165
+ jQuery('.b2s-re-post-limit-info').hide();
166
+ }
167
+ });
168
+
169
+ jQuery(document).on('change', '#b2s-re-post-profil-dropdown', function () {
170
+ jQuery('.b2s-re-post-error[data-error-reason="no-auth-in-mandant"]').hide();
171
+ var tos = false;
172
+ if (jQuery('#b2s-re-post-profil-data-' + jQuery(this).val()).val() == "") {
173
+ tos = true;
174
+ } else {
175
+ //TOS Twitter Check
176
+ var len = jQuery('#b2s-re-post-profil-dropdown-twitter').children('option[data-mandant-id="' + jQuery(this).val() + '"]').length;
177
+ if (len >= 1) {
178
+ jQuery('.b2s-re-post-twitter-profile').show();
179
+ jQuery('#b2s-re-post-profil-dropdown-twitter').prop('disabled', false);
180
+ jQuery('#b2s-re-post-profil-dropdown-twitter').show();
181
+ jQuery('#b2s-re-post-profil-dropdown-twitter option').attr("disabled", "disabled");
182
+ jQuery('#b2s-re-post-profil-dropdown-twitter option[data-mandant-id="' + jQuery(this).val() + '"]').attr("disabled", false);
183
+ jQuery('#b2s-re-post-profil-dropdown-twitter option[data-mandant-id="' + jQuery(this).val() + '"]:first').attr("selected", "selected");
184
+ } else {
185
+ tos = true;
186
+ }
187
+
188
+ }
189
+ //TOS Twitter 032018
190
+ if (tos) {
191
+ jQuery('.b2s-re-post-twitter-profile').hide();
192
+ jQuery('#b2s-re-post-profil-dropdown-twitter').prop('disabled', 'disabled');
193
+ jQuery('#b2s-re-post-profil-dropdown-twitter').hide();
194
+ }
195
+ });
196
+
197
+ jQuery(document).on('click', '.b2s-re-post-delete-checked', function() {
198
+ var checkboxes = jQuery('.b2s-re-post-queue-checkbox:checked');
199
+ if (checkboxes.length > 0) {
200
+ var items = [];
201
+ jQuery(checkboxes).each(function (i, selected) {
202
+ items[i] = jQuery(selected).val();
203
+ });
204
+ jQuery('#b2s-delete-confirm-post-id').val(items.join());
205
+ jQuery('#b2s-delete-confirm-post-count').html(items.length);
206
+ jQuery('.b2s-delete-sched-modal').modal('show');
207
+ jQuery('.b2s-sched-delete-confirm-btn').prop('disabeld', true);
208
+ jQuery('.b2s-sched-delete-confirm-btn').hide();
209
+ jQuery('.b2s-sched-delete-confirm-multi-btn').prop('disabeld', false);
210
+ jQuery('.b2s-sched-delete-confirm-multi-btn').show();
211
+ }
212
+ });
213
+
214
+ jQuery(document).on('click', '.b2sDetailsSchedPostTriggerLink', function () {
215
+ jQuery('.b2sDetailsSchedPostBtn[data-post-id="'+jQuery(this).data('post-id')+'"]').trigger('click');
216
+ return false;
217
+ });
218
+
219
+ jQuery(document).on('click', '.b2sDetailsSchedPostBtn', function () {
220
+ var postId = jQuery(this).attr('data-post-id');
221
+ if (!jQuery(this).find('i').hasClass('isload')) {
222
+ jQuery('.b2s-server-connection-fail').hide();
223
+ jQuery.ajax({
224
+ url: ajaxurl,
225
+ type: "POST",
226
+ dataType: "json",
227
+ cache: false,
228
+ data: {
229
+ 'action': 'b2s_sched_post_data',
230
+ 'postId': postId,
231
+ 'type': 'repost',
232
+ 'b2s_security_nonce': jQuery('#b2s_security_nonce').val()
233
+ },
234
+ error: function () {
235
+ jQuery('.b2s-server-connection-fail').show();
236
+ return false;
237
+ },
238
+ success: function (data) {
239
+ if (data.result == true) {
240
+ jQuery('.b2s-post-sched-area[data-post-id="' + data.postId + '"]').html(data.content);
241
+ } else {
242
+ if (data.error == 'nonce') {
243
+ jQuery('.b2s-nonce-check-fail').show();
244
+ }
245
+ }
246
+ }
247
+ });
248
+ jQuery(this).find('i').removeClass('glyphicon-chevron-down').addClass('glyphicon-chevron-up').addClass('isload').addClass('isShow');
249
+ } else {
250
+ if (jQuery(this).find('i').hasClass('isShow')) {
251
+ jQuery('.b2s-post-sched-area[data-post-id="' + postId + '"]').hide();
252
+ jQuery(this).find('i').removeClass('isShow').addClass('isHide').removeClass('glyphicon-chevron-up').addClass('glyphicon-chevron-down');
253
+ } else {
254
+ jQuery('.b2s-post-sched-area[data-post-id="' + postId + '"]').show();
255
+ jQuery(this).find('i').removeClass('isHide').addClass('isShow').removeClass('glyphicon-chevron-down').addClass('glyphicon-chevron-up');
256
+ }
257
+ }
258
+
259
+ });
260
+
261
+ jQuery(document).on('click', '.b2s-post-sched-area-drop-btn', function () {
262
+ jQuery('#b2s-delete-confirm-post-id').val(jQuery(this).attr('data-post-id'));
263
+ jQuery('#b2s-delete-confirm-post-count').html('1');
264
+ jQuery('.b2s-delete-sched-modal').modal('show');
265
+ jQuery('.b2s-sched-delete-confirm-multi-btn').prop('disabeld', true);
266
+ jQuery('.b2s-sched-delete-confirm-multi-btn').hide();
267
+ jQuery('.b2s-sched-delete-confirm-btn').prop('disabeld', false);
268
+ jQuery('.b2s-sched-delete-confirm-btn').show();
269
+ return false;
270
+ });
271
+
272
+ jQuery(document).on('click', '.b2s-sched-delete-confirm-multi-btn', function() {
273
+ jQuery('.b2s-delete-sched-modal').modal('hide');
274
+ jQuery('.b2s-repost-options-area').hide();
275
+ jQuery('.b2s-repost-queue-area').hide();
276
+ jQuery('.b2s-loading-area').show();
277
+
278
+ jQuery('.b2s-post-remove-fail').hide();
279
+ jQuery('.b2s-post-remove-success').hide();
280
+ jQuery('.b2s-sched-delete-confirm-btn').prop('disabeld', true);
281
+ jQuery('.b2s-server-connection-fail').hide();
282
+ jQuery.ajax({
283
+ url: ajaxurl,
284
+ type: "POST",
285
+ dataType: "json",
286
+ cache: false,
287
+ data: {
288
+ 'action': 'b2s_delete_re_post_sched',
289
+ 'postId': jQuery('#b2s-delete-confirm-post-id').val(),
290
+ 'b2s_security_nonce': jQuery('#b2s_security_nonce').val()
291
+ },
292
+ error: function () {
293
+ jQuery('.b2s-server-connection-fail').show();
294
+ return false;
295
+ },
296
+ success: function (data) {
297
+ jQuery('.b2s-repost-options-area').show();
298
+ jQuery('.b2s-repost-queue-area').show();
299
+ jQuery('.b2s-loading-area').hide();
300
+ if (data.result == true) {
301
+ data.postIds.forEach(function(postId) {
302
+ jQuery('.b2s-re-post-queue-checkbox[data-blog-post-id="'+postId+'"]').closest('li').remove();
303
+ });
304
+ jQuery('.b2s-re-post-queue-count').html(jQuery('.b2s-re-post-queue-area .list-group-item[data-type="post"]').length);
305
+ if(jQuery('.b2s-re-post-queue-area .list-group-item[data-type="post"]').length == 0) {
306
+ jQuery('.b2s-re-post-queue-delete-area').hide();
307
+ }
308
+ jQuery('.b2s-re-post-queue-checkbox').trigger('change');
309
+ } else {
310
+ if (data.error == 'nonce') {
311
+ jQuery('.b2s-nonce-check-fail').show();
312
+ }
313
+ jQuery('.b2s-post-remove-fail').show();
314
+ }
315
+ wp.heartbeat.connectNow();
316
+ return true;
317
+ }
318
+ });
319
+ });
320
+
321
+ jQuery(document).on('click', '.b2s-sched-delete-confirm-btn', function () {
322
+ jQuery('.b2s-delete-sched-modal').modal('hide');
323
+ jQuery('.b2s-repost-options-area').hide();
324
+ jQuery('.b2s-repost-queue-area').hide();
325
+ jQuery('.b2s-loading-area').show();
326
+
327
+ jQuery('.b2s-post-remove-fail').hide();
328
+ jQuery('.b2s-post-remove-success').hide();
329
+ jQuery('.b2s-sched-delete-confirm-btn').prop('disabeld', true);
330
+ jQuery('.b2s-server-connection-fail').hide();
331
+ jQuery.ajax({
332
+ url: ajaxurl,
333
+ type: "POST",
334
+ dataType: "json",
335
+ cache: false,
336
+ data: {
337
+ 'action': 'b2s_delete_user_sched_post',
338
+ 'postId': jQuery('#b2s-delete-confirm-post-id').val(),
339
+ 'b2s_security_nonce': jQuery('#b2s_security_nonce').val()
340
+ },
341
+ error: function () {
342
+ jQuery('.b2s-server-connection-fail').show();
343
+ return false;
344
+ },
345
+ success: function (data) {
346
+ jQuery('.b2s-repost-options-area').show();
347
+ jQuery('.b2s-repost-queue-area').show();
348
+ jQuery('.b2s-loading-area').hide();
349
+ if (data.result == true) {
350
+ var count = parseInt(jQuery('.b2s-sched-count[data-post-id="' + data.blogPostId + '"]').html());
351
+ var newCount = count - data.postCount;
352
+ jQuery('.b2s-sched-count[data-post-id="' + data.blogPostId + '"]').html(newCount);
353
+ if (newCount >= 1) {
354
+ jQuery.each(data.postId, function (i, id) {
355
+ jQuery('.b2s-post-sched-area-li[data-post-id="' + id + '"]').remove();
356
+ });
357
+ } else {
358
+ jQuery('.b2s-post-sched-area-li[data-post-id="' + data.postId[0] + '"]').closest('ul').closest('li').remove();
359
+ jQuery('.b2s-re-post-queue-count').html(jQuery('.b2s-re-post-queue-area .list-group-item[data-type="post"]').length);
360
+ if(jQuery('.b2s-re-post-queue-area .list-group-item[data-type="post"]').length == 0) {
361
+ jQuery('.b2s-re-post-queue-delete-area').hide();
362
+ }
363
+ }
364
+ jQuery('.b2s-post-remove-success').show();
365
+ } else {
366
+ if (data.error == 'nonce') {
367
+ jQuery('.b2s-nonce-check-fail').show();
368
+ }
369
+ jQuery('.b2s-post-remove-fail').show();
370
+ }
371
+ wp.heartbeat.connectNow();
372
+ return true;
373
+ }
374
+ });
375
+ });
376
+
377
+
378
+
379
+ jQuery(document).on('click', '.b2s-post-edit-sched-btn', function () {
380
+ showEditSchedPost(jQuery(this).attr('data-b2s-id'), jQuery(this).attr('data-post-id'), jQuery(this).attr('data-network-auth-id'), jQuery(this).attr('data-network-type'), jQuery(this).attr('data-network-id'), jQuery(this).attr('data-relay-primary-post-id'));
381
+
382
+ });
383
+
384
+ //Customize
385
+ function showEditSchedPost(b2s_id, post_id, network_auth_id, network_type, network_id, relay_primary_post_id) {
386
+ if (jQuery('#b2s-edit-event-modal-' + b2s_id).length == 1)
387
+ {
388
+ jQuery('#b2s-edit-event-modal-' + b2s_id).remove();
389
+ }
390
+ jQuery("#b2sPostId").val(post_id);
391
+ var $modal = jQuery("<div>");
392
+ jQuery.ajax({
393
+ url: ajaxurl,
394
+ type: "POST",
395
+ cache: false,
396
+ async: false,
397
+ data: {
398
+ 'action': 'b2s_get_post_edit_modal',
399
+ 'id': b2s_id,
400
+ 'b2s_security_nonce': jQuery('#b2s_security_nonce').val()
401
+ },
402
+ success: function (data) {
403
+ if (data.error == 'nonce') {
404
+ jQuery('.b2s-nonce-check-fail').show();
405
+ } else {
406
+ $modal = $modal.html(data);
407
+ }
408
+ }
409
+ });
410
+ b2s_current_post_id = post_id;
411
+ jQuery("body").append($modal);
412
+ jQuery(".b2s-edit-post-delete").hide();
413
+ jQuery('#b2sUserTimeZone').val(jQuery('#user_timezone').val());
414
+ jQuery('#b2s-edit-event-modal-' + b2s_id).modal('show');
415
+ var post_format = jQuery('#b2sCurrentPostFormat').val();
416
+ activatePortal(network_auth_id);
417
+ initSceditor(network_auth_id);
418
+ if (jQuery('.b2s-post-ship-item-post-format-text[data-network-type="' + network_type + '"][data-network-id="' + network_id + '"]').length > 0) {
419
+ var postFormatText = b2s_post_formats;
420
+ var isSetPostFormat = false;
421
+ var postFormatType = jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + network_type + '"][data-network-id="' + network_id + '"]').attr('data-post-format-type');
422
+ //is set post format => override current condidtions by user settings for this post
423
+ if (post_format !== null) {
424
+ jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + network_type + '"][data-network-id="' + network_id + '"]').val(post_format);
425
+ jQuery('.b2s-post-ship-item-post-format-text[data-network-auth-id="' + network_auth_id + '"]').html(postFormatText[postFormatType][post_format]);
426
+ jQuery('.b2s-post-item-details-post-format[data-network-auth-id="' + network_auth_id + '"]').val(post_format);
427
+ //edit modal select post format
428
+ jQuery('.b2s-user-network-settings-post-format[data-network-type="' + network_type + '"][data-network-id="' + network_id + '"]').removeClass('b2s-settings-checked');
429
+ jQuery('.b2s-user-network-settings-post-format[data-network-type="' + network_type + '"][data-network-id="' + network_id + '"][data-post-format="' + post_format + '"]').addClass('b2s-settings-checked');
430
+ } else {
431
+ jQuery('.b2s-post-ship-item-post-format-text[data-network-auth-id="' + network_auth_id + '"]').html(postFormatText[postFormatType][jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + network_type + '"][data-network-id="' + network_id + '"]').val()]);
432
+ jQuery('.b2s-post-item-details-post-format[data-network-auth-id="' + network_auth_id + '"]').val(jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + network_type + '"][data-network-id="' + network_id + '"]').val());
433
+ }
434
+
435
+ //if linkpost then show btn meta tags
436
+ var isMetaChecked = false;
437
+ var ogMetaNetworks = jQuery('#ogMetaNetworks').val().split(";");
438
+ if (typeof network_id != 'undefined' && jQuery.inArray(network_id.toString(), ogMetaNetworks) != -1 && jQuery('#isOgMetaChecked').val() == "1") {
439
+ isMetaChecked = true;
440
+ }
441
+ if (network_id == "2" && jQuery('#isCardMetaChecked').val() == "1") {
442
+ isMetaChecked = true;
443
+ }
444
+ if (isMetaChecked && jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + network_type + '"][data-network-id="' + network_id + '"]').val() == "0") {
445
+ jQuery('.b2s-post-item-details-preview-title[data-network-auth-id="' + network_auth_id + '"]').prop("readonly", false);
446
+ jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + network_auth_id + '"]').prop("readonly", false);
447
+ jQuery('.b2s-post-item-details-preview-url-reload[data-network-id="' + network_id + '"]').show();
448
+ //jQuery('.b2s-post-item-details-preview-url-reload[data-network-id="' + network_id + '"]').trigger("click");
449
+ var dataMetaType = jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + network_auth_id + '"]').attr("data-meta-type");
450
+ if (dataMetaType == "og") {
451
+ jQuery('.b2sChangeOgMeta[data-network-auth-id="' + network_auth_id + '"]').val("1");
452
+ } else {
453
+ jQuery('.b2sChangeCardMeta[data-network-auth-id="' + network_auth_id + '"]').val("1");
454
+ }
455
+ } else {
456
+ jQuery('.b2s-post-item-details-preview-title[data-network-auth-id="' + network_auth_id + '"]').prop("readonly", true);
457
+ jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + network_auth_id + '"]').prop("readonly", true);
458
+ jQuery('.b2s-post-item-details-preview-url-reload[data-network-id="' + network_id + '"]').hide();
459
+ }
460
+
461
+ //Content Curation
462
+ if (jQuery('.b2s-post-ship-item-post-format[data-network-auth-id="' + network_auth_id + '"]').attr('data-post-wp-type') == 'ex') {
463
+ jQuery('.b2s-post-item-details-preview-title[data-network-auth-id="' + network_auth_id + '"]').prop("readonly", true);
464
+ jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + network_auth_id + '"]').prop("readonly", true);
465
+ jQuery('.b2s-post-item-details-item-url-input[data-network-auth-id="' + network_auth_id + '"]').prop("readonly", true);
466
+ jQuery('.b2s-load-info-meta-tag-modal[data-network-auth-id="' + network_auth_id + '"]').attr("style", "display:none !important");
467
+ if (jQuery('.b2s-post-item-details-post-format[data-network-auth-id="' + network_auth_id + '"]').val() == 0) {
468
+ jQuery('.b2s-select-image-modal-open[data-network-auth-id="' + network_auth_id + '"]').hide();
469
+ jQuery('.b2s-image-remove-btn[data-network-auth-id="' + network_auth_id + '"]').hide();
470
+ } else {
471
+ jQuery('.b2s-select-image-modal-open[data-network-auth-id="' + network_auth_id + '"]').show();
472
+ jQuery('.b2s-image-remove-btn[data-network-auth-id="' + network_auth_id + '"]').show();
473
+ }
474
+ }
475
+ }
476
+ var textLimit = jQuery('.b2s-post-item-details-item-message-input[data-network-count="-1"][data-network-auth-id="' + network_auth_id + '"]').attr('data-network-text-limit');
477
+ if (textLimit != "0") {
478
+ networkLimitAll(network_auth_id, network_id, textLimit);
479
+ } else {
480
+ networkCount(network_auth_id);
481
+ }
482
+ var today = new Date();
483
+ var dateFormat = "yyyy-mm-dd";
484
+ var language = "en";
485
+ var showMeridian = true;
486
+ if (jQuery('#b2sUserLang').val() == "de") {
487
+ dateFormat = "dd.mm.yyyy";
488
+ language = "de";
489
+ showMeridian = false;
490
+ }
491
+
492
+ jQuery(".b2s-post-item-details-release-input-date").datepicker({
493
+ format: dateFormat,
494
+ language: language,
495
+ maxViewMode: 2,
496
+ todayHighlight: true,
497
+ startDate: today,
498
+ calendarWeeks: true,
499
+ autoclose: true
500
+ });
501
+ jQuery('.b2s-post-item-details-release-input-time').timepicker({
502
+ minuteStep: 15,
503
+ appendWidgetTo: 'body',
504
+ showSeconds: false,
505
+ showMeridian: showMeridian,
506
+ defaultTime: 'current',
507
+ snapToStep: true
508
+ });
509
+ jQuery(".b2s-post-item-details-release-input-date").datepicker().on('changeDate', function (e) {
510
+ checkSchedDateTime(network_auth_id);
511
+ });
512
+ jQuery('.b2s-post-item-details-release-input-time').timepicker().on('changeTime.timepicker', function (e) {
513
+ checkSchedDateTime(network_auth_id);
514
+ });
515
+ init();
516
+
517
+ //is relay post?
518
+ if (relay_primary_post_id > 0) {
519
+ jQuery('#b2s-edit-event-modal-' + b2s_id).find("input, textarea, button").each(function () {
520
+ if (!jQuery(this).hasClass('b2s-input-hidden') && !jQuery(this).hasClass('b2s-modal-close') && !jQuery(this).hasClass('b2s-post-item-details-relay-input-delay') && !jQuery(this).hasClass('b2s-edit-post-delete') && !jQuery(this).hasClass('b2s-edit-post-save-this')) {
521
+ jQuery(this).prop("disabled", true);
522
+ }
523
+ });
524
+ }
525
+
526
+ if (!b2s_has_premium)
527
+ {
528
+ jQuery('#b2s-edit-event-modal-' + b2s_id).find("input, textarea, button").each(function () {
529
+ if (!jQuery(this).hasClass('b2s-modal-close')) {
530
+ jQuery(this).prop("disabled", true);
531
+ }
532
+ });
533
+ }
534
+ }
535
+
536
+ jQuery(document).on('click', '.b2s-select-image-modal-open', function () {
537
+ jQuery('.b2s-network-select-image-content').html("");
538
+ jQuery.ajax({
539
+ url: ajaxurl,
540
+ type: "POST",
541
+ cache: false,
542
+ async: false,
543
+ data: {
544
+ 'action': 'b2s_get_image_modal',
545
+ 'id': jQuery(this).data('post-id'),
546
+ 'image_url': jQuery(this).data('image-url'),
547
+ 'b2s_security_nonce': jQuery('#b2s_security_nonce').val()
548
+ },
549
+ success: function (data) {
550
+ if (data.error == 'nonce') {
551
+ jQuery('.b2s-nonce-check-fail').show();
552
+ } else {
553
+ jQuery(".b2s-network-select-image-content").html(data);
554
+ }
555
+ }
556
+ });
557
+ var authId = jQuery(this).data('network-auth-id');
558
+ jQuery('.b2s-image-change-this-network').attr('data-network-auth-id', authId);
559
+ jQuery('.b2s-upload-image').attr('data-network-auth-id', authId);
560
+ var content = "<img class='b2s-post-item-network-image-selected-account' height='22px' src='" + jQuery('.b2s-post-item-network-image[data-network-auth-id="' + authId + '"]').attr('src') + "' /> " + jQuery('.b2s-post-item-details-network-display-name[data-network-auth-id="' + authId + '"]').html();
561
+ jQuery('.b2s-selected-network-for-image-info').html(content);
562
+ jQuery('#b2sInsertImageType').val("0");
563
+ jQuery('.networkImage').each(function () {
564
+ var width = this.naturalWidth;
565
+ var height = this.naturalHeight;
566
+ jQuery(this).parents('.b2s-image-item').find('.b2s-image-item-caption-resolution').html(width + 'x' + height);
567
+ });
568
+ jQuery('#b2s-network-select-image').modal('show');
569
+ return false;
570
+ });
571
+
572
+ jQuery(document).on("click", ".b2s-edit-post-save-this", function (e) {
573
+ e.preventDefault();
574
+ jQuery('#save_method').val("apply-this");
575
+ var id = jQuery(this).data("b2s-id");
576
+ jQuery.ajax({
577
+ url: ajaxurl,
578
+ type: "POST",
579
+ dataType: "json",
580
+ cache: false,
581
+ data: jQuery(this).closest("form").serialize() + '&sched_type=5' + '&b2s_security_nonce=' + jQuery('#b2s_security_nonce').val(),
582
+ success: function (data) {
583
+ if (data.error == 'nonce') {
584
+ jQuery('.b2s-nonce-check-fail').show();
585
+ }
586
+ jQuery('#b2s-edit-event-modal-' + id).modal('hide');
587
+ jQuery('#b2s-edit-event-modal-' + id).remove();
588
+ jQuery('body').removeClass('modal-open');
589
+ jQuery('body').removeAttr('style');
590
+ if (data.date != "") {
591
+ jQuery('.b2s-post-sched-area-sched-time[data-post-id="' + id + '"]').html(data.date);
592
+ }
593
+ jQuery('.b2s-post-edit-success').show();
594
+ wp.heartbeat.connectNow();
595
+ }
596
+ });
597
+ });
598
+ jQuery(document).on("click", ".release_locks", function () {
599
+ jQuery.ajax({
600
+ url: ajaxurl,
601
+ type: "POST",
602
+ cache: false,
603
+ async: false,
604
+ data: {
605
+ 'action': 'b2s_get_calendar_release_locks',
606
+ 'post_id': jQuery('#post_id').val(),
607
+ 'b2s_security_nonce': jQuery('#b2s_security_nonce').val()
608
+ },
609
+ success: function (data) {
610
+ if (data.error == 'nonce') {
611
+ jQuery('.b2s-nonce-check-fail').show();
612
+ }
613
+ wp.heartbeat.connectNow();
614
+ }
615
+ });
616
+ });
617
+
618
+ function showFilter(typ) {
619
+ if (typ == 'show') {
620
+ jQuery('.filterShow').hide();
621
+ jQuery('.form-inline').show();
622
+ jQuery('.filterHide').show();
623
+ } else {
624
+ jQuery('.filterShow').show();
625
+ jQuery('.form-inline').hide();
626
+ jQuery('.filterHide').hide();
627
+ }
628
+ }
629
+
630
+ function padDate(n) {
631
+ return ("0" + n).slice(-2);
632
+ }
633
+
634
+
635
+ function checkSchedDateTime() {
636
+ var dateElement = '#b2s-change-date';
637
+ var timeElement = '#b2s-change-time';
638
+ var dateStr = jQuery(dateElement).val();
639
+ var minStr = jQuery(timeElement).val();
640
+ var timeZone = parseInt(jQuery('#user_timezone').val()) * (-1);
641
+
642
+ if (jQuery('#b2sUserLang').val() == 'de') {
643
+ dateStr = dateStr.substring(6, 10) + '-' + dateStr.substring(3, 5) + '-' + dateStr.substring(0, 2);
644
+ } else {
645
+ var minParts = minStr.split(' ');
646
+ var minParts2 = minParts[0].split(':');
647
+ if (minParts[1] == 'PM') {
648
+ minParts2[0] = parseInt(minParts2[0]) + 12;
649
+ }
650
+ minStr = minParts2[0] + ':' + minParts2[1];
651
+ }
652
+
653
+ var minParts3 = minStr.split(':');
654
+ if (minParts3[0] < 10) {
655
+ minParts3[0] = '0' + minParts3[0];
656
+ }
657
+ var dateParts = dateStr.split('-');
658
+
659
+ //utc current time
660
+ var now = new Date();
661
+ //offset between utc und user
662
+ var offset = (parseInt(now.getTimezoneOffset() / 60)) * (-1);
663
+ //enter hour to user time
664
+ var hour = parseInt(minParts3[0]) + timeZone + offset;
665
+ //calculate datetime in utc
666
+ var enter = new Date(dateParts[0], dateParts[1] - 1, dateParts[2], hour, minParts3[1]);
667
+ //compare enter date time with allowed user time
668
+ if (enter.getTime() < now.getTime()) {
669
+ //enter set on next 15 minutes and calculate on user timezone
670
+ enter.setTime(now.getTime() + (900000 - (now.getTime() % 900000)) - (3600000 * (timeZone + offset)));
671
+ jQuery(dateElement).datepicker('update', enter);
672
+ jQuery(timeElement).timepicker('setTime', enter);
673
+ }
674
+ }
675
+
676
+ jQuery(document).on('click', '.b2s-sched-calendar-btn', function () {
677
+ if (jQuery('#b2s-sched-calendar-area').is(":visible")) {
678
+ jQuery('#b2s-sched-calendar-btn-text').text(jQuery(this).attr('data-show-calendar-btn-title'));
679
+ jQuery('#b2s-sched-calendar-area').hide();
680
+ } else {
681
+ jQuery('#b2s-sched-calendar-btn-text').text(jQuery(this).attr('data-hide-calendar-btn-title'));
682
+ jQuery('#b2s-sched-calendar-area').show();
683
+ }
684
+ });
685
+
686
+ //Overlay second modal
687
+ jQuery('#b2s-network-select-image').on('hidden.bs.modal', function () {
688
+ jQuery('body').addClass('modal-open');
689
+ });
690
+ //Overlay second modal
691
+ jQuery('#b2s-post-ship-item-post-format-modal').on('hidden.bs.modal', function () {
692
+ jQuery('body').addClass('modal-open');
693
+ });
694
+ jQuery('#b2s-info-change-meta-tag-modal').on('hidden.bs.modal', function () {
695
+ jQuery('body').addClass('modal-open');
696
+ });
697
+
698
+ //Modal Edit Post close
699
+ jQuery(document).on('click', '.b2s-modal-close-edit-post', function (e) {
700
+ jQuery(jQuery(this).attr('data-modal-name')).remove();
701
+ return false;
702
+ });
703
+
704
+ jQuery(document).on('click', '.b2sTwitterInfoModalBtn', function () {
705
+ jQuery('#b2sTwitterInfoModal').modal('show');
706
+ });
707
+
708
+ jQuery(document).on('click', '.b2s-re-post-submit-premium', function () {
709
+ jQuery('#b2sInfoRePosterModal').modal('show');
710
+ });
711
+
712
+ jQuery(document).on('change', '.b2s-re-post-type', function() {
713
+ if(jQuery(this).val() == null) {
714
+ jQuery('.b2s-re-post-type-active').prop('checked', false);
715
+ } else {
716
+ jQuery('.b2s-re-post-type-active').prop('checked', true);
717
+ }
718
+ });
719
+
720
+ jQuery(document).on('change', '.b2s-re-post-categories', function() {
721
+ if(jQuery(this).val() == null) {
722
+ jQuery('.b2s-re-post-categories-active').prop('checked', false);
723
+ } else {
724
+ jQuery('.b2s-re-post-categories-active').prop('checked', true);
725
+ }
726
+ });
727
+
728
+ jQuery(document).on('change', '.b2s-re-post-author', function() {
729
+ if(jQuery(this).val() == null) {
730
+ jQuery('.b2s-re-post-author-active').prop('checked', false);
731
+ } else {
732
+ jQuery('.b2s-re-post-author-active').prop('checked', true);
733
+ }
734
+ });
735
+
736
+ jQuery(document).on('change', '.b2s-re-post-date-start', function() {
737
+ if(jQuery('.b2s-re-post-date-start').val() == "" && jQuery('.b2s-re-post-date-end').val() == "") {
738
+ jQuery('.b2s-re-post-date-active').prop('checked', false);
739
+ } else {
740
+ jQuery('.b2s-re-post-date-active').prop('checked', true);
741
+ }
742
+ jQuery('.b2s-re-post-date-start').removeClass('error');
743
+ });
744
+
745
+ jQuery(document).on('change', '.b2s-re-post-date-end', function() {
746
+ if(jQuery('.b2s-re-post-date-start').val() == "" && jQuery('.b2s-re-post-date-end').val() == "") {
747
+ jQuery('.b2s-re-post-date-active').prop('checked', false);
748
+ } else {
749
+ jQuery('.b2s-re-post-date-active').prop('checked', true);
750
+ }
751
+ jQuery('.b2s-re-post-date-end').removeClass('error');
752
+ });
assets/js/b2s/settings.js CHANGED
@@ -17,21 +17,7 @@ jQuery(window).on("load", function () {
17
jQuery("." + b2sShowSection).trigger("click");
18
}
19
jQuery(".b2s-import-auto-post-type").chosen();
20
-
21
- jQuery('.b2s-network-item-auth-list[data-network-count="true"]').each(function () {
22
- jQuery('.b2s-network-auth-count-current[data-network-id="' + jQuery(this).attr("data-network-id") + '"').text(jQuery(this).children('li').length);
23
- });
24
-
25
- var length = jQuery('.b2s-post-type-item-update').filter(':checked').length;
26
- if (length > 0) {
27
- jQuery('.b2s-auto-post-own-update-warning').show();
28
- }
29
-
30
- //TOS Twitter 032018 - none multiple Accounts - User select once
31
- checkNetworkTos(2);
32
33
- jQuery('#b2s-auto-post-profil-dropdown').trigger('change');
34
-
35
});
36
37
jQuery('.b2sSaveSocialMetaTagsSettings').validate({
@@ -86,40 +72,6 @@ jQuery('.b2sSaveSocialMetaTagsSettings').validate({
86
}
87
});
88
89
- //TOS Twitter 032018 - none multiple Accounts - User select once
90
- jQuery(document).on('change', '.b2s-network-tos-check', function () {
91
- var networkId = jQuery(this).attr('data-network-id');
92
- if (networkId == 2) {
93
- checkNetworkTos(networkId, false);
94
- }
95
- return false;
96
- });
97
-
98
- //TOS Twitter 032018 - none multiple Accounts - User select once
99
- function checkNetworkTos(networkId) {
100
- var len = jQuery('.b2s-network-tos-check[data-network-id="' + networkId + '"]:checked').length;
101
- if (len > 1) {
102
- jQuery('.b2s-network-tos-auto-post-import-warning').show();
103
- jQuery('#b2s-auto-post-settings-btn').attr('disabled', 'disabled');
104
- return false;
105
- } else {
106
- jQuery('.b2s-network-tos-auto-post-import-warning').hide();
107
- jQuery('#b2s-auto-post-settings-btn').attr('disabled', false);
108
- return true;
109
- }
110
- }
111
-
112
- jQuery(document).on('change', '.b2s-post-type-item-update', function () {
113
- var length = jQuery('.b2s-post-type-item-update').filter(':checked').length;
114
- if (length == 0) {
115
- jQuery('.b2s-auto-post-own-update-warning').hide();
116
- } else {
117
- jQuery('.b2s-auto-post-own-update-warning').show();
118
- }
119
- return false;
120
- });
121
-
122
-
123
jQuery(document).on('click', '.b2sClearSocialMetaTags', function () {
124
125
jQuery('.b2s-settings-user-success').hide();
@@ -284,115 +236,6 @@ jQuery(document).on('click', '.b2s-shortener-account-delete-btn', function () {
284
return false;
285
});
286
287
- jQuery('#b2s-user-network-settings-auto-post-own').validate({
288
- ignore: "",
289
- errorPlacement: function () {
290
- return false;
291
- },
292
- submitHandler: function (form) {
293
- jQuery('.b2s-settings-user-success').hide();
294
- jQuery('.b2s-settings-user-error').hide();
295
- jQuery(".b2s-loading-area").show();
296
- jQuery(".b2s-user-settings-area").hide();
297
- jQuery('.b2s-server-connection-fail').hide();
298
- jQuery.ajax({
299
- processData: false,
300
- url: ajaxurl,
301
- type: "POST",
302
- dataType: "json",
303
- cache: false,
304
- data: jQuery(form).serialize() + '&b2s_security_nonce=' + jQuery('#b2s_security_nonce').val(),
305
- error: function () {
306
- jQuery('.b2s-server-connection-fail').show();
307
- return false;
308
- },
309
- success: function (data) {
310
- jQuery(".b2s-loading-area").hide();
311
- jQuery(".b2s-user-settings-area").show();
312
- if (data.result == true) {
313
- jQuery('.b2s-settings-user-success').show();
314
- } else {
315
- if(data.error == 'nonce') {
316
- jQuery('.b2s-nonce-check-fail').show();
317
- }
318
- jQuery('.b2s-settings-user-error').show();
319
- }
320
- }
321
- });
322
- return false;
323
- }
324
- });
325
-
326
- jQuery('#b2s-user-network-settings-auto-post-imported-own').validate({
327
- ignore: "",
328
- errorPlacement: function () {
329
- return false;
330
- },
331
- submitHandler: function (form) {
332
- jQuery('.b2s-settings-user-success').hide();
333
- jQuery('.b2s-settings-user-error').hide();
334
- jQuery('.b2s-settings-user-error-no-auth-selected').hide();
335
- jQuery(".b2s-loading-area").show();
336
- jQuery(".b2s-user-settings-area").hide();
337
- jQuery('.b2s-server-connection-fail').hide();
338
- jQuery.ajax({
339
- processData: false,
340
- url: ajaxurl,
341
- type: "POST",
342
- dataType: "json",
343
- cache: false,
344
- data: jQuery(form).serialize() + '&b2s_security_nonce=' + jQuery('#b2s_security_nonce').val(),
345
- error: function () {
346
- jQuery('.b2s-server-connection-fail').show();
347
- return false;
348
- },
349
- success: function (data) {
350
- jQuery(".b2s-loading-area").hide();
351
- jQuery(".b2s-user-settings-area").show();
352
- if (data.result == true) {
353
- jQuery('.b2s-settings-user-success').show();
354
- } else {
355
- if(data.error == 'nonce') {
356
- jQuery('.b2s-nonce-check-fail').show();
357
- }
358
- if (data.type == 'no-auth-selected') {
359
- jQuery('.b2s-settings-user-error-no-auth-selected').show();
360
-
361
- } else {
362
- jQuery('.b2s-settings-user-error').show();
363
- }
364
- }
365
- }
366
- });
367
- return false;
368
- }
369
- });
370
-
371
-
372
-
373
-
374
- jQuery(document).on('click', '.b2s-post-type-select-btn', function () {
375
- var type = jQuery(this).attr('data-post-type');
376
- var tempCurText = jQuery(this).text();
377
- if (jQuery(this).attr('data-select-toogle-state') == "0") { //0=select
378
- jQuery('.b2s-post-type-item-' + type).prop('checked', true);
379
- jQuery(this).attr('data-select-toogle-state', '1');
380
- if (type == 'update') {
381
- jQuery('.b2s-auto-post-own-update-warning').show();
382
- }
383
- } else {
384
- jQuery('.b2s-post-type-item-' + type).prop('checked', false);
385
- jQuery(this).attr('data-select-toogle-state', '0');
386
- if (type == 'update') {