Blog2Social: Social Media Auto Post & Scheduler - Version 4.7.0

Version Description

Usability Optimization

Download this release

Release Info

Developer Blog2Social
Plugin Icon 128x128 Blog2Social: Social Media Auto Post & Scheduler
Version 4.7.0
Comparing to
See all releases

Code changes from version 4.6.0 to 4.7.0

Files changed (51) hide show
  1. assets/css/b2s/network.css +44 -3
  2. assets/css/b2s/post.css +1 -1
  3. assets/css/b2s/post.sched.css +186 -5
  4. assets/css/b2s/settings.css +7 -0
  5. assets/css/b2s/ship.css +8 -0
  6. assets/css/b2s/wp/post-box.css +3 -0
  7. assets/css/general.css +9 -0
  8. assets/js/b2s/calendar.js +39 -30
  9. assets/js/b2s/general.js +1 -0
  10. assets/js/b2s/howto.js +35 -0
  11. assets/js/b2s/network.js +87 -0
  12. assets/js/b2s/network.tos.js +26 -0
  13. assets/js/b2s/post.js +173 -119
  14. assets/js/b2s/settings.js +26 -0
  15. assets/js/b2s/ship.js +92 -96
  16. assets/js/b2s/start.js +2 -2
  17. assets/js/b2s/wp/post-box.js +41 -13
  18. blog2social.php +2 -2
  19. includes/Ajax/Get.php +22 -8
  20. includes/Ajax/Post.php +43 -55
  21. includes/B2S/Network/Item.php +45 -25
  22. includes/B2S/Post/Item.php +11 -10
  23. includes/B2S/PostBox.php +18 -3
  24. includes/B2S/Rating.php +1 -1
  25. includes/B2S/Settings/Item.php +14 -7
  26. includes/B2S/Ship/Item.php +15 -6
  27. includes/B2S/Ship/Save.php +12 -9
  28. includes/Form.php +11 -0
  29. includes/Loader.php +79 -51
  30. includes/Meta.php +67 -44
  31. includes/Tools.php +15 -2
  32. languages/blog2social-de_DE.mo +0 -0
  33. languages/blog2social-de_DE.po +1411 -1183
  34. readme.txt +6 -2
  35. views/b2s/dashboard.php +4 -1
  36. views/b2s/howto.php +3 -1
  37. views/b2s/html/footer.phtml +3 -5
  38. views/b2s/html/header.phtml +76 -28
  39. views/b2s/network.php +33 -2
  40. views/b2s/{image.calendar.php → partials/calendar-image-modal.php} +0 -0
  41. views/b2s/partials/network-tos-modal.php +35 -0
  42. views/b2s/{modal.calendar.php → partials/post-edit-modal.php} +7 -6
  43. views/b2s/post.calendar.php +5 -3
  44. views/b2s/post.php +4 -2
  45. views/b2s/post.publish.php +4 -2
  46. views/b2s/post.sched.php +87 -32
  47. views/b2s/premium.php +3 -1
  48. views/b2s/settings.php +3 -1
  49. views/b2s/ship.php +3 -5
  50. views/b2s/widgets/posts.php +1 -1
  51. views/prg/post.php +1 -1
assets/css/b2s/network.css CHANGED
@@ -1,4 +1,12 @@
1
/*Custom*/
2
@media(max-width: 767px) {
3
.form-inline {
4
display: none;
@@ -11,6 +19,13 @@
11
margin-bottom: 10px;
12
}
13
}
14
.error{
15
border: 1px solid #FF0000 !important;
16
}
@@ -45,8 +60,34 @@
45
46
.b2s-network-mandant-name{
47
font-size: 12px;
48
- font-style: italic;
49
- color: #777;
50
- font-weight: normal;
51
52
}
1
/*Custom*/
2
+
3
+ .b2s-loading-area-modify-collection{
4
+ text-align: center;
5
+ }
6
+
7
+ .list-group-item{
8
+ border: 0px !important;
9
+ }
10
@media(max-width: 767px) {
11
.form-inline {
12
display: none;
19
margin-bottom: 10px;
20
}
21
}
22
+
23
+ @media(max-width: 450px) {
24
+ .add-padding-left{
25
+ padding: 0px !important;
26
+ }
27
+ }
28
+
29
.error{
30
border: 1px solid #FF0000 !important;
31
}
60
61
.b2s-network-mandant-name{
62
font-size: 12px;
63
+ font-style: italic;
64
+ color: #777;
65
+ font-weight: normal;
66
+
67
+ }
68
+
69
+ .b2s-network-item-auth-list{
70
+ padding-top:6px;
71
+ font-size: 0.87rem !important;
72
+ }
73
+
74
+ .b2s-network-item-auth-list-li{
75
+ border: 1px solid rgba(0,0,0,.1);
76
+ border-bottom: 0px;
77
+ line-height: 1.5;
78
+ padding: 6px;
79
+ margin-bottom: 0px !important;
80
+ }
81
+
82
+ ul.b2s-network-item-auth-list li:last-child{
83
+ border-bottom: 1px solid rgba(0,0,0,.1) !important;
84
+ }
85
+
86
+
87
+ .b2s-network-item-auth-type{
88
+ font-weight: 600;
89
+ }
90
91
+ .b2s-modify-board-and-group-network-modal-footer{
92
+ border: 0px !important;
93
}
assets/css/b2s/post.css CHANGED
@@ -33,4 +33,4 @@
33
34
.b2s-loading-area{
35
width: 100% !important;
36
- }
33
34
.b2s-loading-area{
35
width: 100% !important;
36
+ }
assets/css/b2s/post.sched.css CHANGED
@@ -15,10 +15,6 @@
15
.media-head {
16
width: 100% !important;
17
}
18
- .grid-body {
19
- margin-bottom: 20px;
20
- width: 100%;
21
- }
22
@media(max-width: 549px) {
23
.b2s-post-btn {
24
width: 100%;
@@ -115,4 +111,189 @@
115
.checbox-item-empty{
116
padding: 15px;
117
float:left;
118
- }
15
.media-head {
16
width: 100% !important;
17
}
18
@media(max-width: 549px) {
19
.b2s-post-btn {
20
width: 100%;
111
.checbox-item-empty{
112
padding: 15px;
113
float:left;
114
+ }
115
+
116
+
117
+
118
+ /**edit post **/
119
+ .network-name{
120
+ font-weight: bold;
121
+ }
122
+ .network-profile{
123
+ margin-bottom: 5px;
124
+ }
125
+ .b2s-post-item-thumb {
126
+ width: 5%;
127
+ margin-right: 8px;
128
+ }
129
+
130
+ .b2s-post-item-thumb img {
131
+ border-radius: 50%;
132
+ width: 48px;
133
+ }
134
+
135
+ .b2s-post-item-details {
136
+ width: 93%;
137
+ }
138
+
139
+ .b2s-post-item-details, .b2s-post-item-thumb {
140
+ float: left;
141
+ }
142
+ .b2s-post-item-details h4 {
143
+ font-size: 16px;
144
+ font-weight: 600;
145
+ text-transform: uppercase;
146
+ margin: 3px 3px 3px 0px;
147
+ }
148
+ .btn-circle {
149
+ width: 30px;
150
+ height: 30px;
151
+ text-align: center;
152
+ padding: 6px 0;
153
+ font-size: 12px;
154
+ line-height: 1.428571429;
155
+ border-radius: 15px;
156
+ }
157
+ .fb-url-image, .xing-url-image, .linkedin-url-image, .tw-url-image, .b2s-image-border {
158
+ margin-right: 10px;
159
+ margin-bottom: 20px;
160
+ border: 1px dashed #bdbfc2;
161
+ box-shadow: none;
162
+ padding: 5px;
163
+ }
164
+ textarea.form-control {
165
+ height: auto;
166
+ }
167
+ .fb-textarea-input, .tw-textarea-input, .xing-textarea-input, .linkedin-textarea-input {
168
+ font-size: 14px;
169
+ font-weight: normal;
170
+ line-height: 1.125;
171
+ width: 100%;
172
+ border: medium none;
173
+ border-radius: 0;
174
+ margin-top: 10px;
175
+ margin-bottom: 10px;
176
+ font-family: helvetica,arial,sans-serif;
177
+ }
178
+ .b2s-post-item-details-item-message-input{
179
+ min-height: 100px;
180
+ }
181
+ .b2s-post-item-details-url-image{
182
+ cursor: pointer;
183
+ }
184
+ .b2s-user-network-settings-post-format-area label > input {
185
+ visibility: hidden;
186
+ position: absolute;
187
+ }
188
+ .b2s-settings-checked + img {
189
+ border: 3px solid #79b232 !important;
190
+ }
191
+ .b2s-image-item {
192
+ background-color: #fff;
193
+ border: 1px solid #ddd;
194
+ display: block;
195
+ float: left;
196
+ height: 200px;
197
+ line-height: 1.42857;
198
+ margin-bottom: 15px;
199
+ margin-left: 15px;
200
+ margin-top: 15px;
201
+ overflow: hidden;
202
+ padding: 4px;
203
+ transition: border 0.2s ease-in-out 0s;
204
+ width: 185px;
205
+ }
206
+ .b2s-image-item-thumb {
207
+ height: 150px;
208
+ }
209
+ .b2s-image-change-all-network,.b2s-upload-image-free-version,.b2s-image-change-this-network{
210
+ margin-right: 5px !important;
211
+ }
212
+ .b2s-image-remove-btn {
213
+ position: absolute;
214
+ top: -5px;
215
+ right: 0px;
216
+ font-weight: 700 !important;
217
+ }
218
+ .b2s-calendar-delete{
219
+ cursor: pointer;
220
+ }
221
+ .b2s-btn-label-premium{
222
+ color: #fff;
223
+ text-decoration: none !important;
224
+ cursor: default !important;
225
+ }
226
+ .b2s-btn-label-premium:hover{
227
+ color: #fff;
228
+ text-decoration: none !important;
229
+ cursor: default !important;
230
+ }
231
+ .b2s-post-item .label-success{
232
+ display: none;
233
+ }
234
+ .og_title, .og_desc, .card_desc, .card_title, .b2s-post-item-details-item-title-input, .b2s-select{
235
+ margin-bottom: 8px !important;
236
+ }
237
+
238
+ .b2s-post-item-info-area {
239
+ font-size: 11px !important;
240
+ }
241
+
242
+ .b2s-post-ship-item-full-text, .b2s-post-ship-item-message-delete, .b2s-post-ship-item-network-settings, .b2s-post-ship-item-post-format{
243
+ line-height: 1.5 !important;
244
+ padding: 0 1px 3px !important;
245
+ }
246
+
247
+ .b2s-load-info-meta-tag-modal{
248
+ margin-top: 8px !important;
249
+ display: block !important;
250
+ margin-right: auto !important;
251
+ margin-left: auto !important;
252
+ }
253
+
254
+ .b2s-post-item-details-tag-add-div {
255
+ border: 0px !important;
256
+ box-shadow: 0px 0px 0px #000 !important;
257
+ }
258
+
259
+ .b2s-post-item-details-tag-input-elem {
260
+ margin: 2px 4px;
261
+ max-width: 145px !important;
262
+ }
263
+ .b2s-calendar-sched-post-btn{
264
+ font-size: 11px;
265
+ float: right;
266
+ padding: 2px 4px 0px 4px;
267
+ }
268
+
269
+
270
+ .form-inline {
271
+ width: 100%;
272
+ margin-bottom: 20px;
273
+ }
274
+ .form-inline .form-group {
275
+ margin-left: 2px;
276
+ }
277
+
278
+ @media(max-width: 549px) {
279
+ .b2s-post-btn {
280
+ width: 100%;
281
+ }
282
+ .form-inline button, .form-inline a {
283
+ width: 100%;
284
+ margin-bottom: 10px;
285
+ }
286
+ }
287
+ @media(max-width: 767px) {
288
+ .form-inline {
289
+ display: none;
290
+ }
291
+ .filterHide {
292
+ display: none;
293
+ }
294
+ .form-inline button ,.form-inline a {
295
+ width: 49%;
296
+ margin-bottom: 10px;
297
+ }
298
+ }
299
+
assets/css/b2s/settings.css CHANGED
@@ -125,3 +125,10 @@ ul.chosen-choices {
125
.b2s-auto-post-own-update-warning{
126
border: 1px solid #aaa !important;
127
}
125
.b2s-auto-post-own-update-warning{
126
border: 1px solid #aaa !important;
127
}
128
+
129
+ .b2s-network-tos-auto-post-import-warning{
130
+ display: none;
131
+ }
132
+ .b2s-network-tos-auto-post-import-warning > .alert{
133
+ margin-bottom: 0px !important;
134
+ }
assets/css/b2s/ship.css CHANGED
@@ -802,4 +802,12 @@ input[type="checkbox"], input[type="radio"] {
802
803
input[type="number"]{
804
height: 34px !important;
805
}
802
803
input[type="number"]{
804
height: 34px !important;
805
+ }
806
+
807
+ .b2s-unique-content{
808
+ display: none;
809
+ }
810
+
811
+ .b2s-unique-content-alert, .b2s-network-tos-sched-alert{
812
+ margin-bottom: 0px !important;
813
}
assets/css/b2s/wp/post-box.css CHANGED
@@ -244,4 +244,7 @@
244
245
}
246
247
244
245
}
246
247
+ #b2s-post-meta-box-profil-dropdown-twitter option:disabled {
248
+ color: #ff4f68;
249
+ }
250
assets/css/general.css CHANGED
@@ -7200,3 +7200,12 @@ input[type="checkbox"].error + label{
7200
opacity: 0.5;
7201
}
7202
7200
opacity: 0.5;
7201
}
7202
7203
+ .b2s-glyphicon-xl{
7204
+ font-size: 50px;
7205
+ }
7206
+ .b2s-text-xl{
7207
+ font-size: 18px;
7208
+ }
7209
+ .b2s-text-bold{
7210
+ font-weight: 600;
7211
+ }
assets/js/b2s/calendar.js CHANGED
@@ -61,7 +61,7 @@ jQuery(document).ready(function () {
61
return dropLocation.start.isAfter(b2s_calendar_date) && draggedEvent.start.isAfter(b2s_calendar_datetime);
62
},
63
eventClick: function (calEvent, jsEvent, view) {
64
- showEditPostPreview(calEvent.b2s_id, calEvent.post_id, calEvent.network_auth_id, calEvent.network_type, calEvent.network_id, calEvent.post_format);
65
},
66
loading: function (bool) {
67
if (!bool) {
@@ -79,7 +79,7 @@ jQuery(document).ready(function () {
79
});
80
81
82
- function showEditPostPreview(b2s_id, post_id, network_auth_id, network_type, network_id, post_format) {
83
if (jQuery('#b2s-edit-event-modal-' + b2s_id).length == 1)
84
{
85
jQuery('#b2s-edit-event-modal-' + b2s_id).remove();
@@ -92,7 +92,7 @@ function showEditPostPreview(b2s_id, post_id, network_auth_id, network_type, net
92
cache: false,
93
async: false,
94
data: {
95
- 'action': 'b2s_get_calendar_edit_modal',
96
'id': b2s_id
97
},
98
success: function (data) {
@@ -118,8 +118,8 @@ function showEditPostPreview(b2s_id, post_id, network_auth_id, network_type, net
118
jQuery('.b2s-user-network-settings-post-format[data-network-type="' + network_type + '"][data-network-id="' + network_id + '"]').removeClass('b2s-settings-checked');
119
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');
120
} else {
121
- jQuery('.b2s-post-ship-item-post-format-text[data-network-auth-id="' + calEvent.network_auth_id + '"]').html(postFormatText[postFormatType][jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + calEvent.network_type + '"][data-network-id="' + calEvent.network_id + '"]').val()]);
122
- jQuery('.b2s-post-item-details-post-format[data-network-auth-id="' + calEvent.network_auth_id + '"]').val(jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + calEvent.network_type + '"][data-network-id="' + calEvent.network_id + '"]').val());
123
}
124
125
//if linkpost then show btn meta tags
@@ -133,7 +133,8 @@ function showEditPostPreview(b2s_id, post_id, network_auth_id, network_type, net
133
if (isMetaChecked && jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + network_type + '"][data-network-id="' + network_id + '"]').val() == "0") {
134
jQuery('.b2s-post-item-details-preview-title[data-network-auth-id="' + network_auth_id + '"]').prop("readonly", false);
135
jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + network_auth_id + '"]').prop("readonly", false);
136
- jQuery('.b2s-post-item-details-preview-url-reload[data-network-id="' + network_id + '"]').hide();
137
var dataMetaType = jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + network_auth_id + '"]').attr("data-meta-type");
138
if (dataMetaType == "og") {
139
jQuery('.b2sChangeOgMeta[data-network-auth-id="' + network_auth_id + '"]').val("1");
@@ -144,8 +145,7 @@ function showEditPostPreview(b2s_id, post_id, network_auth_id, network_type, net
144
} else {
145
jQuery('.b2s-post-item-details-preview-title[data-network-auth-id="' + network_auth_id + '"]').prop("readonly", true);
146
jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + network_auth_id + '"]').prop("readonly", true);
147
- jQuery('.b2s-post-item-details-preview-url-reload[data-network-id="' + network_id + '"]').show();
148
- jQuery('.b2s-post-item-details-preview-url-reload[data-network-id="' + network_id + '"]').trigger("click");
149
}
150
151
@@ -367,6 +367,15 @@ function b2sSortFormSubmit() {
367
return false;
368
}
369
370
371
jQuery(document).on('click', '.b2s-select-image-modal-open', function () {
372
jQuery('.b2s-network-select-image-content').html("");
@@ -398,7 +407,7 @@ jQuery(document).on('click', '.b2s-select-image-modal-open', function () {
398
jQuery('#b2s-network-select-image').modal('show');
399
return false;
400
});
401
- jQuery(document).on("click", ".b2s-calendar-delete", function () {
402
var id = jQuery(this).data("b2s-id");
403
var post_id = jQuery(this).data("post-id");
404
jQuery.ajax({
@@ -407,7 +416,7 @@ jQuery(document).on("click", ".b2s-calendar-delete", function () {
407
dataType: "json",
408
cache: false,
409
data: {
410
- 'action': 'b2s_calendar_delete',
411
'b2s_id': id,
412
'post_id': post_id
413
},
@@ -419,26 +428,26 @@ jQuery(document).on("click", ".b2s-calendar-delete", function () {
419
});
420
});
421
422
- jQuery(document).on("click", ".b2s-calendar-save-all", function (e) {
423
- jQuery('#save_method').val("apply-all");
424
- e.preventDefault();
425
- var id = jQuery(this).data("b2s-id");
426
- jQuery.ajax({
427
- url: ajaxurl,
428
- type: "POST",
429
- dataType: "json",
430
- cache: false,
431
- data: jQuery(this).closest("form").serialize(),
432
- success: function (data) {
433
- jQuery('#b2s-edit-event-modal-' + id).modal('hide');
434
- refreshCalender();
435
- jQuery('#b2s-edit-event-modal-' + id).remove();
436
- wp.heartbeat.connectNow();
437
- }
438
- });
439
- });
440
-
441
- jQuery(document).on("click", ".b2s-calendar-save-this", function (e) {
442
e.preventDefault();
443
jQuery('#save_method').val("apply-this");
444
var id = jQuery(this).data("b2s-id");
61
return dropLocation.start.isAfter(b2s_calendar_date) && draggedEvent.start.isAfter(b2s_calendar_datetime);
62
},
63
eventClick: function (calEvent, jsEvent, view) {
64
+ showEditSchedCalendarPost(calEvent.b2s_id, calEvent.post_id, calEvent.network_auth_id, calEvent.network_type, calEvent.network_id, calEvent.post_format);
65
},
66
loading: function (bool) {
67
if (!bool) {
79
});
80
81
82
+ function showEditSchedCalendarPost(b2s_id, post_id, network_auth_id, network_type, network_id, post_format) {
83
if (jQuery('#b2s-edit-event-modal-' + b2s_id).length == 1)
84
{
85
jQuery('#b2s-edit-event-modal-' + b2s_id).remove();
92
cache: false,
93
async: false,
94
data: {
95
+ 'action': 'b2s_get_post_edit_modal',
96
'id': b2s_id
97
},
98
success: function (data) {
118
jQuery('.b2s-user-network-settings-post-format[data-network-type="' + network_type + '"][data-network-id="' + network_id + '"]').removeClass('b2s-settings-checked');
119
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');
120
} else {
121
+ 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()]);
122
+ 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());
123
}
124
125
//if linkpost then show btn meta tags
133
if (isMetaChecked && jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + network_type + '"][data-network-id="' + network_id + '"]').val() == "0") {
134
jQuery('.b2s-post-item-details-preview-title[data-network-auth-id="' + network_auth_id + '"]').prop("readonly", false);
135
jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + network_auth_id + '"]').prop("readonly", false);
136
+ jQuery('.b2s-post-item-details-preview-url-reload[data-network-id="' + network_id + '"]').show();
137
+ jQuery('.b2s-post-item-details-preview-url-reload[data-network-id="' + network_id + '"]').trigger("click");
138
var dataMetaType = jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + network_auth_id + '"]').attr("data-meta-type");
139
if (dataMetaType == "og") {
140
jQuery('.b2sChangeOgMeta[data-network-auth-id="' + network_auth_id + '"]').val("1");
145
} else {
146
jQuery('.b2s-post-item-details-preview-title[data-network-auth-id="' + network_auth_id + '"]').prop("readonly", true);
147
jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + network_auth_id + '"]').prop("readonly", true);
148
+ jQuery('.b2s-post-item-details-preview-url-reload[data-network-id="' + network_id + '"]').hide();
149
}
150
151
367
return false;
368
}
369
370
+ //Overlay second modal
371
+ jQuery('#b2s-network-select-image').on('hidden.bs.modal', function () {
372
+ jQuery('body').addClass('modal-open');
373
+ });
374
+
375
+ //Overlay second modal
376
+ jQuery('#b2s-post-ship-item-post-format-modal').on('hidden.bs.modal', function () {
377
+ jQuery('body').addClass('modal-open');
378
+ });
379
380
jQuery(document).on('click', '.b2s-select-image-modal-open', function () {
381
jQuery('.b2s-network-select-image-content').html("");
407
jQuery('#b2s-network-select-image').modal('show');
408
return false;
409
});
410
+ jQuery(document).on("click", ".b2s-edit-post-delete", function () {
411
var id = jQuery(this).data("b2s-id");
412
var post_id = jQuery(this).data("post-id");
413
jQuery.ajax({
416
dataType: "json",
417
cache: false,
418
data: {
419
+ 'action': 'b2s_delete_post',
420
'b2s_id': id,
421
'post_id': post_id
422
},
428
});
429
});
430
431
+ /*jQuery(document).on("click", ".b2s-calendar-save-all", function (e) {
432
+ jQuery('#save_method').val("apply-all");
433
+ e.preventDefault();
434
+ var id = jQuery(this).data("b2s-id");
435
+ jQuery.ajax({
436
+ url: ajaxurl,
437
+ type: "POST",
438
+ dataType: "json",
439
+ cache: false,
440
+ data: jQuery(this).closest("form").serialize(),
441
+ success: function (data) {
442
+ jQuery('#b2s-edit-event-modal-' + id).modal('hide');
443
+ refreshCalender();
444
+ jQuery('#b2s-edit-event-modal-' + id).remove();
445
+ wp.heartbeat.connectNow();
446
+ }
447
+ });
448
+ });*/
449
+
450
+ jQuery(document).on("click", ".b2s-edit-post-save-this", function (e) {
451
e.preventDefault();
452
jQuery('#save_method').val("apply-this");
453
var id = jQuery(this).data("b2s-id");
assets/js/b2s/general.js CHANGED
@@ -63,6 +63,7 @@ jQuery(document).on('click', '.b2s-key-area-btn-submit', function () {
63
return false;
64
},
65
success: function (data) {
66
jQuery('.b2s-key-area-btn-submit').prop('disabled', false);
67
jQuery('.b2s-trail-premium-info-area').hide();
68
if (data.result == true) {
63
return false;
64
},
65
success: function (data) {
66
+ jQuery('#b2sInfoKeyModal').modal('show');
67
jQuery('.b2s-key-area-btn-submit').prop('disabled', false);
68
jQuery('.b2s-trail-premium-info-area').hide();
69
if (data.result == true) {
assets/js/b2s/howto.js ADDED
@@ -0,0 +1,35 @@
1
+ jQuery.noConflict();
2
+
3
+
4
+ jQuery(document).ready(function () {
5
+ getWidgetFaq();
6
+
7
+ });
8
+
9
+ function getWidgetFaq() {
10
+ jQuery('.b2s-faq-area').show();
11
+ if (typeof wp.heartbeat == "undefined") {
12
+ jQuery('#b2s-heartbeat-fail').show();
13
+ }
14
+ jQuery.ajax({
15
+ url: ajaxurl,
16
+ type: "POST",
17
+ dataType: "json",
18
+ cache: false,
19
+ data: {
20
+ 'action': 'b2s_get_faq_entries'
21
+ },
22
+ error: function () {
23
+ jQuery('.b2s-faq-area').hide();
24
+ return false;
25
+ },
26
+ success: function (data) {
27
+ if (data.result == true) {
28
+ jQuery('.b2s-loading-area-faq').hide();
29
+ jQuery('.b2s-faq-content').html(data.content);
30
+ } else {
31
+ jQuery('.b2s-faq-area').hide();
32
+ }
33
+ }
34
+ });
35
+ }
assets/js/b2s/network.js CHANGED
@@ -69,6 +69,93 @@ jQuery(document).on('click', '.b2s-btn-network-delete-mandant-confirm', function
69
return false;
70
});
71
72
jQuery(document).on('click', '.b2s-network-item-auth-list-btn-delete', function () {
73
jQuery('.b2s-loading-area').show();
74
jQuery('.b2s-network-auth-info').hide();
69
return false;
70
});
71
72
+
73
+ jQuery(document).on('click', '.b2s-modify-board-and-group-network-btn', function () {
74
+
75
+ jQuery('.b2s-modify-board-and-group-network-loading-area').show();
76
+ jQuery('.b2s-network-auth-info').hide();
77
+ jQuery('#b2s-modify-board-and-group-network-modal').modal('show');
78
+ jQuery('#b2s-modify-board-and-group-network-modal-title').html(jQuery(this).attr('data-modal-title'));
79
+ jQuery('#b2s-modify-board-and-group-network-auth-id').val(jQuery(this).attr('data-network-auth-id'));
80
+ jQuery('#b2s-modify-board-and-group-network-id').val(jQuery(this).attr('data-network-id'));
81
+ jQuery('#b2s-modify-board-and-group-network-type').val(jQuery(this).attr('data-network-type'));
82
+ jQuery('.b2s-server-connection-fail').hide();
83
+ jQuery('.b2s-modify-board-and-group-network-save-btn').hide();
84
+ jQuery('#b2s-modify-board-and-group-network-no-data').hide();
85
+ jQuery('.b2s-modify-board-and-group-network-data').html("");
86
+ jQuery('.b2s-modify-board-and-group-network-data').show();
87
+ jQuery('#b2s-modify-board-and-group-network-save-success').hide();
88
+ jQuery('#b2s-modify-board-and-group-network-save-error').hide();
89
+
90
+ jQuery.ajax({
91
+ url: ajaxurl,
92
+ type: "POST",
93
+ dataType: "json",
94
+ cache: false,
95
+ data: {
96
+ 'action': 'b2s_get_network_board_and_group',
97
+ 'networkAuthId': jQuery(this).attr('data-network-auth-id'),
98
+ 'networkType': jQuery(this).attr('data-network-type'),
99
+ 'networkId': jQuery(this).attr('data-network-id'),
100
+ 'lang': jQuery('#b2sUserLang').val()
101
+ },
102
+ error: function () {
103
+ jQuery('.b2s-server-connection-fail').show();
104
+ return false;
105
+ },
106
+ success: function (data) {
107
+ jQuery('.b2s-modify-board-and-group-network-loading-area').hide();
108
+ if (data.result == true) {
109
+ jQuery('.b2s-modify-board-and-group-network-data').html(data.content);
110
+ jQuery('.b2s-modify-board-and-group-network-save-btn').show();
111
+ } else {
112
+ jQuery('#b2s-modify-board-and-group-network-no-data').show();
113
+ }
114
+ }
115
+ });
116
+ return false;
117
+
118
+ });
119
+
120
+
121
+ jQuery(document).on('click', '.b2s-modify-board-and-group-network-save-btn', function () {
122
+
123
+ jQuery('.b2s-modify-board-and-group-network-save-btn').hide();
124
+ jQuery('.b2s-modify-board-and-group-network-data').hide();
125
+ jQuery('.b2s-modify-board-and-group-network-loading-area').show();
126
+
127
+ jQuery.ajax({
128
+ url: ajaxurl,
129
+ type: "POST",
130
+ dataType: "json",
131
+ cache: false,
132
+ data: {
133
+ 'action': 'b2s_save_network_board_and_group',
134
+ 'networkAuthId': jQuery('#b2s-modify-board-and-group-network-auth-id').val(),
135
+ 'networkType': jQuery('#b2s-modify-board-and-group-network-type').val(),
136
+ 'networkId': jQuery('#b2s-modify-board-and-group-network-id').val(),
137
+ 'boardAndGroup': jQuery('#b2s-modify-board-and-group-network-selected').val(),
138
+ 'lang': jQuery('#b2sUserLang').val()
139
+ },
140
+ error: function () {
141
+ jQuery('.b2s-server-connection-fail').show();
142
+ return false;
143
+ },
144
+ success: function (data) {
145
+ jQuery('.b2s-modify-board-and-group-network-loading-area').hide();
146
+ if (data.result == true) {
147
+ jQuery('#b2s-modify-board-and-group-network-save-success').show();
148
+ } else {
149
+ jQuery('#b2s-modify-board-and-group-network-save-error').show();
150
+ }
151
+ }
152
+ });
153
+ return false;
154
+ });
155
+
156
+
157
+
158
+
159
jQuery(document).on('click', '.b2s-network-item-auth-list-btn-delete', function () {
160
jQuery('.b2s-loading-area').show();
161
jQuery('.b2s-network-auth-info').hide();
assets/js/b2s/network.tos.js ADDED
@@ -0,0 +1,26 @@
1
+ jQuery.noConflict();
2
+ jQuery(window).on("load", function () {
3
+ //TOS Twitter 032018
4
+ var networkTos = jQuery('#b2sNetworkTosAccept').val()
5
+ if (typeof networkTos !== typeof undefined && networkTos !== false) {
6
+ if (networkTos == 0) {
7
+ jQuery('#b2sNetworkTosAcceptModal').modal('show');
8
+ }
9
+ }
10
+ });
11
+
12
+ jQuery(document).on('click', '#b2s-network-tos-accept-btn', function () {
13
+ jQuery.ajax({
14
+ url: ajaxurl,
15
+ type: "POST",
16
+ dataType: "json",
17
+ cache: false,
18
+ data: {
19
+ 'action': 'b2s_network_tos_accept',
20
+ },
21
+ success: function (data) {
22
+ jQuery('#b2sNetworkTosAcceptModal').modal('hide');
23
+ }
24
+ });
25
+ return false;
26
+ });
assets/js/b2s/post.js CHANGED
@@ -26,6 +26,15 @@ jQuery(document).on('click', '.b2s-sched-calendar-btn', function () {
26
}
27
});
28
29
jQuery(document).on('click', '.b2sDetailsPublishPostBtn', function () {
30
var postId = jQuery(this).attr('data-post-id');
31
var showByDate = jQuery(this).attr('data-search-date');
@@ -178,18 +187,6 @@ function b2sSortFormSubmit(sched_dates) {
178
jQuery('.b2sDetailsSchedPostBtn[data-post-id="' + jQuery('#b2sPostBlogId').val() + '"]').trigger('click');
179
}
180
}
181
-
182
- if (jQuery('#b2sType').val() == "sched") {
183
- if (sched_dates != false) {
184
- jQuery('#b2sCalendarSchedDates').val(data.schedDates);
185
- if (jQuery('#b2s-sched-datepicker-area').length > 0)
186
- {
187
- jQuery('#b2s-sched-datepicker-area').datepicker('destroy');
188
- getB2SSchedDatepicker();
189
- }
190
- return false;
191
- }
192
- }
193
} else {
194
jQuery('.b2s-server-connection-fail').show();
195
return false;
@@ -378,35 +375,107 @@ jQuery(document).on('click', '.b2s-publish-delete-confirm-btn', function () {
378
}
379
});
380
});
381
- var dateFormat = "yyyy-mm-dd";
382
- var language = "en";
383
- var showMeridian = true;
384
- if (jQuery('#b2sUserLang').val() == "de") {
385
- dateFormat = "dd.mm.yyyy";
386
- language = "de";
387
- showMeridian = false;
388
- }
389
390
- if (jQuery.isFunction(jQuery.fn.datepicker)) {
391
- jQuery("#b2s-change-date").datepicker({
392
format: dateFormat,
393
language: language,
394
maxViewMode: 2,
395
todayHighlight: true,
396
- startDate: new Date(),
397
calendarWeeks: true,
398
autoclose: true
399
});
400
-
401
- jQuery("#b2s-change-date").datepicker().on('changeDate', function (e) {
402
- checkSchedDateTime();
403
- });
404
- }
405
-
406
-
407
-
408
- if (jQuery.isFunction(jQuery.fn.timepicker)) {
409
- jQuery('#b2s-change-time').timepicker({
410
minuteStep: 15,
411
appendWidgetTo: 'body',
412
showSeconds: false,
@@ -414,68 +483,93 @@ if (jQuery.isFunction(jQuery.fn.timepicker)) {
414
defaultTime: 'current',
415
snapToStep: true
416
});
417
-
418
- jQuery('#b2s-change-time').timepicker().on('changeTime.timepicker', function (e) {
419
- checkSchedDateTime();
420
});
421
}
422
423
- jQuery(document).on('click', '.b2s-post-sched-area-edittime-btn', function () {
424
- jQuery('#b2s-data-blog-sched-date').val(jQuery(this).attr('data-blog-sched-date'));
425
- jQuery('#b2s-data-b2s-sched-date').val(jQuery(this).attr('data-b2s-sched-date'));
426
- var dateObjBlog = new Date();
427
- dateObjBlog.setTime(jQuery('#b2s-data-blog-sched-date').val());
428
- var dateObj = new Date();
429
- dateObj.setTime(jQuery('#b2s-data-b2s-sched-date').val());
430
- jQuery('#b2s-change-date').datepicker('setStartDate', dateObjBlog);
431
- jQuery('#b2s-change-date').datepicker('setDate', dateObj);
432
- jQuery('#b2s-change-time').timepicker('setTime', (dateObj.getUTCHours()) + ':' + dateObj.getUTCMinutes());
433
- jQuery('#b2s-data-post-id').val(jQuery(this).attr('data-post-id'));
434
- jQuery('.b2s-change-datetime-modal').modal('show');
435
- jQuery('.b2s-change-date-btn').prop('disabled', false);
436
});
437
- jQuery(document).on('click', '.b2s-change-date-btn', function () {
438
- if (jQuery('#b2s-change-date').val() == "") {
439
- jQuery('#b2s-change-date').addClass('error');
440
- return false;
441
- } else {
442
- jQuery('#b2s-change-date').removeClass('error');
443
- }
444
445
- if (jQuery('#b2s-change-time').val() == "") {
446
- jQuery('#b2s-change-time').addClass('error');
447
- return false;
448
- } else {
449
- jQuery('#b2s-change-time').removeClass('error');
450
- }
451
- jQuery('.b2s-change-date-btn').prop('disabled', true);
452
- jQuery('.b2s-server-connection-fail').hide();
453
jQuery.ajax({
454
url: ajaxurl,
455
type: "POST",
456
dataType: "json",
457
cache: false,
458
data: {
459
- 'action': 'b2s_update_user_sched_time_post',
460
- 'postId': jQuery('#b2s-data-post-id').val(),
461
- 'time': jQuery('#b2s-change-time').val(),
462
- 'date': jQuery('#b2s-change-date').val(),
463
- 'user_timezone': jQuery("#user_timezone").val()
464
- },
465
- error: function () {
466
- jQuery('.b2s-server-connection-fail').show();
467
- return false;
468
},
469
success: function (data) {
470
- jQuery('.b2s-change-datetime-modal').modal('hide');
471
- if (data.result == true) {
472
- jQuery('.b2s-post-sched-area-sched-time[data-post-id="' + data.postId + '"]').html(data.time);
473
- }
474
wp.heartbeat.connectNow();
475
- return true;
476
}
477
});
478
});
479
function showFilter(typ) {
480
if (typ == 'show') {
481
jQuery('.filterShow').hide();
@@ -488,46 +582,6 @@ function showFilter(typ) {
488
}
489
}
490
491
- function getB2SSchedDatepicker() {
492
-
493
- var language = "en";
494
- if (jQuery('#b2sUserLang').val() == "de") {
495
- language = "de";
496
- }
497
- var sched_dates = JSON.parse(jQuery('#b2sCalendarSchedDates').val());
498
-
499
- jQuery('#b2s-sched-datepicker-area').datepicker({
500
- format: "yyyy-mm-dd",
501
- inline: true,
502
- language: language,
503
- calendarWeeks: true,
504
- todayHighlight: true,
505
- beforeShowDay: function (date) {
506
- var d = date;
507
- var formattedDate = d.getFullYear() + "-" + padDate(d.getMonth() + 1) + "-" + padDate(d.getDate());
508
- if (sched_dates != "0") {
509
- if (jQuery.inArray(formattedDate, sched_dates) != -1) {
510
- return {classes: 'event'};
511
- }
512
- }
513
- return;
514
- }
515
- }).on('changeDate', function (date) {
516
- if (jQuery('#b2sShowByDate').val() != date.format()) {
517
- jQuery('#b2sPagination').val("1");
518
- jQuery('#b2sShowByDate').val(date.format());
519
- b2sSortFormSubmit(false);
520
- }
521
- return false;
522
- });
523
-
524
- if (jQuery('#b2sShowByDate').val() != "") {
525
- jQuery('#b2s-sched-datepicker-area').datepicker('setDate', jQuery('#b2sShowByDate').val());
526
- }
527
-
528
- }
529
-
530
-
531
function padDate(n) {
532
return ("0" + n).slice(-2);
533
}
@@ -559,7 +613,7 @@ function checkSchedDateTime() {
559
560
//utc current time
561
var now = new Date();
562
- //offset between utc und user
563
var offset = (parseInt(now.getTimezoneOffset()) / 60) * (-1);
564
//enter hour to user time
565
var hour = parseInt(minParts3[0]) + timeZone + offset;
26
}
27
});
28
29
+ //Overlay second modal
30
+ jQuery('#b2s-network-select-image').on('hidden.bs.modal', function () {
31
+ jQuery('body').addClass('modal-open');
32
+ });
33
+ //Overlay second modal
34
+ jQuery('#b2s-post-ship-item-post-format-modal').on('hidden.bs.modal', function () {
35
+ jQuery('body').addClass('modal-open');
36
+ });
37
+
38
jQuery(document).on('click', '.b2sDetailsPublishPostBtn', function () {
39
var postId = jQuery(this).attr('data-post-id');
40
var showByDate = jQuery(this).attr('data-search-date');
187
jQuery('.b2sDetailsSchedPostBtn[data-post-id="' + jQuery('#b2sPostBlogId').val() + '"]').trigger('click');
188
}
189
}
190
} else {
191
jQuery('.b2s-server-connection-fail').show();
192
return false;
375
}
376
});
377
});
378
379
+
380
+ jQuery(document).on('click', '.b2s-post-edit-sched-btn', function () {
381
+ 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'));
382
+
383
+ });
384
+
385
+ //Customize
386
+ function showEditSchedPost(b2s_id, post_id, network_auth_id, network_type, network_id) {
387
+ if (jQuery('#b2s-edit-event-modal-' + b2s_id).length == 1)
388
+ {
389
+ jQuery('#b2s-edit-event-modal-' + b2s_id).remove();
390
+ }
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
+ },
401
+ success: function (data) {
402
+ $modal = $modal.html(data);
403
+ }
404
+ });
405
+ b2s_current_post_id = post_id;
406
+ jQuery("body").append($modal);
407
+ jQuery(".b2s-edit-post-delete").hide();
408
+ jQuery('#b2sUserTimeZone').val(jQuery('#user_timezone').val());
409
+ jQuery('#b2s-edit-event-modal-' + b2s_id).modal('show');
410
+ var post_format = jQuery('#b2sCurrentPostFormat').val();
411
+ activatePortal(network_auth_id);
412
+ initSceditor(network_auth_id);
413
+ networkCount(network_auth_id);
414
+ if (jQuery('.b2s-post-ship-item-post-format-text[data-network-type="' + network_type + '"][data-network-id="' + network_id + '"]').length > 0) {
415
+ var postFormatText = b2s_post_formats;
416
+ var isSetPostFormat = false;
417
+ var postFormatType = jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + network_type + '"][data-network-id="' + network_id + '"]').attr('data-post-format-type');
418
+ //is set post format => override current condidtions by user settings for this post
419
+ if (post_format !== null) {
420
+ jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + network_type + '"][data-network-id="' + network_id + '"]').val(post_format);
421
+ jQuery('.b2s-post-ship-item-post-format-text[data-network-auth-id="' + network_auth_id + '"]').html(postFormatText[postFormatType][post_format]);
422
+ jQuery('.b2s-post-item-details-post-format[data-network-auth-id="' + network_auth_id + '"]').val(post_format);
423
+ //edit modal select post format
424
+ jQuery('.b2s-user-network-settings-post-format[data-network-type="' + network_type + '"][data-network-id="' + network_id + '"]').removeClass('b2s-settings-checked');
425
+ 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');
426
+ } else {
427
+ 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()]);
428
+ 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());
429
+ }
430
+
431
+ //if linkpost then show btn meta tags
432
+ var isMetaChecked = false;
433
+ if (network_id == "1" && jQuery('#isOgMetaChecked').val() == "1") {
434
+ isMetaChecked = true;
435
+ }
436
+ if (network_id == "2" && jQuery('#isCardMetaChecked').val() == "1") {
437
+ isMetaChecked = true;
438
+ }
439
+ if (isMetaChecked && jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + network_type + '"][data-network-id="' + network_id + '"]').val() == "0") {
440
+ jQuery('.b2s-post-item-details-preview-title[data-network-auth-id="' + network_auth_id + '"]').prop("readonly", false);
441
+ jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + network_auth_id + '"]').prop("readonly", false);
442
+ jQuery('.b2s-post-item-details-preview-url-reload[data-network-id="' + network_id + '"]').show();
443
+ jQuery('.b2s-post-item-details-preview-url-reload[data-network-id="' + network_id + '"]').trigger("click");
444
+ var dataMetaType = jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + network_auth_id + '"]').attr("data-meta-type");
445
+ if (dataMetaType == "og") {
446
+ jQuery('.b2sChangeOgMeta[data-network-auth-id="' + network_auth_id + '"]').val("1");
447
+ } else {
448
+ jQuery('.b2sChangeCardMeta[data-network-auth-id="' + network_auth_id + '"]').val("1");
449
+ }
450
+
451
+ } else {
452
+ jQuery('.b2s-post-item-details-preview-title[data-network-auth-id="' + network_auth_id + '"]').prop("readonly", true);
453
+ jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + network_auth_id + '"]').prop("readonly", true);
454
+ jQuery('.b2s-post-item-details-preview-url-reload[data-network-id="' + network_id + '"]').hide();
455
+ }
456
+ }
457
+
458
+ jQuery("#b2sPostId").val(post_id);
459
+ var today = new Date();
460
+ var dateFormat = "yyyy-mm-dd";
461
+ var language = "en";
462
+ var showMeridian = true;
463
+ if (jQuery('#b2sUserLang').val() == "de") {
464
+ dateFormat = "dd.mm.yyyy";
465
+ language = "de";
466
+ showMeridian = false;
467
+ }
468
+
469
+ jQuery(".b2s-post-item-details-release-input-date").datepicker({
470
format: dateFormat,
471
language: language,
472
maxViewMode: 2,
473
todayHighlight: true,
474
+ startDate: today,
475
calendarWeeks: true,
476
autoclose: true
477
});
478
+ jQuery('.b2s-post-item-details-release-input-time').timepicker({
479
minuteStep: 15,
480
appendWidgetTo: 'body',
481
showSeconds: false,
483
defaultTime: 'current',
484
snapToStep: true
485
});
486
+ jQuery(".b2s-post-item-details-release-input-date").datepicker().on('changeDate', function (e) {
487
+ checkSchedDateTime(network_auth_id);
488
});
489
+ jQuery('.b2s-post-item-details-release-input-time').timepicker().on('changeTime.timepicker', function (e) {
490
+ checkSchedDateTime(network_auth_id);
491
+ });
492
+ init();
493
+ if (!b2s_has_premium)
494
+ {
495
+ jQuery('#b2s-edit-event-modal-' + b2s_id).find("input, textarea, button").each(function () {
496
+ if (!jQuery(this).hasClass('b2s-modal-close')) {
497
+ jQuery(this).prop("disabled", true);
498
+ }
499
+ });
500
+ }
501
}
502
503
+ jQuery(document).on('click', '.b2s-select-image-modal-open', function () {
504
+ jQuery('.b2s-network-select-image-content').html("");
505
+ jQuery.ajax({
506
+ url: ajaxurl,
507
+ type: "POST",
508
+ cache: false,
509
+ async: false,
510
+ data: {
511
+ 'action': 'b2s_get_image_modal',
512
+ 'id': jQuery(this).data('post-id'),
513
+ 'image_url': jQuery(this).data('image-url')
514
+ },
515
+ success: function (data) {
516
+ jQuery(".b2s-network-select-image-content").html(data);
517
+ }
518
+ });
519
+ var authId = jQuery(this).data('network-auth-id');
520
+ jQuery('.b2s-image-change-this-network').attr('data-network-auth-id', authId);
521
+ jQuery('.b2s-upload-image').attr('data-network-auth-id', authId);
522
+ 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();
523
+ jQuery('.b2s-selected-network-for-image-info').html(content);
524
+ jQuery('#b2sInsertImageType').val("0");
525
+ jQuery('.networkImage').each(function () {
526
+ var width = this.naturalWidth;
527
+ var height = this.naturalHeight;
528
+ jQuery(this).parents('.b2s-image-item').find('.b2s-image-item-caption-resolution').html(width + 'x' + height);
529
+ });
530
+ jQuery('#b2s-network-select-image').modal('show');
531
+ return false;
532
});
533
534
+ jQuery(document).on("click", ".b2s-edit-post-save-this", function (e) {
535
+ e.preventDefault();
536
+ jQuery('#save_method').val("apply-this");
537
+ var id = jQuery(this).data("b2s-id");
538
jQuery.ajax({
539
url: ajaxurl,
540
type: "POST",
541
dataType: "json",
542
cache: false,
543
+ data: jQuery(this).closest("form").serialize(),
544
+ success: function (data) {
545
+ jQuery('#b2s-edit-event-modal-' + id).modal('hide');
546
+ jQuery('#b2s-edit-event-modal-' + id).remove();
547
+ if (data.date != "") {
548
+ jQuery('.b2s-post-sched-area-sched-time[data-post-id="' + id + '"]').html(data.date);
549
+ }
550
+ jQuery('.b2s-post-edit-success').show();
551
+ wp.heartbeat.connectNow();
552
+ }
553
+ });
554
+ });
555
+ jQuery(document).on("click", ".release_locks", function () {
556
+ jQuery.ajax({
557
+ url: ajaxurl,
558
+ type: "POST",
559
+ cache: false,
560
+ async: false,
561
data: {
562
+ 'action': 'b2s_get_calendar_release_locks',
563
+ 'post_id': jQuery('#post_id').val()
564
},
565
success: function (data) {
566
wp.heartbeat.connectNow();
567
}
568
});
569
});
570
+
571
+
572
+
573
function showFilter(typ) {
574
if (typ == 'show') {
575
jQuery('.filterShow').hide();
582
}
583
}
584
585
function padDate(n) {
586
return ("0" + n).slice(-2);
587
}
613
614
//utc current time
615
var now = new Date();
616
+ //offset between utc und user
617
var offset = (parseInt(now.getTimezoneOffset()) / 60) * (-1);
618
//enter hour to user time
619
var hour = parseInt(minParts3[0]) + timeZone + offset;
assets/js/b2s/settings.js CHANGED
@@ -26,6 +26,10 @@ jQuery(window).on("load", function () {
26
if (length > 0) {
27
jQuery('.b2s-auto-post-own-update-warning').show();
28
}
29
});
30
31
jQuery('.b2sSaveSocialMetaTagsSettings').validate({
@@ -77,6 +81,28 @@ jQuery('.b2sSaveSocialMetaTagsSettings').validate({
77
}
78
});
79
80
81
jQuery(document).on('change', '.b2s-post-type-item-update', function () {
82
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
});
34
35
jQuery('.b2sSaveSocialMetaTagsSettings').validate({
81
}
82
});
83
84
+ //TOS Twitter 032018 - none multiple Accounts - User select once
85
+ jQuery(document).on('change', '.b2s-network-tos-check', function () {
86
+ var networkId = jQuery(this).attr('data-network-id');
87
+ if (networkId == 2) {
88
+ checkNetworkTos(networkId, false);
89
+ }
90
+ return false;
91
+ });
92
+
93
+ //TOS Twitter 032018 - none multiple Accounts - User select once
94
+ function checkNetworkTos(networkId) {
95
+ var len = jQuery('.b2s-network-tos-check[data-network-id="' + networkId + '"]:checked').length;
96
+ if (len > 1) {
97
+ jQuery('.b2s-network-tos-auto-post-import-warning').show();
98
+ jQuery('#b2s-auto-post-import-settings-btn').attr('disabled', 'disabled');
99
+ return false;
100
+ } else {
101
+ jQuery('.b2s-network-tos-auto-post-import-warning').hide();
102
+ jQuery('#b2s-auto-post-import-settings-btn').attr('disabled', false);
103
+ return true;
104
+ }
105
+ }
106
107
jQuery(document).on('change', '.b2s-post-type-item-update', function () {
108
var length = jQuery('.b2s-post-type-item-update').filter(':checked').length;
assets/js/b2s/ship.js CHANGED
@@ -95,8 +95,6 @@ jQuery.sceditor.command.set(
95
}, tooltip: "Image"});
96
97
98
-
99
-
100
jQuery(document).on('click', '.b2s-toogle-calendar-btn', function () {
101
102
var networkAuthId = jQuery(this).attr('data-network-auth-id');
@@ -553,31 +551,16 @@ jQuery(document).on("click", ".b2s-user-network-settings-post-format", function
553
return true;
554
}
555
});
556
- jQuery('.b2s-post-item-details-preview-url-reload[data-network-auth-id="' + networkAuthId + '"]').hide();
557
558
559
} else {
560
jQuery('.b2s-post-item-details-preview-title[data-network-auth-id="' + networkAuthId + '"]').prop("readonly", true);
561
jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + networkAuthId + '"]').prop("readonly", true);
562
- jQuery('.b2s-post-item-details-preview-url-reload[data-network-auth-id="' + networkAuthId + '"]').show();
563
- jQuery('.b2s-post-item-details-preview-url-reload[data-network-auth-id="' + networkAuthId + '"]').trigger("click");
564
}
565
566
- //Change View For Twitter
567
- //if (postFormat == '0' && networkId == '2') {
568
- //jQuery('.b2s-image-remove-btn[data-network-id="' + networkId + '"]').hide();
569
- //jQuery('.b2s-select-image-modal-open[data-network-id="' + networkId + '"]').hide();
570
- //jQuery('.b2s-post-item-details-preview-url-reload[data-network-id="' + networkId + '"]').trigger("click");
571
- //}
572
- /*if (postFormat == '1' && networkId == '2') {
573
- jQuery('.b2s-image-remove-btn[data-network-id="' + networkId + '"]').show();
574
- jQuery('.b2s-select-image-modal-open[data-network-id="' + networkId + '"]').show();
575
- if (jQuery('#b2s_blog_default_image').val() != "") {
576
- jQuery('.b2s-post-item-details-url-image[data-network-id="' + networkId + '"]').attr('src', jQuery('#b2s_blog_default_image').val());
577
- jQuery('.b2s-image-url-hidden-field[data-network-id="' + networkId + '"]').val(jQuery('#b2s_blog_default_image').val());
578
- }
579
- }*/
580
-
581
jQuery('.b2s-user-network-settings-post-format[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').removeClass('b2s-settings-checked');
582
jQuery(this).addClass('b2s-settings-checked');
583
jQuery('#b2s-post-ship-item-post-format-modal').modal('hide');
@@ -678,19 +661,30 @@ jQuery(document).on("click", ".b2s-network-select-btn", function () {
678
}
679
});
680
681
- jQuery('.b2s-post-item-details-preview-url-reload[data-network-auth-id="' + networkAuthId + '"]').hide();
682
683
} else {
684
jQuery('.b2s-post-item-details-preview-title[data-network-auth-id="' + networkAuthId + '"]').prop("readonly", true);
685
jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + networkAuthId + '"]').prop("readonly", true);
686
- jQuery('.b2s-post-item-details-preview-url-reload[data-network-auth-id="' + networkAuthId + '"]').show();
687
- jQuery('.b2s-post-item-details-preview-url-reload[data-network-auth-id="' + networkAuthId + '"]').trigger("click");
688
}
689
} else {
690
jQuery('.b2s-post-ship-item-post-format-text[data-network-id="' + networkId + '"]').html(postFormatText[postFormatType][jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').val()]);
691
jQuery('.b2s-post-item-details-post-format[data-network-id="' + networkId + '"]').val(jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').val());
692
}
693
}
694
} else {
695
jQuery(this).addClass('b2s-network-select-btn-deactivate');
696
jQuery('.b2s-network-status-img-loading[data-network-auth-id="' + networkAuthId + '"]').show();
@@ -803,67 +797,6 @@ jQuery(document).on("click", ".b2s-network-select-btn", function () {
803
804
});
805
806
- /*jQuery(".b2s-post-item-details-release-input-date").datepicker().on('changeDate', function (e) {
807
- var element = '.b2s-post-item-details-release-input-time[data-network-auth-id="' + jQuery(this).attr('data-network-auth-id') + '"]';
808
- var dateStr = jQuery(this).val();
809
- var minStr = jQuery(element).val();
810
- if (jQuery('#b2sUserLang').val() == 'de') {
811
- dateStr = dateStr.substring(6, 10) + '-' + dateStr.substring(3, 5) + '-' + dateStr.substring(0, 2);
812
- } else {
813
- var minParts = minStr.split(' ');
814
- var minParts2 = minParts[0].split(':');
815
- if (minParts[1] == 'PM') {
816
- minParts2[0] = parseInt(minParts2[0]) + 12;
817
- }
818
- minStr = minParts2[0] + ':' + minParts2[1];
819
- }
820
- var dateObj = new Date();
821
- if (jQuery('#b2sBlogPostSchedDate').length > 0) {
822
- dateObj.setTime(jQuery('#b2sBlogPostSchedDate').val());
823
- }
824
-
825
- if (Date.parse(dateStr + ' ' + minStr + ':00') <= Date.parse(dateObj.getUTCFullYear() + '-' + (dateObj.getUTCMonth() + 1) + '-' + dateObj.getUTCDate() + ' ' + dateObj.getUTCHours() + ':' + dateObj.getUTCMinutes() + ':00')) {
826
- //date in past
827
- if (dateObj.getUTCMinutes() >= 30) {
828
- jQuery(element).timepicker('setTime', (dateObj.getUTCHours() + 1) + ':00');
829
- } else {
830
- jQuery(element).timepicker('setTime', (dateObj.getUTCHours()) + ':30');
831
- }
832
- }
833
- });
834
-
835
- jQuery('.b2s-post-item-details-release-input-time').timepicker().on('changeTime.timepicker', function (e) {
836
- var dataNetworkAuthId = jQuery(this).attr('data-network-auth-id');
837
- if (jQuery('.b2s-post-item-details-release-input-date-select[data-network-auth-id="' + dataNetworkAuthId + '"]').val() == "1") {
838
- var dateStr = jQuery('.b2s-post-item-details-release-input-date[data-network-auth-id="' + jQuery(this).attr('data-network-auth-id') + '"]').val();
839
- var minStr = jQuery(this).val();
840
- var timeZone = jQuery('#user_timezone').val();
841
- if (jQuery('#b2sUserLang').val() == 'de') {
842
- dateStr = dateStr.substring(6, 10) + '-' + dateStr.substring(3, 5) + '-' + dateStr.substring(0, 2);
843
- } else {
844
- var minParts = minStr.split(' ');
845
- var minParts2 = minParts[0].split(':');
846
- if (minParts[1] == 'PM') {
847
- minParts2[0] = parseInt(minParts2[0]) + 12;
848
- }
849
- minStr = minParts2[0] + ':' + minParts2[1];
850
- }
851
- var dateObj = new Date();
852
- if (jQuery('#b2sBlogPostSchedDate').length > 0) {
853
- dateObj.setTime(jQuery('#b2sBlogPostSchedDate').val());
854
- }
855
-
856
- if (Date.parse(dateStr + ' ' + minStr + ':00') <= Date.parse(dateObj.getUTCFullYear() + '-' + (dateObj.getUTCMonth() + 1) + '-' + dateObj.getUTCDate() + ' ' + dateObj.getUTCHours() + ':' + dateObj.getUTCMinutes() + ':00')) {
857
- //date in past
858
- if (dateObj.getUTCMinutes() >= 30) {
859
- jQuery(this).timepicker('setTime', (dateObj.getUTCHours() + 1) + ':00');
860
- } else {
861
- jQuery(this).timepicker('setTime', (dateObj.getUTCHours()) + ':30');
862
- }
863
- }
864
- }
865
- });*/
866
-
867
//Check Text Limit
868
var textLimit = jQuery('.b2s-post-item-details-item-message-input[data-network-auth-id="' + data.networkAuthId + '"]').attr('data-network-text-limit');
869
if (textLimit != "0") {
@@ -930,19 +863,31 @@ jQuery(document).on("click", ".b2s-network-select-btn", function () {
930
return true;
931
}
932
});
933
- jQuery('.b2s-post-item-details-preview-url-reload[data-network-auth-id="' + networkAuthId + '"]').hide();
934
935
} else {
936
jQuery('.b2s-post-item-details-preview-title[data-network-auth-id="' + data.networkAuthId + '"]').prop("readonly", true);
937
jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + data.networkAuthId + '"]').prop("readonly", true);
938
- jQuery('.b2s-post-item-details-preview-url-reload[data-network-auth-id="' + networkAuthId + '"]').show();
939
- jQuery('.b2s-post-item-details-preview-url-reload[data-network-auth-id="' + networkAuthId + '"]').trigger("click");
940
}
941
942
} else {
943
jQuery('.b2s-post-ship-item-post-format-text[data-network-id="' + data.networkId + '"]').html(postFormatText[postFormatType][jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + data.networkType + '"][data-network-id="' + data.networkId + '"]').val()]);
944
jQuery('.b2s-post-item-details-post-format[data-network-id="' + data.networkId + '"]').val(jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + data.networkType + '"][data-network-id="' + data.networkId + '"]').val());
945
}
946
}
947
}
948
}
@@ -1058,11 +1003,22 @@ jQuery(document).on('change', '.b2s-post-item-details-release-input-interval-sel
1058
//select shipping mode
1059
jQuery(document).on('change', '.b2s-post-item-details-release-input-date-select', function () {
1060
var dataNetworkCount = 0;
1061
if (jQuery(this).val() == 2) {
1062
if (jQuery(this).attr('data-user-version') == 0) {
1063
jQuery('#b2s-sched-post-modal').modal('show');
1064
return false;
1065
} else {
1066
for (var i = 1; i <= 2; i++) {
1067
jQuery('.b2s-post-item-details-release-input-days[data-network-auth-id="' + jQuery(this).attr('data-network-auth-id') + '"][data-network-count="' + i + '"]').each(function () {
1068
if (jQuery(this).prop('checked')) {
@@ -1086,6 +1042,12 @@ jQuery(document).on('change', '.b2s-post-item-details-release-input-date-select'
1086
jQuery('#b2s-sched-post-modal').modal('show');
1087
return false;
1088
} else {
1089
checkSchedDateTime(jQuery(this).attr('data-network-auth-id'));
1090
1091
if (dataNetworkCount == 2) {
@@ -1241,11 +1203,6 @@ jQuery(document).on('click', '.b2s-post-item-details-release-input-hide', functi
1241
jQuery('.b2s-post-item-details-release-input-select-timespan' + selectorInput).prop('disabled', true);
1242
jQuery('.b2s-post-item-details-release-input-select-timespan' + selectorInput).val("1");
1243
1244
-
1245
-
1246
-
1247
-
1248
-
1249
return false;
1250
});
1251
@@ -1554,6 +1511,29 @@ jQuery.validator.addClassRules("b2s-post-item-details-item-url-input", {
1554
checkUrl: /^(https?:\/\/)?[a-zA-Z0-99ÄÖÜöäü-]+([\-\.]{1}[a-zA-Z0-99ÄÖÜöäü-]+)*\.[a-zA-Z0-9-]{2,20}(:[0-9]{1,5})?(\/.*)?#x2F;
1555
});
1556
1557
jQuery.validator.addMethod("checkTags", function (value, element, test) {
1558
var allowed_tags = ['p', 'h1', 'h2', 'br', 'i', 'b', 'a', 'img'];
1559
@@ -2129,6 +2109,13 @@ function releaseChoose(choose, dataNetworkAuthId, dataNetworkCount) {
2129
jQuery('.b2s-post-item-details-release-area-div-time' + selectorInput).hide();
2130
jQuery('.b2s-post-item-details-release-area-div-day' + selectorInput).hide();
2131
} else if (choose == 1) {
2132
for (var i = 0; i <= dataNetworkCount; i++) {
2133
jQuery('.b2s-post-item-details-releas-area-details-row[data-network-count="' + i + '"]' + selectorInput).show();
2134
jQuery('.b2s-post-item-details-release-input-date[data-network-count="' + i + '"]' + selectorInput).show();
@@ -2180,19 +2167,28 @@ function releaseChoose(choose, dataNetworkAuthId, dataNetworkCount) {
2180
jQuery('.b2s-post-item-details-release-area-div-time' + selectorInput).show();
2181
jQuery('.b2s-post-item-details-release-area-div-day' + selectorInput).hide();
2182
} else if (choose == 2) {
2183
- jQuery('.b2s-post-item-details-release-input-date' + selectorInput).show();
2184
- jQuery('.b2s-post-item-details-release-input-date' + selectorInput).removeAttr('disabled');
2185
- jQuery('.b2s-post-item-details-release-input-daySelect' + selectorInput).show();
2186
jQuery('.b2s-post-item-details-release-input-add' + selectorInput).show();
2187
jQuery('.b2s-post-item-details-release-area-details-ul' + selectorInput).show();
2188
jQuery('.b2s-post-item-details-release-save-settings' + selectorInput).prop('disabled', false);
2189
jQuery('.b2s-post-item-details-release-save-settings-label' + selectorInput).hide();
2190
for (var i = 0; i <= dataNetworkCount; i++) {
2191
jQuery('.b2s-post-item-details-releas-area-details-row[data-network-count="' + i + '"]' + selectorInput).show();
2192
//new since v4.5.0
2193
jQuery('.b2s-post-item-details-release-input-interval-select[data-network-count="' + i + '"]' + selectorInput).show();
2194
jQuery('.b2s-post-item-details-release-input-interval-select[data-network-count="' + i + '"]' + selectorInput).removeAttr('disabled');
2195
2196
jQuery('.b2s-post-item-details-release-input-time[data-network-count="' + i + '"]' + selectorInput).show();
2197
jQuery('.b2s-post-item-details-release-input-time[data-network-count="' + i + '"]' + selectorInput).removeAttr('disabled');
2198
jQuery('.b2s-post-item-details-release-input-weeks[data-network-count="' + i + '"]' + selectorInput).show();
@@ -2360,7 +2356,6 @@ function networkLimitAll(networkAuthId, networkId, limit) {
2360
limit = limit - 24;
2361
}
2362
}
2363
-
2364
if (textLength >= limit) {
2365
newText = text.substring(0, limit);
2366
var pos = getCaretPos(this);
@@ -2371,6 +2366,7 @@ function networkLimitAll(networkAuthId, networkId, limit) {
2371
}
2372
var newLen = limit - textLength;
2373
jQuery(".b2s-post-item-countChar[data-network-auth-id='" + networkAuthId + "']").html(newLen);
2374
}
2375
2376
function networkCount(networkAuthId) {
95
}, tooltip: "Image"});
96
97
98
jQuery(document).on('click', '.b2s-toogle-calendar-btn', function () {
99
100
var networkAuthId = jQuery(this).attr('data-network-auth-id');
551
return true;
552
}
553
});
554
+ jQuery('.b2s-post-item-details-preview-url-reload[data-network-auth-id="' + networkAuthId + '"]').show();
555
+ jQuery('.b2s-post-item-details-preview-url-reload[data-network-auth-id="' + networkAuthId + '"]').trigger("click");
556
557
558
} else {
559
jQuery('.b2s-post-item-details-preview-title[data-network-auth-id="' + networkAuthId + '"]').prop("readonly", true);
560
jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + networkAuthId + '"]').prop("readonly", true);
561
+ jQuery('.b2s-post-item-details-preview-url-reload[data-network-auth-id="' + networkAuthId + '"]').hide();
562
}
563
564
jQuery('.b2s-user-network-settings-post-format[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').removeClass('b2s-settings-checked');
565
jQuery(this).addClass('b2s-settings-checked');
566
jQuery('#b2s-post-ship-item-post-format-modal').modal('hide');
661
}
662
});
663
664
+ jQuery('.b2s-post-item-details-preview-url-reload[data-network-auth-id="' + networkAuthId + '"]').show();
665
+ jQuery('.b2s-post-item-details-preview-url-reload[data-network-auth-id="' + networkAuthId + '"]').trigger("click");
666
667
} else {
668
jQuery('.b2s-post-item-details-preview-title[data-network-auth-id="' + networkAuthId + '"]').prop("readonly", true);
669
jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + networkAuthId + '"]').prop("readonly", true);
670
+ jQuery('.b2s-post-item-details-preview-url-reload[data-network-auth-id="' + networkAuthId + '"]').hide();
671
}
672
} else {
673
jQuery('.b2s-post-ship-item-post-format-text[data-network-id="' + networkId + '"]').html(postFormatText[postFormatType][jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').val()]);
674
jQuery('.b2s-post-item-details-post-format[data-network-id="' + networkId + '"]').val(jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').val());
675
}
676
}
677
+
678
+ //Twitter TOS 032018 - protected multiple accounts with same content to same time
679
+ //delete comment field one more
680
+ if (networkId == 2) {
681
+ if (jQuery('.tw-textarea-input[data-network-id="' + networkId + '"]:visible').length == 1) {
682
+ jQuery('.tw-textarea-input[data-network-auth-id="' + networkAuthId + '"]').text(jQuery('#b2sTwitterOrginalPost').val());
683
+ } else {
684
+ jQuery('.tw-textarea-input[data-network-auth-id="' + networkAuthId + '"]').text("");
685
+ }
686
+ }
687
+
688
} else {
689
jQuery(this).addClass('b2s-network-select-btn-deactivate');
690
jQuery('.b2s-network-status-img-loading[data-network-auth-id="' + networkAuthId + '"]').show();
797
798
});
799
800
//Check Text Limit
801
var textLimit = jQuery('.b2s-post-item-details-item-message-input[data-network-auth-id="' + data.networkAuthId + '"]').attr('data-network-text-limit');
802
if (textLimit != "0") {
863
return true;
864
}
865
});
866
+ jQuery('.b2s-post-item-details-preview-url-reload[data-network-auth-id="' + networkAuthId + '"]').show();
867
+ jQuery('.b2s-post-item-details-preview-url-reload[data-network-auth-id="' + networkAuthId + '"]').trigger("click");
868
869
} else {
870
jQuery('.b2s-post-item-details-preview-title[data-network-auth-id="' + data.networkAuthId + '"]').prop("readonly", true);
871
jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + data.networkAuthId + '"]').prop("readonly", true);
872
+ jQuery('.b2s-post-item-details-preview-url-reload[data-network-auth-id="' + networkAuthId + '"]').hide();
873
}
874
875
} else {
876
jQuery('.b2s-post-ship-item-post-format-text[data-network-id="' + data.networkId + '"]').html(postFormatText[postFormatType][jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + data.networkType + '"][data-network-id="' + data.networkId + '"]').val()]);
877
jQuery('.b2s-post-item-details-post-format[data-network-id="' + data.networkId + '"]').val(jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + data.networkType + '"][data-network-id="' + data.networkId + '"]').val());
878
}
879
+
880
+ //Twitter TOS 032018 - protected multiple accounts with same content to same time
881
+ //delete comment field one more
882
+ if (data.networkId == 2) {
883
+ if (jQuery('.tw-textarea-input[data-network-id="' + data.networkId + '"]:visible').length > 1) {
884
+ jQuery('.tw-textarea-input[data-network-auth-id="' + data.networkAuthId + '"]').text("");
885
+ } else {
886
+ //set original post
887
+ jQuery('#b2sTwitterOrginalPost').val(jQuery('.tw-textarea-input[data-network-auth-id="' + data.networkAuthId + '"]').val());
888
+ }
889
+ }
890
+
891
}
892
}
893
}
1003
//select shipping mode
1004
jQuery(document).on('change', '.b2s-post-item-details-release-input-date-select', function () {
1005
var dataNetworkCount = 0;
1006
+ if (jQuery(this).val() == 0) {
1007
+ //TOS Twitter 032018 - none multiple accounts post same content to same time
1008
+ if (jQuery(this).attr('data-network-id') == 2) {
1009
+ jQuery('.b2s-network-tos-sched-warning[data-network-auth-id="' + jQuery(this).attr('data-network-auth-id') + '"]').hide();
1010
+ }
1011
+ }
1012
if (jQuery(this).val() == 2) {
1013
if (jQuery(this).attr('data-user-version') == 0) {
1014
jQuery('#b2s-sched-post-modal').modal('show');
1015
return false;
1016
} else {
1017
+ //TOS Twitter 032018 - none multiple accounts post same content to same time
1018
+ if (jQuery(this).attr('data-network-id') == 2) {
1019
+ jQuery('.b2s-network-tos-sched-warning[data-network-auth-id="' + jQuery(this).attr('data-network-auth-id') + '"]').show();
1020
+ }
1021
+
1022
for (var i = 1; i <= 2; i++) {
1023
jQuery('.b2s-post-item-details-release-input-days[data-network-auth-id="' + jQuery(this).attr('data-network-auth-id') + '"][data-network-count="' + i + '"]').each(function () {
1024
if (jQuery(this).prop('checked')) {
1042
jQuery('#b2s-sched-post-modal').modal('show');
1043
return false;
1044
} else {
1045
+
1046
+ //TOS Twitter 032018 - none multiple accounts post same content to same time
1047
+ if (jQuery(this).attr('data-network-id') == 2) {
1048
+ jQuery('.b2s-network-tos-sched-warning[data-network-auth-id="' + jQuery(this).attr('data-network-auth-id') + '"]').hide();
1049
+ }
1050
+
1051
checkSchedDateTime(jQuery(this).attr('data-network-auth-id'));
1052
1053
if (dataNetworkCount == 2) {
1203
jQuery('.b2s-post-item-details-release-input-select-timespan' + selectorInput).prop('disabled', true);
1204
jQuery('.b2s-post-item-details-release-input-select-timespan' + selectorInput).val("1");
1205
1206
return false;
1207
});
1208
1511
checkUrl: /^(https?:\/\/)?[a-zA-Z0-99ÄÖÜöäü-]+([\-\.]{1}[a-zA-Z0-99ÄÖÜöäü-]+)*\.[a-zA-Z0-9-]{2,20}(:[0-9]{1,5})?(\/.*)?#x2F;
1512
});
1513
1514
+ //Twitter TOS 032018 - protected multiple accounts with same content to same time
1515
+ jQuery.validator.addMethod("unique", function (value, element, params) {
1516
+ var prefix = params;
1517
+ var selector = jQuery.validator.format("[name!='{0}'][unique='{1}']", element.name, prefix);
1518
+ var matches = new Array();
1519
+ var curNetworkAuthId = jQuery(element).attr('data-network-auth-id');
1520
+ jQuery(selector).each(function (index, item) {
1521
+ if (jQuery.trim(value) == jQuery.trim(jQuery(item).val())) {
1522
+ matches.push(item);
1523
+ }
1524
+ });
1525
+ jQuery('.b2s-unique-content').hide();
1526
+ jQuery('.tw-textarea-input').removeClass('error');
1527
+ if (matches.length != 0) {
1528
+ jQuery('.b2s-unique-content[data-network-auth-id="' + curNetworkAuthId + '"]').show();
1529
+ }
1530
+ return matches.length == 0;
1531
+ });
1532
+
1533
+ jQuery.validator.classRuleSettings.unique = {
1534
+ unique: true
1535
+ };
1536
+
1537
jQuery.validator.addMethod("checkTags", function (value, element, test) {
1538
var allowed_tags = ['p', 'h1', 'h2', 'br', 'i', 'b', 'a', 'img'];
1539
2109
jQuery('.b2s-post-item-details-release-area-div-time' + selectorInput).hide();
2110
jQuery('.b2s-post-item-details-release-area-div-day' + selectorInput).hide();
2111
} else if (choose == 1) {
2112
+
2113
+ jQuery('.b2s-post-item-details-releas-area-details-row' + selectorInput).hide();
2114
+ jQuery('.b2s-post-item-details-release-input-date' + selectorInput).hide();
2115
+ jQuery('.b2s-post-item-details-release-input-date' + selectorInput).prop('disabled', true);
2116
+ jQuery('.b2s-post-item-details-release-input-time' + selectorInput).hide();
2117
+ jQuery('.b2s-post-item-details-release-input-time' + selectorInput).prop('disabled', true);
2118
+
2119
for (var i = 0; i <= dataNetworkCount; i++) {
2120
jQuery('.b2s-post-item-details-releas-area-details-row[data-network-count="' + i + '"]' + selectorInput).show();
2121
jQuery('.b2s-post-item-details-release-input-date[data-network-count="' + i + '"]' + selectorInput).show();
2167
jQuery('.b2s-post-item-details-release-area-div-time' + selectorInput).show();
2168
jQuery('.b2s-post-item-details-release-area-div-day' + selectorInput).hide();
2169
} else if (choose == 2) {
2170
+
2171
+ jQuery('.b2s-post-item-details-releas-area-details-row' + selectorInput).hide();
2172
+ jQuery('.b2s-post-item-details-release-input-date' + selectorInput).hide();
2173
+ jQuery('.b2s-post-item-details-release-input-date' + selectorInput).prop('disabled', true);
2174
+ jQuery('.b2s-post-item-details-release-input-time' + selectorInput).hide();
2175
+ jQuery('.b2s-post-item-details-release-input-time' + selectorInput).prop('disabled', true);
2176
jQuery('.b2s-post-item-details-release-input-add' + selectorInput).show();
2177
+ jQuery('.b2s-post-item-details-release-input-daySelect' + selectorInput).show();
2178
jQuery('.b2s-post-item-details-release-area-details-ul' + selectorInput).show();
2179
jQuery('.b2s-post-item-details-release-save-settings' + selectorInput).prop('disabled', false);
2180
jQuery('.b2s-post-item-details-release-save-settings-label' + selectorInput).hide();
2181
+
2182
for (var i = 0; i <= dataNetworkCount; i++) {
2183
jQuery('.b2s-post-item-details-releas-area-details-row[data-network-count="' + i + '"]' + selectorInput).show();
2184
//new since v4.5.0
2185
jQuery('.b2s-post-item-details-release-input-interval-select[data-network-count="' + i + '"]' + selectorInput).show();
2186
jQuery('.b2s-post-item-details-release-input-interval-select[data-network-count="' + i + '"]' + selectorInput).removeAttr('disabled');
2187
2188
+ jQuery('.b2s-post-item-details-release-input-date[data-network-count="' + i + '"]' + selectorInput).show();
2189
+ jQuery('.b2s-post-item-details-release-input-date[data-network-count="' + i + '"]' + selectorInput).removeAttr('disabled');
2190
+ jQuery('.b2s-post-item-details-release-input-daySelect[data-network-count="' + i + '"]' + selectorInput).show();
2191
+
2192
jQuery('.b2s-post-item-details-release-input-time[data-network-count="' + i + '"]' + selectorInput).show();
2193
jQuery('.b2s-post-item-details-release-input-time[data-network-count="' + i + '"]' + selectorInput).removeAttr('disabled');
2194
jQuery('.b2s-post-item-details-release-input-weeks[data-network-count="' + i + '"]' + selectorInput).show();
2356
limit = limit - 24;
2357
}
2358
}
2359
if (textLength >= limit) {
2360
newText = text.substring(0, limit);
2361
var pos = getCaretPos(this);
2366
}
2367
var newLen = limit - textLength;
2368
jQuery(".b2s-post-item-countChar[data-network-auth-id='" + networkAuthId + "']").html(newLen);
2369
+
2370
}
2371
2372
function networkCount(networkAuthId) {
assets/js/b2s/start.js CHANGED
@@ -150,14 +150,14 @@ function getWidgetContent() {
150
},
151
success: function (content) {
152
data = content;
153
- widget.data('position', new Date().getSeconds() % data.length);
154
show();
155
setInterval(function () {
156
jQuery('.b2s-dashboard-multi-widget .glyphicon-chevron-left').trigger("click");
157
}, 30000);
158
}
159
-
160
});
161
jQuery('.b2s-dashboard-multi-widget .glyphicon-chevron-right').on("click", function () {
162
widget.data('position', widget.data('position') * 1 + 1);
163
show(widget);
150
},
151
success: function (content) {
152
data = content;
153
+ widget.data('position',0); //random: new Date().getSeconds() % data.length;
154
show();
155
setInterval(function () {
156
jQuery('.b2s-dashboard-multi-widget .glyphicon-chevron-left').trigger("click");
157
}, 30000);
158
}
159
});
160
+
161
jQuery('.b2s-dashboard-multi-widget .glyphicon-chevron-right').on("click", function () {
162
widget.data('position', widget.data('position') * 1 + 1);
163
show(widget);
assets/js/b2s/wp/post-box.js CHANGED
@@ -16,6 +16,8 @@ jQuery(window).on("load", function () {
16
jQuery('#b2s-url-valid-warning').hide();
17
}
18
}
19
20
if (jQuery('#b2s-post-meta-box-time-dropdown-publish').is(':checked')) {
21
jQuery('#b2s-post-box-calendar-header').show();
@@ -218,20 +220,23 @@ jQuery(document).on('change', '.b2s-post-meta-box-sched-select', function () {
218
219
jQuery(document).on('click', '#publish', function () {
220
//Check is Auto-Post-Import active
221
- if (jQuery('#autoPostImportIsActive').length > 0) {
222
- if (jQuery('#autoPostImportIsActive').val() == "1") {
223
- jQuery.ajax({
224
- url: ajaxurl,
225
- type: "POST",
226
- dataType: "json",
227
- cache: false,
228
- data: {
229
- 'action': 'b2s_lock_auto_post_import',
230
- 'userId': jQuery('#b2sBlogUserId').val()
231
- }
232
- });
233
}
234
- }
235
});
236
jQuery(document).on('click', '.b2s-btn-close-meta-box', function () {
237
jQuery('#' + jQuery(this).attr('data-area-id')).hide();
@@ -247,11 +252,34 @@ jQuery(document).on('click', '.b2s-meta-box-modal-btn-close', function () {
247
});
248
249
jQuery(document).on('change', '#b2s-post-meta-box-profil-dropdown', function () {
250
if (jQuery('#b2s-post-meta-box-profil-data-' + jQuery(this).val()).val() == "") {
251
jQuery('#b2s-post-meta-box-state-no-auth').show();
252
} else {
253
jQuery('#b2s-post-meta-box-state-no-auth').hide();
254
}
255
});
256
257
function b2sIsValidUrl(str) {
16
jQuery('#b2s-url-valid-warning').hide();
17
}
18
}
19
+ //TOS Twitter 032018
20
+ jQuery('#b2s-network-tos-warning').show();
21
22
if (jQuery('#b2s-post-meta-box-time-dropdown-publish').is(':checked')) {
23
jQuery('#b2s-post-box-calendar-header').show();
220
221
jQuery(document).on('click', '#publish', function () {
222
//Check is Auto-Post-Import active
223
+ if (jQuery('#b2sAutoPostImportIsActive').length > 0) {
224
+ if (jQuery('#b2sAutoPostImportIsActive').val() == "1") {
225
+ jQuery.ajax({
226
+ url: ajaxurl,
227
+ type: "POST",
228
+ dataType: "json",
229
+ cache: false,
230
+ data: {
231
+ 'action': 'b2s_lock_auto_post_import',
232
+ 'userId': jQuery('#b2sBlogUserId').val()
233
+ },
234
+ success: function (data) {
235
+
236
+ }
237
+ });
238
+ }
239
}
240
});
241
jQuery(document).on('click', '.b2s-btn-close-meta-box', function () {
242
jQuery('#' + jQuery(this).attr('data-area-id')).hide();
252
});
253
254
jQuery(document).on('change', '#b2s-post-meta-box-profil-dropdown', function () {
255
+ var tos = false;
256
if (jQuery('#b2s-post-meta-box-profil-data-' + jQuery(this).val()).val() == "") {
257
jQuery('#b2s-post-meta-box-state-no-auth').show();
258
+ tos = true;
259
} else {
260
jQuery('#b2s-post-meta-box-state-no-auth').hide();
261
+ //TOS Twitter Check
262
+ var len = jQuery('#b2s-post-meta-box-profil-dropdown-twitter').children('option[data-mandant-id="' + jQuery(this).val() + '"]').length;
263
+ if (len >= 1) {
264
+ jQuery('.b2s-meta-box-auto-post-twitter-profile').show();
265
+ jQuery('#b2s-post-meta-box-profil-dropdown-twitter').prop('disabled', false);
266
+ jQuery('#b2s-post-meta-box-profil-dropdown-twitter').show();
267
+ jQuery('#b2s-post-meta-box-profil-dropdown-twitter option').attr("disabled", "disabled");
268
+ jQuery('#b2s-post-meta-box-profil-dropdown-twitter option[data-mandant-id="' + jQuery(this).val() + '"]').attr("disabled", false);
269
+ jQuery('#b2s-post-meta-box-profil-dropdown-twitter option[data-mandant-id="' + jQuery(this).val() + '"]:first').attr("selected", "selected");
270
+ } else {
271
+ tos = true;
272
+ }
273
+
274
}
275
+ //TOS Twitter 032018
276
+ if (tos) {
277
+ jQuery('.b2s-meta-box-auto-post-twitter-profile').hide();
278
+ jQuery('#b2s-post-meta-box-profil-dropdown-twitter').prop('disabled', 'disabled');
279
+ jQuery('#b2s-post-meta-box-profil-dropdown-twitter').hide();
280
+ }
281
+
282
+
283
});
284
285
function b2sIsValidUrl(str) {
blog2social.php CHANGED
@@ -7,12 +7,12 @@
7
* Author: Blog2Social, Adenion
8
* Text Domain: blog2social
9
* Domain Path: /languages
10
- * Version: 4.6.0
11
* Author URI: https://www.blog2social.com
12
* License: GPL2+
13
*/
14
//B2SDefine
15
- define('B2S_PLUGIN_VERSION', '460');
16
define('B2S_PLUGIN_LANGUAGE', serialize(array('de_DE', 'en_US')));
17
define('B2S_PLUGIN_DIR', plugin_dir_path(__FILE__));
18
define('B2S_PLUGIN_URL', plugin_dir_url(__FILE__));
7
* Author: Blog2Social, Adenion
8
* Text Domain: blog2social
9
* Domain Path: /languages
10
+ * Version: 4.7.0
11
* Author URI: https://www.blog2social.com
12
* License: GPL2+
13
*/
14
//B2SDefine
15
+ define('B2S_PLUGIN_VERSION', '470');
16
define('B2S_PLUGIN_LANGUAGE', serialize(array('de_DE', 'en_US')));
17
define('B2S_PLUGIN_DIR', plugin_dir_path(__FILE__));
18
define('B2S_PLUGIN_URL', plugin_dir_url(__FILE__));
includes/Ajax/Get.php CHANGED
@@ -15,6 +15,7 @@ class Ajax_Get {
15
add_action('wp_ajax_b2s_ship_item', array($this, 'getShipItem'));
16
add_action('wp_ajax_b2s_sort_data', array($this, 'getSortData'));
17
add_action('wp_ajax_b2s_get_sched_posts_by_user_auth', array($this, 'getSchedPostsByUserAuth'));
18
add_action('wp_ajax_b2s_publish_post_data', array($this, 'getPublishPostData'));
19
add_action('wp_ajax_b2s_sched_post_data', array($this, 'getSchedPostData'));
20
add_action('wp_ajax_b2s_ship_navbar_item', array($this, 'getNavbarItem'));
@@ -25,7 +26,7 @@ class Ajax_Get {
25
add_action('wp_ajax_b2s_ship_item_reload_url', array($this, 'getShipItemReloadUrl'));
26
add_action('wp_ajax_b2s_get_faq_entries', array($this, 'getFaqEntries'));
27
add_action('wp_ajax_b2s_get_calendar_events', array($this, 'getCalendarEvents'));
28
- add_action('wp_ajax_b2s_get_calendar_edit_modal', array($this, 'getCalendarEditModal'));
29
add_action('wp_ajax_b2s_get_calendar_filter_network_auth', array($this, 'getCalendarFilterNetworkAuth'));
30
add_action('wp_ajax_b2s_get_image_modal', array($this, 'getImageModal'));
31
add_action('wp_ajax_b2s_get_multi_widget_content', array($this, 'getMultiWidgetContent'));
@@ -53,7 +54,7 @@ class Ajax_Get {
53
$b2sUserLang = isset($_POST['b2sUserLang']) ? trim($_POST['b2sUserLang']) : strtolower(substr(B2S_LANGUAGE, 0, 2));
54
$b2sResultsPerPage = isset($_POST['b2sPostsPerPage']) && intval($_POST['b2sPostsPerPage']) > 0 ? intval($_POST['b2sPostsPerPage']) : B2S_PLUGIN_POSTPERPAGE;
55
if (!empty($b2sType) && in_array($b2sType, array('all', 'sched', 'publish'))) {
56
- $postItem = new B2S_Post_Item($b2sType, $b2sSortPostTitle, $b2sSortPostAuthor, $b2sSortPostStatus, $b2sSortPostPublishDate, $b2sSortPostSchedDate, $b2sShowByDate, $b2sUserAuthId,$b2sPostBlogId, $b2sPagination, $b2sSortPostCat, $b2sSortPostType, $b2sUserLang, $b2sResultsPerPage);
57
$result = array('result' => true, 'content' => $postItem->getItemHtml($b2sSelectSchedDate), 'schedDates' => json_encode($postItem->getCalendarSchedDate()));
58
if ($b2sShowPagination) {
59
$result['pagination'] = $postItem->getPaginationHtml();
@@ -65,6 +66,19 @@ class Ajax_Get {
65
wp_die();
66
}
67
68
public function getFaqEntries() {
69
$result = json_decode(B2S_Api_Post::post(B2S_PLUGIN_API_ENDPOINT, array('action' => 'getFaqEntries', 'lang' => substr(B2S_LANGUAGE, 0, 2), 'token' => B2S_PLUGIN_TOKEN)));
70
if (isset($result->result) && isset($result->content) && !empty($result->content)) {
@@ -250,9 +264,9 @@ class Ajax_Get {
250
$network_details_id = (isset($_GET['filter_network_auth']) && (int) $_GET['filter_network_auth'] >= 1) ? (int) $_GET['filter_network_auth'] : 0; // 0=all
251
252
if (isset($_GET['start'])) {
253
- $calendar = B2S_Calendar_Filter::getByTimespam($_GET['start'] . " 00:00:00", $_GET['end'] . " 23:59:59", $network_id,$network_details_id);
254
} else {
255
- $calendar = B2S_Calendar_Filter::getAll($network_id,$network_details_id);
256
}
257
echo json_encode($calendar->asCalendarArray());
258
wp_die();
@@ -272,7 +286,7 @@ class Ajax_Get {
272
wp_die();
273
}
274
275
- public function getCalendarEditModal() {
276
require_once (B2S_PLUGIN_DIR . 'includes/B2S/Calendar/Filter.php');
277
if (isset($_POST['id']) && (int) $_POST['id'] > 0) {
278
$item = B2S_Calendar_Filter::getById((int) $_POST['id']);
@@ -291,7 +305,7 @@ class Ajax_Get {
291
if ($lock_user_id) {
292
$lock_user = get_userdata($lock_user_id);
293
}
294
- include (B2S_PLUGIN_DIR . 'views/b2s/modal.calendar.php');
295
wp_die();
296
}
297
}
@@ -305,7 +319,7 @@ class Ajax_Get {
305
$postData = get_post((int) $_POST['id']);
306
if (isset($postData->ID)) {
307
$postUrl = (get_permalink($postData->ID) !== false ? get_permalink($postData->ID) : $postData->guid);
308
- include (B2S_PLUGIN_DIR . 'views/b2s/image.calendar.php');
309
wp_die();
310
}
311
}
@@ -316,7 +330,7 @@ class Ajax_Get {
316
public function getMultiWidgetContent() {
317
$option = get_option("B2S_MULTI_WIDGET");
318
if ($option !== false) {
319
- if (is_array($option) && isset($option['timestamp']) && isset($option['content']) && !empty($option['content']) && $option['timestamp'] > date('Y-m-d H:i:s', strtotime("-3 hours"))) {
320
die($option['content']);
321
}
322
}
15
add_action('wp_ajax_b2s_ship_item', array($this, 'getShipItem'));
16
add_action('wp_ajax_b2s_sort_data', array($this, 'getSortData'));
17
add_action('wp_ajax_b2s_get_sched_posts_by_user_auth', array($this, 'getSchedPostsByUserAuth'));
18
+ add_action('wp_ajax_b2s_get_network_board_and_group', array($this, 'getNetworkBoardAndGroup'));
19
add_action('wp_ajax_b2s_publish_post_data', array($this, 'getPublishPostData'));
20
add_action('wp_ajax_b2s_sched_post_data', array($this, 'getSchedPostData'));
21
add_action('wp_ajax_b2s_ship_navbar_item', array($this, 'getNavbarItem'));
26
add_action('wp_ajax_b2s_ship_item_reload_url', array($this, 'getShipItemReloadUrl'));
27
add_action('wp_ajax_b2s_get_faq_entries', array($this, 'getFaqEntries'));
28
add_action('wp_ajax_b2s_get_calendar_events', array($this, 'getCalendarEvents'));
29
+ add_action('wp_ajax_b2s_get_post_edit_modal', array($this, 'getPostEditModal'));
30
add_action('wp_ajax_b2s_get_calendar_filter_network_auth', array($this, 'getCalendarFilterNetworkAuth'));
31
add_action('wp_ajax_b2s_get_image_modal', array($this, 'getImageModal'));
32
add_action('wp_ajax_b2s_get_multi_widget_content', array($this, 'getMultiWidgetContent'));
54
$b2sUserLang = isset($_POST['b2sUserLang']) ? trim($_POST['b2sUserLang']) : strtolower(substr(B2S_LANGUAGE, 0, 2));
55
$b2sResultsPerPage = isset($_POST['b2sPostsPerPage']) && intval($_POST['b2sPostsPerPage']) > 0 ? intval($_POST['b2sPostsPerPage']) : B2S_PLUGIN_POSTPERPAGE;
56
if (!empty($b2sType) && in_array($b2sType, array('all', 'sched', 'publish'))) {
57
+ $postItem = new B2S_Post_Item($b2sType, $b2sSortPostTitle, $b2sSortPostAuthor, $b2sSortPostStatus, $b2sSortPostPublishDate, $b2sSortPostSchedDate, $b2sShowByDate, $b2sUserAuthId, $b2sPostBlogId, $b2sPagination, $b2sSortPostCat, $b2sSortPostType, $b2sUserLang, $b2sResultsPerPage);
58
$result = array('result' => true, 'content' => $postItem->getItemHtml($b2sSelectSchedDate), 'schedDates' => json_encode($postItem->getCalendarSchedDate()));
59
if ($b2sShowPagination) {
60
$result['pagination'] = $postItem->getPaginationHtml();
66
wp_die();
67
}
68
69
+ public function getNetworkBoardAndGroup() {
70
+ if (isset($_POST['networkId']) && !empty($_POST['networkId']) && isset($_POST['networkAuthId']) && !empty($_POST['networkAuthId'])) {
71
+ $result = json_decode(B2S_Api_Post::post(B2S_PLUGIN_API_ENDPOINT, array('action' => 'getNetworkBoardAndGroup', 'token' => B2S_PLUGIN_TOKEN, 'networkAuthId' => $_POST['networkAuthId'], 'networkId' => $_POST['networkId'], 'lang' => substr(B2S_LANGUAGE, 0, 2))));
72
+ if (is_object($result) && !empty($result) && isset($result->data) && !empty($result->data) && isset($result->result) && (int) $result->result == 1) {
73
+ require_once B2S_PLUGIN_DIR . 'includes/Form.php';
74
+ echo json_encode(array('result' => true, 'content' => B2S_Form::getNetworkBoardAndGroupHtml($result->data)));
75
+ wp_die();
76
+ }
77
+ }
78
+ echo json_encode(array('result' => false, 'content' => ''));
79
+ wp_die();
80
+ }
81
+
82
public function getFaqEntries() {
83
$result = json_decode(B2S_Api_Post::post(B2S_PLUGIN_API_ENDPOINT, array('action' => 'getFaqEntries', 'lang' => substr(B2S_LANGUAGE, 0, 2), 'token' => B2S_PLUGIN_TOKEN)));
84
if (isset($result->result) && isset($result->content) && !empty($result->content)) {
264
$network_details_id = (isset($_GET['filter_network_auth']) && (int) $_GET['filter_network_auth'] >= 1) ? (int) $_GET['filter_network_auth'] : 0; // 0=all
265
266
if (isset($_GET['start'])) {
267
+ $calendar = B2S_Calendar_Filter::getByTimespam($_GET['start'] . " 00:00:00", $_GET['end'] . " 23:59:59", $network_id, $network_details_id);
268
} else {
269
+ $calendar = B2S_Calendar_Filter::getAll($network_id, $network_details_id);
270
}
271
echo json_encode($calendar->asCalendarArray());
272
wp_die();
286
wp_die();
287
}
288
289
+ public function getPostEditModal() {
290
require_once (B2S_PLUGIN_DIR . 'includes/B2S/Calendar/Filter.php');
291
if (isset($_POST['id']) && (int) $_POST['id'] > 0) {
292
$item = B2S_Calendar_Filter::getById((int) $_POST['id']);
305
if ($lock_user_id) {
306
$lock_user = get_userdata($lock_user_id);
307
}
308
+ include (B2S_PLUGIN_DIR . 'views/b2s/partials/post-edit-modal.php');
309
wp_die();
310
}
311
}
319
$postData = get_post((int) $_POST['id']);
320
if (isset($postData->ID)) {
321
$postUrl = (get_permalink($postData->ID) !== false ? get_permalink($postData->ID) : $postData->guid);
322
+ include (B2S_PLUGIN_DIR . 'views/b2s/partials/calendar-image-modal.php');
323
wp_die();
324
}
325
}
330
public function getMultiWidgetContent() {
331
$option = get_option("B2S_MULTI_WIDGET");
332
if ($option !== false) {
333
+ if (is_array($option) && isset($option['timestamp']) && isset($option['content']) && !empty($option['content']) && $option['timestamp'] > date('Y-m-d H:i:s', strtotime("-1 hours"))) {
334
die($option['content']);
335
}
336
}
includes/Ajax/Post.php CHANGED
@@ -19,8 +19,8 @@ class Ajax_Post {
19
add_action('wp_ajax_b2s_delete_user_auth', array($this, 'deleteUserAuth'));
20
add_action('wp_ajax_b2s_update_user_version', array($this, 'updateUserVersion'));
21
add_action('wp_ajax_b2s_create_trail', array($this, 'createTrail'));
22
add_action('wp_ajax_b2s_delete_user_sched_post', array($this, 'deleteUserSchedPost'));
23
- add_action('wp_ajax_b2s_update_user_sched_time_post', array($this, 'updateUserSchedTimePost'));
24
add_action('wp_ajax_b2s_delete_user_publish_post', array($this, 'deleteUserPublishPost'));
25
add_action('wp_ajax_b2s_user_network_settings', array($this, 'saveUserNetworkSettings'));
26
add_action('wp_ajax_b2s_save_social_meta_tags', array($this, 'saveSocialMetaTags'));
@@ -31,11 +31,12 @@ class Ajax_Post {
31
add_action('wp_ajax_b2s_prg_logout', array($this, 'prgLogout'));
32
add_action('wp_ajax_b2s_prg_ship', array($this, 'prgShip'));
33
add_action('wp_ajax_b2s_notice_hide', array($this, 'noticeHide'));
34
add_action('wp_ajax_b2s_ship_navbar_save_settings', array($this, 'b2sShipNavbarSaveSettings'));
35
add_action('wp_ajax_b2s_post_mail_update', array($this, 'b2sPostMailUpdate'));
36
add_action('wp_ajax_b2s_calendar_move_post', array($this, 'b2sCalendarMovePost'));
37
- add_action('wp_ajax_b2s_calendar_delete', array($this, 'b2sCalendarDelete'));
38
- add_action('wp_ajax_b2s_calendar_save', array($this, 'b2sCalendarSave'));
39
add_action("wp_ajax_b2s_get_calendar_release_locks", array($this, 'releaseLocks'));
40
add_action("wp_ajax_b2s_hide_rating", array($this, 'hideRating'));
41
add_action("wp_ajax_b2s_hide_premium_message", array($this, 'hidePremiumMessage'));
@@ -106,7 +107,7 @@ class Ajax_Post {
106
107
public function lockAutoPostImport() {
108
if (isset($_POST['userId']) && (int) $_POST['userId'] > 0) {
109
- update_option('B2S_LOCK_AUTO_POST_IMPORT_' . (int) $_POST['user_id'], 1);
110
}
111
echo json_encode(array('result' => true));
112
wp_die();
@@ -286,37 +287,6 @@ class Ajax_Post {
286
$schedResult [] = $b2sShipSend->saveSchedDetails(array_merge($defaultPostData, $sendData), $schedData);
287
$content = array_merge($content, $schedResult);
288
}
289
-
290
- //OLD
291
- /* $oneSchedTimeRemove = false;
292
- if (isset($data['releaseSelect']) && (int) $data['releaseSelect'] == 1 && isset($data['date'][0]) && isset($data['time'][0])) {
293
- if ((int) strtotime(B2S_Util::getUTCForDate($data['date'][0] . ' ' . $data['time'][0], $sendData['user_timezone'] * (-1))) < (int) strtotime(gmdate('Y-m-d H:i:s'))) {
294
- $oneSchedTimeRemove = true;
295
- }
296
- }
297
-
298
- if ((int) $data['releaseSelect'] == 0) {
299
- $b2sShipSend->savePublishDetails(array_merge($defaultPostData, $sendData));
300
- } else {
301
- $schedData = array(
302
- 'weeks' => isset($data['weeks']) ? $data['weeks'] : 0,
303
- 'date' => isset($data['date']) ? $data['date'] : array(),
304
- 'time' => isset($data['time']) ? $data['time'] : array(),
305
- 'mo' => isset($data['mo']) ? $data['mo'] : array(),
306
- 'di' => isset($data['di']) ? $data['di'] : array(),
307
- 'mi' => isset($data['mi']) ? $data['mi'] : array(),
308
- 'do' => isset($data['do']) ? $data['do'] : array(),
309
- 'fr' => isset($data['fr']) ? $data['fr'] : array(),
310
- 'sa' => isset($data['sa']) ? $data['sa'] : array(),
311
- 'so' => isset($data['so']) ? $data['so'] : array(),
312
- 'releaseSelect' => isset($data['releaseSelect']) ? $data['releaseSelect'] : 0,
313
- 'user_timezone' => isset($post['user_timezone']) ? $post['user_timezone'] : 0,
314
- 'saveSetting' => isset($data['saveSchedSetting']) ? true : false
315
- );
316
-
317
- $schedResult [] = $b2sShipSend->saveSchedDetails(array_merge($defaultPostData, $sendData), $schedData);
318
- $content = array_merge($content, $schedResult);
319
- } */
320
}
321
322
if (!empty($b2sShipSend->postData)) {
@@ -342,6 +312,7 @@ class Ajax_Post {
342
343
$card_active = (!isset($_POST['b2s_card_active'])) ? 0 : 1;
344
$options->_setOption('card_active', $card_active);
345
$options->_setOption('card_default_title', $_POST['b2s_card_default_title']);
346
$options->_setOption('card_default_desc', $_POST['b2s_card_default_desc']);
347
$options->_setOption('card_default_image', $_POST['b2s_card_default_image']);
@@ -354,13 +325,13 @@ class Ajax_Post {
354
}
355
356
//Customize per user premium function
357
- /*if (isset($_POST['version']) && (int) $_POST['version'] >= 1 && isset($_POST['b2s_og_article_author']) && isset($_POST['b2s_card_twitter_creator'])) {
358
- $options = new B2S_Options(B2S_PLUGIN_BLOG_USER_ID);
359
- $og_article_author = (isset($_POST['b2s_og_article_author']) && !empty($_POST['b2s_og_article_author'])) ? trim($_POST['b2s_og_article_author']) : "";
360
- $card_twitter_creator = (isset($_POST['b2s_card_twitter_creator']) && !empty($_POST['b2s_card_twitter_creator'])) ? trim($_POST['b2s_card_twitter_creator']) : "";
361
- $meta_author_data = array('og_article_author' => $og_article_author, 'card_twitter_creator' => $card_twitter_creator);
362
- $options->_setOption('meta_author_data', $meta_author_data);
363
- }*/
364
echo json_encode($result);
365
wp_die();
366
}
@@ -374,6 +345,25 @@ class Ajax_Post {
374
wp_die();
375
}
376
377
public function saveUserNetworkSettings() {
378
379
if (isset($_POST['short_url'])) {
@@ -582,16 +572,6 @@ class Ajax_Post {
582
wp_die();
583
}
584
585
- public function updateUserSchedTimePost() {
586
- require_once (B2S_PLUGIN_DIR . '/includes/B2S/Post/Tools.php');
587
- if (isset($_POST['postId']) && (int) $_POST['postId'] > 0 && isset($_POST['date']) && !empty($_POST['date']) && isset($_POST['time']) && !empty($_POST['time'])) {
588
- echo json_encode(B2S_Post_Tools::updateUserSchedTimePost($_POST['postId'], $_POST['date'], $_POST['time'], $_POST['user_timezone']));
589
- wp_die();
590
- }
591
- echo json_encode(array('result' => false));
592
- wp_die();
593
- }
594
-
595
public function deleteUserSchedPost() {
596
require_once (B2S_PLUGIN_DIR . '/includes/B2S/Post/Tools.php');
597
@@ -655,6 +635,12 @@ class Ajax_Post {
655
wp_die();
656
}
657
658
public function b2sShipNavbarSaveSettings() {
659
if (isset($_POST['mandantId'])) {
660
global $wpdb;
@@ -714,7 +700,7 @@ class Ajax_Post {
714
wp_die();
715
}
716
717
- public function b2sCalendarDelete() {
718
global $wpdb;
719
if (isset($_POST['b2s_id']) && (int) $_POST['b2s_id'] > 0 && isset($_POST['post_id']) && (int) $_POST['post_id'] > 0) {
720
$sql = $wpdb->prepare("SELECT id,post_id FROM b2s_posts WHERE id =%d AND publish_date = %s", (int) $_POST['b2s_id'], "0000-00-00 00:00:00");
@@ -729,12 +715,13 @@ class Ajax_Post {
729
wp_die();
730
}
731
732
- public function b2sCalendarSave() {
733
global $wpdb;
734
require_once (B2S_PLUGIN_DIR . 'includes/B2S/Calendar/Save.php');
735
$post = $_POST;
736
$metaOg = false;
737
$metaCard = false;
738
739
if ($post['save_method'] == "apply-all") {
740
$b2sids = array();
@@ -831,6 +818,7 @@ class Ajax_Post {
831
);
832
833
if (isset($data['date'][0]) && isset($data['time'][0])) {
834
$schedData = array(
835
'date' => isset($data['date']) ? $data['date'] : array(),
836
'time' => isset($data['time']) ? $data['time'] : array(),
@@ -845,7 +833,7 @@ class Ajax_Post {
845
delete_option("B2S_PLUGIN_CALENDAR_BLOCKED_" . $b2s_id);
846
}
847
848
- echo json_encode(array('result' => true));
849
wp_die();
850
}
851
19
add_action('wp_ajax_b2s_delete_user_auth', array($this, 'deleteUserAuth'));
20
add_action('wp_ajax_b2s_update_user_version', array($this, 'updateUserVersion'));
21
add_action('wp_ajax_b2s_create_trail', array($this, 'createTrail'));
22
+ add_action('wp_ajax_b2s_save_network_board_and_group', array($this, 'saveNetworkBoardAndGroup'));
23
add_action('wp_ajax_b2s_delete_user_sched_post', array($this, 'deleteUserSchedPost'));
24
add_action('wp_ajax_b2s_delete_user_publish_post', array($this, 'deleteUserPublishPost'));
25
add_action('wp_ajax_b2s_user_network_settings', array($this, 'saveUserNetworkSettings'));
26
add_action('wp_ajax_b2s_save_social_meta_tags', array($this, 'saveSocialMetaTags'));
31
add_action('wp_ajax_b2s_prg_logout', array($this, 'prgLogout'));
32
add_action('wp_ajax_b2s_prg_ship', array($this, 'prgShip'));
33
add_action('wp_ajax_b2s_notice_hide', array($this, 'noticeHide'));
34
+ add_action('wp_ajax_b2s_network_tos_accept', array($this, 'networkTosAccept'));
35
add_action('wp_ajax_b2s_ship_navbar_save_settings', array($this, 'b2sShipNavbarSaveSettings'));
36
add_action('wp_ajax_b2s_post_mail_update', array($this, 'b2sPostMailUpdate'));
37
add_action('wp_ajax_b2s_calendar_move_post', array($this, 'b2sCalendarMovePost'));
38
+ add_action('wp_ajax_b2s_delete_post', array($this, 'b2sDeletePost'));
39
+ add_action('wp_ajax_b2s_edit_save_post', array($this, 'b2sEditSavePost'));
40
add_action("wp_ajax_b2s_get_calendar_release_locks", array($this, 'releaseLocks'));
41
add_action("wp_ajax_b2s_hide_rating", array($this, 'hideRating'));
42
add_action("wp_ajax_b2s_hide_premium_message", array($this, 'hidePremiumMessage'));
107
108
public function lockAutoPostImport() {
109
if (isset($_POST['userId']) && (int) $_POST['userId'] > 0) {
110
+ update_option('B2S_LOCK_AUTO_POST_IMPORT_' . (int) $_POST['userId'], 1);
111
}
112
echo json_encode(array('result' => true));
113
wp_die();
287
$schedResult [] = $b2sShipSend->saveSchedDetails(array_merge($defaultPostData, $sendData), $schedData);
288
$content = array_merge($content, $schedResult);
289
}
290
}
291
292
if (!empty($b2sShipSend->postData)) {
312
313
$card_active = (!isset($_POST['b2s_card_active'])) ? 0 : 1;
314
$options->_setOption('card_active', $card_active);
315
+ $options->_setOption('card_default_type', $_POST['b2s_card_default_type']);
316
$options->_setOption('card_default_title', $_POST['b2s_card_default_title']);
317
$options->_setOption('card_default_desc', $_POST['b2s_card_default_desc']);
318
$options->_setOption('card_default_image', $_POST['b2s_card_default_image']);
325
}
326
327
//Customize per user premium function
328
+ /* if (isset($_POST['version']) && (int) $_POST['version'] >= 1 && isset($_POST['b2s_og_article_author']) && isset($_POST['b2s_card_twitter_creator'])) {
329
+ $options = new B2S_Options(B2S_PLUGIN_BLOG_USER_ID);
330
+ $og_article_author = (isset($_POST['b2s_og_article_author']) && !empty($_POST['b2s_og_article_author'])) ? trim($_POST['b2s_og_article_author']) : "";
331
+ $card_twitter_creator = (isset($_POST['b2s_card_twitter_creator']) && !empty($_POST['b2s_card_twitter_creator'])) ? trim($_POST['b2s_card_twitter_creator']) : "";
332
+ $meta_author_data = array('og_article_author' => $og_article_author, 'card_twitter_creator' => $card_twitter_creator);
333
+ $options->_setOption('meta_author_data', $meta_author_data);
334
+ } */
335
echo json_encode($result);
336
wp_die();
337
}
345
wp_die();
346
}
347
348
+ public function saveNetworkBoardAndGroup() {
349
+ if (isset($_POST['networkAuthId']) && !empty($_POST['networkAuthId']) && isset($_POST['networkType']) && isset($_POST['boardAndGroup']) && !empty($_POST['boardAndGroup']) && isset($_POST['networkId']) && !empty($_POST['networkId']) && isset($_POST['lang']) && !empty($_POST['lang'])) {
350
+ $post = array('token' => B2S_PLUGIN_TOKEN,
351
+ 'action' => 'saveNetworkBoardAndGroup',
352
+ 'networkAuthId' => $_POST['networkAuthId'],
353
+ 'networkType' => (int) $_POST['networkType'],
354
+ 'networkId' => (int) $_POST['networkId'],
355
+ 'boardAndGroup' => $_POST['boardAndGroup'],
356
+ 'lang' => $_POST['lang']);
357
+ $result = json_decode(B2S_Api_Post::post(B2S_PLUGIN_API_ENDPOINT, $post));
358
+ if ($result->result == true) {
359
+ echo json_encode(array('result' => true));
360
+ wp_die();
361
+ }
362
+ }
363
+ echo json_encode(array('result' => false));
364
+ wp_die();
365
+ }
366
+
367
public function saveUserNetworkSettings() {
368
369
if (isset($_POST['short_url'])) {
572
wp_die();
573
}
574
575
public function deleteUserSchedPost() {
576
require_once (B2S_PLUGIN_DIR . '/includes/B2S/Post/Tools.php');
577
635
wp_die();
636
}
637
638
+ public function networkTosAccept() {
639
+ update_option('B2S_PLUGIN_NETWORK_TOS_ACCEPT_032018_USER_' . B2S_PLUGIN_BLOG_USER_ID, 1);
640
+ echo json_encode(array('result' => true));
641
+ wp_die();
642
+ }
643
+
644
public function b2sShipNavbarSaveSettings() {
645
if (isset($_POST['mandantId'])) {
646
global $wpdb;
700
wp_die();
701
}
702
703
+ public function b2sDeletePost() {
704
global $wpdb;
705
if (isset($_POST['b2s_id']) && (int) $_POST['b2s_id'] > 0 && isset($_POST['post_id']) && (int) $_POST['post_id'] > 0) {
706
$sql = $wpdb->prepare("SELECT id,post_id FROM b2s_posts WHERE id =%d AND publish_date = %s", (int) $_POST['b2s_id'], "0000-00-00 00:00:00");
715
wp_die();
716
}
717
718
+ public function b2sEditSavePost() {
719
global $wpdb;
720
require_once (B2S_PLUGIN_DIR . 'includes/B2S/Calendar/Save.php');
721
$post = $_POST;
722
$metaOg = false;
723
$metaCard = false;
724
+ $sched_date = '';
725
726
if ($post['save_method'] == "apply-all") {
727
$b2sids = array();
818
);
819
820
if (isset($data['date'][0]) && isset($data['time'][0])) {
821
+ $sched_date = B2S_Util::getCustomDateFormat(date('Y-m-d H:i:00', strtotime($data['date'][0] . ' ' . $data['time'][0])), substr(B2S_LANGUAGE, 0, 2));
822
$schedData = array(
823
'date' => isset($data['date']) ? $data['date'] : array(),
824
'time' => isset($data['time']) ? $data['time'] : array(),
833
delete_option("B2S_PLUGIN_CALENDAR_BLOCKED_" . $b2s_id);
834
}
835
836
+ echo json_encode(array('result' => true, 'date' => $sched_date));
837
wp_die();
838
}
839
includes/B2S/Network/Item.php CHANGED
@@ -6,6 +6,7 @@ class B2S_Network_Item {
6
private $allowProfil;
7
private $allowPage;
8
private $allowGroup;
9
private $oAuthPortal;
10
private $mandantenId;
11
@@ -17,6 +18,7 @@ class B2S_Network_Item {
17
$this->allowPage = unserialize(B2S_PLUGIN_NETWORK_ALLOW_PAGE);
18
$this->allowGroup = unserialize(B2S_PLUGIN_NETWORK_ALLOW_GROUP);
19
$this->oAuthPortal = unserialize(B2S_PLUGIN_NETWORK_OAUTH);
20
}
21
}
22
@@ -99,7 +101,7 @@ class B2S_Network_Item {
99
$html .='<div class="media-body network">';
100
$html .= '<h4>' . ucfirst($networkName);
101
if ($maxNetworkAccount !== false) {
102
- $html .=' <span class="b2s-network-auth-count">(' . __("Connections", "blog2social") . ' <span class="b2s-network-auth-count-current" '.(($showAllAuths) ? 'data-network-count-trigger="true"' : '').' data-network-id="' . $networkId . '"></span>/' . $maxNetworkAccount . ')</span>';
103
}
104
$html .= '<span class="pull-right">';
105
@@ -114,9 +116,9 @@ class B2S_Network_Item {
114
}
115
116
$html .= '</span></h4>';
117
$html .= '<ul class="b2s-network-item-auth-list" data-network-mandant-id="' . $mandantId . '" data-network-id="' . $networkId . '" ' . (($showAllAuths) ? 'data-network-count="true"' : '') . '>';
118
119
-
120
if ($showAllAuths) {
121
foreach ($this->mandantenId as $ka => $mandantAll) {
122
$mandantName = isset($mandantenData->{$mandantAll}) ? ($mandantenData->{$mandantAll}) : __("My profile", "blog2social");
@@ -144,23 +146,29 @@ class B2S_Network_Item {
144
if ($v['notAllow'] !== false) {
145
$html .='<span class="glyphicon glyphicon-remove-circle glyphicon-danger"></span> <span class="not-allow">' . __('Profile', 'blog2social') . ': ' . stripslashes($v['networkUserName']) . '</span> ';
146
} else {
147
- $html .= '<span>'.__('Profile', 'blog2social') . ': ' . stripslashes($v['networkUserName']) . '</span> ';
148
}
149
150
if (!empty($mandantName)) {
151
$html .='<span class="b2s-network-mandant-name">(' . $mandantName . ')</span> ';
152
}
153
154
- if ($v['notAllow'] === false) {
155
- $html .= '<a href="#" onclick="wop(\'' . $b2sAuthUrl . '&choose=profil&update=' . $v['networkAuthId'] . '\', \'Blog2Social Network\'); return false;" class="b2s-network-auth-btn b2s-network-auth-update-btn add-padding-left" data-network-auth-id="' . $v['networkAuthId'] . '"><span class="glyphicon glyphicon-refresh glyphicon-grey"></span></a>';
156
- }
157
- $html .= '<a class="b2s-network-item-auth-list-btn-delete" data-network-id="'.$networkId.'" data-network-auth-id="' . $v['networkAuthId'] . '" href="#"><span class="glyphicon glyphicon-trash glyphicon-grey"></span></a>';
158
$html .= ($v['expiredDate'] != '0000-00-00' && $v['expiredDate'] <= date('Y-m-d')) ? ' <span class="label label-danger b2s-network-auth-update-label" data-network-auth-id="' . $v['networkAuthId'] . '">' . __('Authorization is interrupted since', 'blog2social') . ' ' . ($sprache == 'en' ? $v['expiredDate'] : date('d.m.Y', strtotime($v['expiredDate']))) . '</span>' : '';
159
- if ($v['notAllow'] !== false) {
160
- $html .='<div class="no-allow-info-text">' . __('To reactivate this social media connection,', 'blog2social') . ' <a href="' . B2S_Tools::getSupportLink('affiliate') . '"target="_blank">' . __('please upgrade', 'blog2social') . '</a></div>';
161
}
162
-
163
- $html .= '</li>';
164
}
165
}
166
if (isset($networkData[1])) {
@@ -170,23 +178,29 @@ class B2S_Network_Item {
170
if ($v['notAllow'] !== false) {
171
$html .='<span class="glyphicon glyphicon-remove-circle glyphicon-danger"></span> <span class="not-allow">' . __('Page', 'blog2social') . ': ' . stripslashes($v['networkUserName']) . '</span> ';
172
} else {
173
- $html .='<span>'. __('Page', 'blog2social') . ': ' . stripslashes($v['networkUserName']) . '</span> ';
174
}
175
176
if (!empty($mandantName)) {
177
$html .='<span class="b2s-network-mandant-name">(' . $mandantName . ')</span> ';
178
}
179
180
if ($v['notAllow'] === false) {
181
- $html .= '<a href="#" onclick="wop(\'' . $b2sAuthUrl . '&choose=page&update=' . $v['networkAuthId'] . '\', \'Blog2Social Network\'); return false;" class="b2s-network-auth-btn b2s-network-auth-update-btn add-padding-left" data-network-auth-id="' . $v['networkAuthId'] . '"><span class="glyphicon glyphicon-refresh glyphicon-grey"></span></a>';
182
}
183
- $html .= '<a class="b2s-network-item-auth-list-btn-delete" data-network-id="'.$networkId.'" data-network-auth-id="' . $v['networkAuthId'