Blog2Social: Social Media Auto Post & Scheduler - Version 4.4.0

Version Description

Usability Optimization, auto post imported content, Instagram image post format

Download this release

Release Info

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

Code changes from version 4.3.3 to 4.4.0

Files changed (62) hide show
  1. assets/css/b2s/howto.css +27 -0
  2. assets/css/b2s/premium.css +12 -0
  3. assets/css/b2s/settings.css +49 -1
  4. assets/css/b2s/start.css +115 -0
  5. assets/css/general.css +24 -1
  6. assets/images/features/image-select.png +0 -0
  7. assets/images/features/post-types.png +0 -0
  8. assets/images/settings/b2s-post-format-12-1-de.png +0 -0
  9. assets/images/settings/b2s-post-format-12-1-en.png +0 -0
  10. assets/images/settings/b2s-post-format-12-2-de.png +0 -0
  11. assets/images/settings/b2s-post-format-12-2-en.png +0 -0
  12. assets/js/b2s/calendar.js +332 -367
  13. assets/js/b2s/general.js +68 -0
  14. assets/js/b2s/post.js +27 -61
  15. assets/js/b2s/settings.js +92 -4
  16. assets/js/b2s/ship.js +34 -39
  17. assets/js/b2s/start.js +128 -2
  18. assets/js/b2s/wp/post-box.js +19 -1
  19. assets/lib/btn-toogle/bootstrap-toggle.min.css +28 -0
  20. assets/lib/btn-toogle/bootstrap-toggle.min.js +9 -0
  21. assets/lib/chosen/chosen.jquery.min.js +2 -0
  22. assets/lib/chosen/chosen.min.css +3 -0
  23. assets/lib/chosen/img/chosen-sprite.png +0 -0
  24. assets/lib/chosen/img/chosen-sprite@2x.png +0 -0
  25. blog2social.php +3 -3
  26. includes/Ajax/Get.php +43 -17
  27. includes/Ajax/Post.php +57 -1
  28. includes/{AutoShare.php → B2S/AutoPost.php} +2 -1
  29. includes/B2S/Heartbeat.php +38 -35
  30. includes/B2S/Post/Item.php +16 -5
  31. includes/B2S/PostBox.php +39 -5
  32. includes/B2S/Rating.php +33 -0
  33. includes/B2S/Settings/Item.php +174 -38
  34. includes/B2S/Ship/Image.php +3 -3
  35. includes/B2S/Ship/Item.php +39 -26
  36. includes/B2S/Ship/Navbar.php +1 -1
  37. includes/B2S/Ship/Save.php +24 -17
  38. includes/B2S/Stats.php +84 -0
  39. includes/Loader.php +187 -43
  40. includes/Notice.php +0 -1
  41. includes/Tools.php +6 -0
  42. includes/Util.php +3 -1
  43. languages/blog2social-de_DE.mo +0 -0
  44. languages/blog2social-de_DE.po +1755 -1378
  45. readme.txt +6 -2
  46. views/b2s/dashboard.php +80 -195
  47. views/b2s/howto.php +58 -0
  48. views/b2s/html/footer.phtml +20 -1
  49. views/b2s/html/header.phtml +84 -14
  50. views/b2s/html/post.navbar.phtml +4 -2
  51. views/b2s/image.calendar.php +1 -2
  52. views/b2s/post.calendar.php +1 -1
  53. views/b2s/premium.php +129 -0
  54. views/b2s/settings.php +34 -7
  55. views/b2s/ship.php +5 -2
  56. views/b2s/widgets/activity.php +15 -0
  57. views/b2s/widgets/content.php +10 -0
  58. views/b2s/widgets/newsletter.php +19 -0
  59. views/b2s/widgets/posts.php +88 -0
  60. views/b2s/widgets/premium.php +117 -0
  61. views/b2s/widgets/support.php +10 -0
  62. views/b2s/widgets/tutorial.php +4 -0
assets/css/b2s/howto.css ADDED
@@ -0,0 +1,27 @@
1
+ .b2s-dashboard-h5{
2
+ font-size: 26px;
3
+ }
4
+ .b2s-faq-content a{
5
+ color: #79B232;
6
+ }
7
+ #b2s_howto_text{
8
+ font-size: 22px;
9
+ margin-bottom: 30px !important;
10
+ }
11
+ #b2s_faq_text{
12
+ font-size: 22px;
13
+ }
14
+ @media (max-width: 768px)
15
+ {
16
+ body .col-md-6{
17
+ padding-left: 0;
18
+ padding-right: 0;
19
+ }
20
+ #b2s_howto_text {
21
+ font-size: 16px;
22
+ margin-top: 5px !important;
23
+ }
24
+ #b2s_faq_text{
25
+ font-size: 16px;
26
+ }
27
+ }
assets/css/b2s/premium.css ADDED
@@ -0,0 +1,12 @@
1
+ body .thumbnail{
2
+ border: none;
3
+ }
4
+ .b2s-container p{
5
+ text-align: center;
6
+ }
7
+ @media(max-width: 768px)
8
+ {
9
+ .del-padding-right{
10
+ margin-right: 10px;
11
+ }
12
+ }
assets/css/b2s/settings.css CHANGED
@@ -76,4 +76,52 @@ hr{
76
.b2s-post-item-network-image{
77
height: 16px;
78
width: 16px;
79
- }
76
.b2s-post-item-network-image{
77
height: 16px;
78
width: 16px;
79
+ }
80
+ .b2s-key-name{
81
+ color: #3d3f42;
82
+ font-weight: 600;
83
+ }
84
+
85
+ .b2s-network-auth-count {
86
+ font-size: 12px;
87
+ font-style: italic;
88
+ color: #777;
89
+ font-weight: normal;
90
+ line-height: 1;
91
+ }
92
+ .list-group-item{
93
+ border: 0px !important;
94
+ }
95
+
96
+ .b2s-img-network {
97
+ width: 36px !important;
98
+ margin-top: 8px !important;
99
+ }
100
+
101
+ .b2s-input-text-size-45{
102
+ width: 45px;
103
+ }
104
+
105
+ .chosen-container{
106
+ min-width: 50% !important;
107
+ }
108
+
109
+ .padding-bottom-3{
110
+ padding-bottom: 3px;
111
+ }
112
+
113
+ .b2s-text-sm{
114
+ margin-top: 5px;
115
+ font-size: 14px;
116
+ }
117
+
118
+ .b2s-bold{
119
+ font-weight: 600;
120
+ }
121
+
122
+ ul.chosen-choices {
123
+ background-image: none !important;
124
+ border-radius: 3px;
125
+ border: 1px solid #d7d7d7 !important;
126
+ box-shadow: none;
127
+ }
assets/css/b2s/start.css CHANGED
@@ -72,3 +72,118 @@
72
.b2s-dashoard-btn-phone{
73
cursor: default !important;
74
}
72
.b2s-dashoard-btn-phone{
73
cursor: default !important;
74
}
75
+
76
+ /* Widgets */
77
+
78
+ /* Content-Widget */
79
+ .b2s-widget-block-image-content{
80
+ display: flex;
81
+ font-size: 22px;
82
+ line-height: 1.2;
83
+ }
84
+ .b2s-widget-block-image-content > img{
85
+ max-height: 150px;
86
+ max-width: 150px;
87
+ margin-right: 10px;
88
+ }
89
+ body .form-inline{
90
+ display: block;
91
+ }
92
+ .b2s-dashboard-multi-widget-inner{
93
+ display: flex;
94
+ justify-content: space-between;
95
+ align-items: center;
96
+ min-height: 200px;
97
+ }
98
+ .b2s-dashboard-multi-widget-inner .glyphicon-chevron-left{
99
+ flex: 0 0 15px;
100
+ font-size: 30px;
101
+ cursor:pointer
102
+ }
103
+ .b2s-dashboard-multi-widget-inner .glyphicon-chevron-right {
104
+ flex: 0 0 15px;
105
+ font-size: 30px;
106
+ cursor:pointer
107
+ }
108
+ .b2s-dashboard-multi-widget-content{
109
+ flex: 0 1 450px;
110
+ }
111
+ @media(max-width: 530px)
112
+ {
113
+ .b2s-widget-block-image-content{
114
+ display: block;
115
+ }
116
+ .b2s-widget-block-image-content > img{
117
+ margin: 5px auto;
118
+ display: block;
119
+ height: auto;
120
+ }
121
+ .b2s-widget-block-image-content > div > .btn-primary{
122
+ display: block;
123
+ }
124
+
125
+ }
126
+
127
+ /* Newsletter-Widget*/
128
+ @media(max-width: 768px)
129
+ {
130
+ #b2snewsletter.form-inline input{
131
+ width: 100% !important;
132
+ margin-bottom: 15px;
133
+ }
134
+ #b2snewsletter.form-inline a{
135
+ width: auto;
136
+ }
137
+ }
138
+
139
+ /* Posts-Widget */
140
+ .btn-link.b2s-post-btn{
141
+ font-size: 26px;
142
+ padding-top: 0;
143
+ color: #444;
144
+ font-weight: 500;
145
+ line-height: 1.1;
146
+ text-decoration: none !important;
147
+ }
148
+ .btn-link.b2s-post-btn .label{
149
+ font-size: 16px !important;
150
+ }
151
+ ul.b2s-sort-result-item-area{
152
+ margin-bottom: 0;
153
+ }
154
+ @media(max-width: 380px)
155
+ {
156
+ .btn-link.b2s-post-btn .label{
157
+ font-size: 9px !important;
158
+ }
159
+ }
160
+ @media(max-width: 350px)
161
+ {
162
+ .btn-link.b2s-post-btn.b2s-btn-disabled{
163
+ display: none;
164
+ }
165
+ }
166
+
167
+ /* Support */
168
+ .b2s-faq-content a{
169
+ color:#79B232;
170
+ }
171
+ #b2s-faq-button{
172
+ float:right;
173
+ }
174
+ .b2sDetailsSchedPostBtn{
175
+ display: none !important;
176
+ }
177
+
178
+ /* Aktivität */
179
+ #b2s-activity-date-picker{
180
+ width: 85px;
181
+ border-radius: 5px;
182
+ border: 1px solid #ddd;
183
+ }
184
+
185
+ /* Tutorial */
186
+ #b2s_tutorial_link {
187
+ float: right;
188
+ margin-top: 27px;
189
+ }
assets/css/general.css CHANGED
@@ -7153,6 +7153,29 @@ input[type="checkbox"].error + label{
7153
.btn-label-premium {
7154
color: #fff !important;
7155
}
7156
- .btn-label-premium-xs{
7157
font-size: 11px !important;
7158
}
7153
.btn-label-premium {
7154
color: #fff !important;
7155
}
7156
+ .btn-label-premium-xs {
7157
font-size: 11px !important;
7158
+ }
7159
+
7160
+ #adminmenu .toplevel_page_blog2social ul li:last-child{
7161
+ background-color: #79B232;
7162
+ }
7163
+ #adminmenu .toplevel_page_blog2social ul li:last-child a{
7164
+ color: #fff !important;
7165
+ }
7166
+ #adminmenu .toplevel_page_blog2social ul li:last-child:hover a{
7167
+ text-decoration: underline;
7168
+ }
7169
+ .b2s-close{
7170
+ color:#aaa;
7171
+ float:right;
7172
+ cursor:pointer
7173
+ }
7174
+ .b2s-notice-buttons{
7175
+ padding-top:10px;
7176
+ display: flex;
7177
+ justify-content: space-between
7178
+ }
7179
+ .b2s-notice{
7180
+ border-left: 5px solid #79B232;
7181
}
assets/images/features/image-select.png ADDED
Binary file
assets/images/features/post-types.png ADDED
Binary file
assets/images/settings/b2s-post-format-12-1-de.png ADDED
Binary file
assets/images/settings/b2s-post-format-12-1-en.png ADDED
Binary file
assets/images/settings/b2s-post-format-12-2-de.png ADDED
Binary file
assets/images/settings/b2s-post-format-12-2-en.png ADDED
Binary file
assets/js/b2s/calendar.js CHANGED
@@ -1,367 +1,332 @@
1
- jQuery.noConflict();
2
-
3
- jQuery(document).ready(function () {
4
-
5
- jQuery('#b2s_calendar').fullCalendar({
6
- editable: b2s_has_premium,
7
- locale: b2s_calendar_locale,
8
- eventLimit: 2,
9
- timeFormat: 'H:mm',
10
- events: ajaxurl + '?action=b2s_get_calendar_events',
11
- eventRender: function (event, element) {
12
- $header = jQuery("<div>").addClass("b2s-calendar-header");
13
- $network_name = jQuery("<span>").text(event.author).addClass("network-name").css("display", "block");
14
- element.find(".fc-time").after($network_name);
15
- element.html(element.html());
16
- $parent = element.parent();
17
- $header.append(element.find(".fc-content"));
18
- element.append($header);
19
- $body = jQuery("<div>").addClass("b2s-calendar-body");
20
- $body.append(event.avatar);
21
- $body.append(element.find(".fc-title"));
22
- $body.append(jQuery("<br>"));
23
- var $em = jQuery("<em>").css("padding-top", "5px").css("display", "block");
24
- $em.append("<img src='" + b2s_plugin_url + "assets/images/portale/" + event.network_id + "_flat.png' style='height: 16px;width: 16px;display: inline-block;padding-right: 2px;padding-left: 2px;' />")
25
- $em.append(event.network_name);
26
- $em.append(jQuery("<span>").text(": " + event.profile));
27
- $body.append($em);
28
-
29
- element.append($body);
30
- },
31
- eventDrop: function (event, delta, revertFunc) {
32
- jQuery.ajax({
33
- url: ajaxurl,
34
- type: "POST",
35
- dataType: "json",
36
- cache: false,
37
- data: {
38
- 'action': 'b2s_calendar_move_post',
39
- 'b2s_id': event.b2s_id,
40
- 'user_timezone': event.user_timezone,
41
- 'sched_date': event.start.format(),
42
- },
43
- success: function (data) {
44
- wp.heartbeat.connectNow();
45
- }
46
- });
47
- },
48
- eventAllow: function (dropLocation, draggedEvent) {
49
- return dropLocation.start.isAfter(b2s_calendar_date) && draggedEvent.start.isAfter(b2s_calendar_datetime);
50
- },
51
- eventClick: function (calEvent, jsEvent, view) {
52
-
53
- if (jQuery('#b2s-edit-event-modal-' + calEvent.b2s_id).length == 1)
54
- {
55
- jQuery('#b2s-edit-event-modal-' + calEvent.b2s_id).remove();
56
- }
57
- b2s_current_post_id = calEvent.post_id;
58
- var $modal = jQuery("<div>");
59
-
60
- jQuery.ajax({
61
- url: ajaxurl,
62
- type: "POST",
63
- cache: false,
64
- async: false,
65
- data: {
66
- 'action': 'b2s_get_calendar_edit_modal',
67
- 'id': calEvent.b2s_id
68
- },
69
- success: function (data) {
70
- $modal = $modal.html(data);
71
- }
72
- });
73
- jQuery("body").append($modal);
74
-
75
- jQuery('#b2sUserTimeZone').val(jQuery('#user_timezone').val());
76
-
77
- jQuery('#b2s-edit-event-modal-' + calEvent.b2s_id).modal('show');
78
- activatePortal(calEvent.network_auth_id);
79
- initSceditor(calEvent.network_auth_id);
80
- networkCount(calEvent.network_auth_id);
81
-
82
- if (jQuery('.b2s-post-ship-item-post-format-text[data-network-type="' + calEvent.network_type + '"][data-network-id="' + calEvent.network_id + '"]').length > 0) {
83
- var postFormatText = b2s_calendar_formats;
84
-
85
- var isSetPostFormat = false;
86
- //is set post format => override current condidtions by user settings for this post
87
- if (calEvent.post_format !== null) {
88
- jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + calEvent.network_type + '"][data-network-id="' + calEvent.network_id + '"]').val(calEvent.post_format);
89
- jQuery('.b2s-post-ship-item-post-format-text[data-network-auth-id="' + calEvent.network_auth_id + '"]').html(postFormatText[calEvent.post_format]);
90
- jQuery('.b2s-post-item-details-post-format[data-network-auth-id="' + calEvent.network_auth_id + '"]').val(calEvent.post_format);
91
-
92
- //edit modal select post format
93
- jQuery('.b2s-user-network-settings-post-format[data-network-type="' + calEvent.network_type + '"][data-network-id="' + calEvent.network_id + '"]').removeClass('b2s-settings-checked');
94
- jQuery('.b2s-user-network-settings-post-format[data-network-type="' + calEvent.network_type + '"][data-network-id="' + calEvent.network_id + '"][data-post-format="' + calEvent.post_format + '"]').addClass('b2s-settings-checked');
95
-
96
- } else {
97
- jQuery('.b2s-post-ship-item-post-format-text[data-network-auth-id="' + calEvent.network_auth_id + '"]').html(postFormatText[jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + calEvent.network_type + '"][data-network-id="' + calEvent.network_id + '"]').val()]);
98
- 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());
99
- }
100
-
101
- //if linkpost then show btn meta tags
102
- var isMetaChecked = false;
103
- if (calEvent.network_id == "1" && jQuery('#isOgMetaChecked').val() == "1") {
104
- isMetaChecked = true;
105
- }
106
- if (calEvent.network_id == "2" && jQuery('#isCardMetaChecked').val() == "1") {
107
- isMetaChecked = true;
108
- }
109
- if (isMetaChecked && jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + calEvent.network_type + '"][data-network-id="' + calEvent.network_id + '"]').val() == "0") {
110
- jQuery('.b2s-post-item-details-preview-title[data-network-auth-id="' + calEvent.network_auth_id + '"]').prop("readonly", false);
111
- jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + calEvent.network_auth_id + '"]').prop("readonly", false);
112
- jQuery('.b2s-post-item-details-preview-url-reload[data-network-id="' + calEvent.network_id + '"]').hide();
113
-
114
- var dataMetaType = jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + calEvent.network_auth_id + '"]').attr("data-meta-type");
115
- if (dataMetaType == "og") {
116
- jQuery('#b2sChangeOgMeta').val("1");
117
- } else {
118
- jQuery('#b2sChangeCardMeta').val("1");
119
- }
120
-
121
- } else {
122
- jQuery('.b2s-post-item-details-preview-title[data-network-auth-id="' + calEvent.network_auth_id + '"]').prop("readonly", true);
123
- jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + calEvent.network_auth_id + '"]').prop("readonly", true);
124
- jQuery('.b2s-post-item-details-preview-url-reload[data-network-id="' + calEvent.network_id + '"]').show();
125
- jQuery('.b2s-post-item-details-preview-url-reload[data-network-id="' + calEvent.network_id + '"]').trigger("click");
126
- }
127
-
128
-
129
- }
130
-
131
- jQuery("#b2sPostId").val(calEvent.post_id);
132
-
133
- var today = new Date();
134
- var dateFormat = "yyyy-mm-dd";
135
- var language = "en";
136
- var showMeridian = true;
137
- if (jQuery('#b2sUserLang').val() == "de") {
138
- dateFormat = "dd.mm.yyyy";
139
- language = "de";
140
- showMeridian = false;
141
- //printDateFormat(calEvent.network_auth_id);
142
- }
143
-
144
- jQuery(".b2s-post-item-details-release-input-date").datepicker({
145
- format: dateFormat,
146
- language: language,
147
- maxViewMode: 2,
148
- todayHighlight: true,
149
- startDate: today,
150
- calendarWeeks: true,
151
- autoclose: true
152
- });
153
-
154
- jQuery('.b2s-post-item-details-release-input-time').timepicker({
155
- minuteStep: 15,
156
- appendWidgetTo: 'body',
157
- showSeconds: false,
158
- showMeridian: showMeridian,
159
- defaultTime: 'current',
160
- snapToStep: true
161
- });
162
-
163
-
164
- jQuery(".b2s-post-item-details-release-input-date").datepicker().on('changeDate', function (e) {
165
- checkSchedDateTime(calEvent.network_auth_id);
166
- });
167
- jQuery('.b2s-post-item-details-release-input-time').timepicker().on('changeTime.timepicker', function (e) {
168
- checkSchedDateTime(calEvent.network_auth_id);
169
-
170
- });
171
-
172
- init();
173
-
174
- if (!b2s_has_premium)
175
- {
176
- jQuery('#b2s-edit-event-modal-' + calEvent.b2s_id).find("input, textarea, button").each(function () {
177
- if (!jQuery(this).hasClass('b2s-modal-close')) {
178
- jQuery(this).prop("disabled", true);
179
- }
180
- });
181
- }
182
- }
183
-
184
- });
185
-
186
- jQuery(".b2s-loading-area").hide();
187
-
188
- jQuery(document).on('click', '.b2s-select-image-modal-open', function () {
189
- jQuery('.b2s-network-select-image-content').html("");
190
- jQuery.ajax({
191
- url: ajaxurl,
192
- type: "POST",
193
- cache: false,
194
- async: false,
195
- data: {
196
- 'action': 'b2s_get_image_modal',
197
- 'id': jQuery(this).data('post-id'),
198
- 'image_url': jQuery(this).data('image-url')
199
- },
200
- success: function (data) {
201
- jQuery(".b2s-network-select-image-content").html(data);
202
- }
203
- });
204
-
205
- var authId = jQuery(this).data('network-auth-id');
206
- jQuery('.b2s-image-change-this-network').attr('data-network-auth-id', authId);
207
- jQuery('.b2s-upload-image').attr('data-network-auth-id', authId);
208
-
209
- 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();
210
- jQuery('.b2s-selected-network-for-image-info').html(content);
211
- jQuery('#b2sInsertImageType').val("0");
212
-
213
- jQuery('.networkImage').each(function () {
214
- var width = this.naturalWidth;
215
- var height = this.naturalHeight;
216
- jQuery(this).parents('.b2s-image-item').find('.b2s-image-item-caption-resolution').html(width + 'x' + height);
217
- });
218
- jQuery('#b2s-network-select-image').modal('show');
219
- return false;
220
- });
221
-
222
- jQuery(document).on("click", ".b2s-calendar-delete", function () {
223
- var id = jQuery(this).data("b2s-id");
224
- var post_id = jQuery(this).data("post-id");
225
- jQuery.ajax({
226
- url: ajaxurl,
227
- type: "POST",
228
- dataType: "json",
229
- cache: false,
230
- data: {
231
- 'action': 'b2s_calendar_delete',
232
- 'b2s_id': id,
233
- 'post_id': post_id
234
- },
235
- success: function (data) {
236
- jQuery('#b2s-edit-event-modal-' + id).modal('hide');
237
-
238
- refreshCalender();
239
- wp.heartbeat.connectNow();
240
- }
241
- });
242
- });
243
-
244
- jQuery(document).on("click", ".b2s-calendar-save-all", function (e) {
245
- jQuery('#save_method').val("apply-all");
246
- e.preventDefault();
247
- var id = jQuery(this).data("b2s-id");
248
- jQuery.ajax({
249
- url: ajaxurl,
250
- type: "POST",
251
- dataType: "json",
252
- cache: false,
253
- data: jQuery(this).closest("form").serialize(),
254
- success: function (data) {
255
- jQuery('#b2s-edit-event-modal-' + id).modal('hide');
256
-
257
- refreshCalender();
258
- jQuery('#b2s-edit-event-modal-' + id).remove();
259
- wp.heartbeat.connectNow();
260
- }
261
- });
262
- });
263
-
264
- jQuery(document).on("click", ".b2s-calendar-save-this", function (e) {
265
- e.preventDefault();
266
- jQuery('#save_method').val("apply-this");
267
- var id = jQuery(this).data("b2s-id");
268
- jQuery.ajax({
269
- url: ajaxurl,
270
- type: "POST",
271
- dataType: "json",
272
- cache: false,
273
- data: jQuery(this).closest("form").serialize(),
274
- success: function (data) {
275
- jQuery('#b2s-edit-event-modal-' + id).modal('hide');
276
- refreshCalender();
277
- jQuery('#b2s-edit-event-modal-' + id).remove();
278
- wp.heartbeat.connectNow();
279
- }
280
- });
281
- });
282
-
283
- jQuery(document).on("click", ".release_locks", function () {
284
- jQuery.ajax({
285
- url: ajaxurl,
286
- type: "POST",
287
- cache: false,
288
- async: false,
289
- data: {
290
- 'action': 'b2s_get_calendar_release_locks',
291
- 'post_id': jQuery('#post_id').val()
292
- },
293
- success: function (data) {
294
- wp.heartbeat.connectNow();
295
- }
296
- });
297
- });
298
- });
299
-
300
- function refreshCalender() {
301
- jQuery('#b2s_calendar').fullCalendar('refetchEvents');
302
- }
303
-
304
- jQuery('#b2s-info-meta-tag-modal').on('hidden.bs.modal', function (e) {
305
- jQuery('body').addClass('modal-open');
306
- });
307
-
308
- jQuery('#b2s-network-select-image').on('hidden.bs.modal', function (e) {
309
- jQuery('body').addClass('modal-open');
310
- });
311
-
312
- jQuery('#b2s-post-ship-item-post-format-modal').on('hidden.bs.modal', function (e) {
313
- jQuery('body').addClass('modal-open');
314
- });
315
-
316
-
317
- //jQuery(this).attr('data-network-auth-id')
318
- function checkSchedDateTime(dataNetworkAuthId) {
319
- var dateElement = '.b2s-post-item-details-release-input-date[data-network-auth-id="' + dataNetworkAuthId + '"]';
320
- var timeElement = '.b2s-post-item-details-release-input-time[data-network-auth-id="' + dataNetworkAuthId + '"]';
321
- var dateStr = jQuery(dateElement).val();
322
- var minStr = jQuery(timeElement).val();
323
-
324
- var timeZone = parseInt(jQuery('#user_timezone').val()) * (-1);
325
-
326
- if (jQuery('#b2sUserLang').val() == 'de') {
327
- dateStr = dateStr.substring(6, 10) + '-' + dateStr.substring(3, 5) + '-' + dateStr.substring(0, 2);
328
- } else {
329
- var minParts = minStr.split(' ');
330
- var minParts2 = minParts[0].split(':');
331
- if (minParts[1] == 'PM') {
332
- minParts2[0] = parseInt(minParts2[0]) + 12;
333
- }
334
- minStr = minParts2[0] + ':' + minParts2[1];
335
- }
336
-
337
- var minParts3 = minStr.split(':');
338
- if (minParts3[0] < 10) {
339
- minParts3[0] = '0' + minParts3[0];
340
- }
341
- var dateParts = dateStr.split('-');
342
-
343
- //utc current time
344
- var now = new Date();
345
- //offset between utc und user
346
- var offset = (parseInt(now.getTimezoneOffset()) / 60) * (-1);
347
- //enter hour to user time
348
- var hour = parseInt(minParts3[0]) + timeZone + offset;
349
- //calculate datetime in utc
350
- var enter = new Date(dateParts[0], dateParts[1] - 1, dateParts[2], hour, minParts3[1]);
351
- //compare enter date time with allowed user time
352
- if (enter.getTime() < now.getTime()) {
353
- //enter set on next 15 minutes and calculate on user timezone
354
- enter.setTime(now.getTime() + (900000 - (now.getTime() % 900000)) - (3600000 * (timeZone + offset)));
355
- jQuery(dateElement).datepicker('update', enter);
356
- jQuery(timeElement).timepicker('setTime', enter);
357
- }
358
- }
359
-
360
-
361
- function printDateFormat(dataNetworkAuthId) {
362
- var dateElement = '.b2s-post-item-details-release-input-date[data-network-auth-id="' + dataNetworkAuthId + '"]';
363
- var dateStr = jQuery(dateElement).val();
364
- dateStr = dateStr.substring(8, 10) + '.' + dateStr.substring(5, 7) + '.' + dateStr.substring(0, 4);
365
- jQuery(dateElement).val(dateStr);
366
- }
367
-
1
+ jQuery.noConflict();
2
+ jQuery(window).on("load", function () {
3
+
4
+ jQuery('#b2s_calendar').fullCalendar({
5
+ editable: b2s_has_premium,
6
+ locale: b2s_calendar_locale,
7
+ eventLimit: 2,
8
+ timeFormat: 'H:mm',
9
+ events: ajaxurl + '?action=b2s_get_calendar_events',
10
+ eventRender: function (event, element) {
11
+ $header = jQuery("<div>").addClass("b2s-calendar-header");
12
+ $network_name = jQuery("<span>").text(event.author).addClass("network-name").css("display", "block");
13
+ element.find(".fc-time").after($network_name);
14
+ element.html(element.html());
15
+ $parent = element.parent();
16
+ $header.append(element.find(".fc-content"));
17
+ element.append($header);
18
+ $body = jQuery("<div>").addClass("b2s-calendar-body");
19
+ $body.append(event.avatar);
20
+ $body.append(element.find(".fc-title"));
21
+ $body.append(jQuery("<br>"));
22
+ var $em = jQuery("<em>").css("padding-top", "5px").css("display", "block");
23
+ $em.append("<img src='" + b2s_plugin_url + "assets/images/portale/" + event.network_id + "_flat.png' style='height: 16px;width: 16px;display: inline-block;padding-right: 2px;padding-left: 2px;' />")
24
+ $em.append(event.network_name);
25
+ $em.append(jQuery("<span>").text(": " + event.profile));
26
+ $body.append($em);
27
+ element.append($body);
28
+ },
29
+ eventDrop: function (event, delta, revertFunc) {
30
+ jQuery.ajax({
31
+ url: ajaxurl,
32
+ type: "POST",
33
+ dataType: "json",
34
+ cache: false,
35
+ data: {
36
+ 'action': 'b2s_calendar_move_post',
37
+ 'b2s_id': event.b2s_id,
38
+ 'user_timezone': event.user_timezone,
39
+ 'sched_date': event.start.format(),
40
+ },
41
+ success: function (data) {
42
+ wp.heartbeat.connectNow();
43
+ }
44
+ });
45
+ },
46
+ eventAllow: function (dropLocation, draggedEvent) {
47
+ return dropLocation.start.isAfter(b2s_calendar_date) && draggedEvent.start.isAfter(b2s_calendar_datetime);
48
+ },
49
+ eventClick: function (calEvent, jsEvent, view) {
50
+
51
+ if (jQuery('#b2s-edit-event-modal-' + calEvent.b2s_id).length == 1)
52
+ {
53
+ jQuery('#b2s-edit-event-modal-' + calEvent.b2s_id).remove();
54
+ }
55
+ b2s_current_post_id = calEvent.post_id;
56
+ var $modal = jQuery("<div>");
57
+ jQuery.ajax({
58
+ url: ajaxurl,
59
+ type: "POST",
60
+ cache: false,
61
+ async: false,
62
+ data: {
63
+ 'action': 'b2s_get_calendar_edit_modal',
64
+ 'id': calEvent.b2s_id
65
+ },
66
+ success: function (data) {
67
+ $modal = $modal.html(data);
68
+ }
69
+ });
70
+ jQuery("body").append($modal);
71
+ jQuery('#b2sUserTimeZone').val(jQuery('#user_timezone').val());
72
+ jQuery('#b2s-edit-event-modal-' + calEvent.b2s_id).modal('show');
73
+ activatePortal(calEvent.network_auth_id);
74
+ initSceditor(calEvent.network_auth_id);
75
+ networkCount(calEvent.network_auth_id);
76
+ if (jQuery('.b2s-post-ship-item-post-format-text[data-network-type="' + calEvent.network_type + '"][data-network-id="' + calEvent.network_id + '"]').length > 0) {
77
+ var postFormatText = b2s_calendar_formats;
78
+ var isSetPostFormat = false;
79
+ var postFormatType = jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + calEvent.network_type + '"][data-network-id="' + calEvent.network_id + '"]').attr('data-post-format-type');
80
+ //is set post format => override current condidtions by user settings for this post
81
+ if (calEvent.post_format !== null) {
82
+ jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + calEvent.network_type + '"][data-network-id="' + calEvent.network_id + '"]').val(calEvent.post_format);
83
+ jQuery('.b2s-post-ship-item-post-format-text[data-network-auth-id="' + calEvent.network_auth_id + '"]').html(postFormatText[postFormatType][calEvent.post_format]);
84
+ jQuery('.b2s-post-item-details-post-format[data-network-auth-id="' + calEvent.network_auth_id + '"]').val(calEvent.post_format);
85
+ //edit modal select post format
86
+ jQuery('.b2s-user-network-settings-post-format[data-network-type="' + calEvent.network_type + '"][data-network-id="' + calEvent.network_id + '"]').removeClass('b2s-settings-checked');
87
+ jQuery('.b2s-user-network-settings-post-format[data-network-type="' + calEvent.network_type + '"][data-network-id="' + calEvent.network_id + '"][data-post-format="' + calEvent.post_format + '"]').addClass('b2s-settings-checked');
88
+ } else {
89
+ 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()]);
90
+ 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());
91
+ }
92
+
93
+ //if linkpost then show btn meta tags
94
+ var isMetaChecked = false;
95
+ if (calEvent.network_id == "1" && jQuery('#isOgMetaChecked').val() == "1") {
96
+ isMetaChecked = true;
97
+ }
98
+ if (calEvent.network_id == "2" && jQuery('#isCardMetaChecked').val() == "1") {
99
+ isMetaChecked = true;
100
+ }
101
+ if (isMetaChecked && jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + calEvent.network_type + '"][data-network-id="' + calEvent.network_id + '"]').val() == "0") {
102
+ jQuery('.b2s-post-item-details-preview-title[data-network-auth-id="' + calEvent.network_auth_id + '"]').prop("readonly", false);
103
+ jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + calEvent.network_auth_id + '"]').prop("readonly", false);
104
+ jQuery('.b2s-post-item-details-preview-url-reload[data-network-id="' + calEvent.network_id + '"]').hide();
105
+ var dataMetaType = jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + calEvent.network_auth_id + '"]').attr("data-meta-type");
106
+ if (dataMetaType == "og") {
107
+ jQuery('#b2sChangeOgMeta').val("1");
108
+ } else {
109
+ jQuery('#b2sChangeCardMeta').val("1");
110
+ }
111
+
112
+ } else {
113
+ jQuery('.b2s-post-item-details-preview-title[data-network-auth-id="' + calEvent.network_auth_id + '"]').prop("readonly", true);
114
+ jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + calEvent.network_auth_id + '"]').prop("readonly", true);
115
+ jQuery('.b2s-post-item-details-preview-url-reload[data-network-id="' + calEvent.network_id + '"]').show();
116
+ jQuery('.b2s-post-item-details-preview-url-reload[data-network-id="' + calEvent.network_id + '"]').trigger("click");
117
+ }
118
+
119
+
120
+ }
121
+
122
+ jQuery("#b2sPostId").val(calEvent.post_id);
123
+ var today = new Date();
124
+ var dateFormat = "yyyy-mm-dd";
125
+ var language = "en";
126
+ var showMeridian = true;
127
+ if (jQuery('#b2sUserLang').val() == "de") {
128
+ dateFormat = "dd.mm.yyyy";
129
+ language = "de";
130
+ showMeridian = false;
131
+ }
132
+
133
+ jQuery(".b2s-post-item-details-release-input-date").datepicker({
134
+ format: dateFormat,
135
+ language: language,
136
+ maxViewMode: 2,
137
+ todayHighlight: true,
138
+ startDate: today,
139
+ calendarWeeks: true,
140
+ autoclose: true
141
+ });
142
+ jQuery('.b2s-post-item-details-release-input-time').timepicker({
143
+ minuteStep: 15,
144
+ appendWidgetTo: 'body',
145
+ showSeconds: false,
146
+ showMeridian: showMeridian,
147
+ defaultTime: 'current',
148
+ snapToStep: true
149
+ });
150
+ jQuery(".b2s-post-item-details-release-input-date").datepicker().on('changeDate', function (e) {
151
+ checkSchedDateTime(calEvent.network_auth_id);
152
+ });
153
+ jQuery('.b2s-post-item-details-release-input-time').timepicker().on('changeTime.timepicker', function (e) {
154
+ checkSchedDateTime(calEvent.network_auth_id);
155
+ });
156
+ init();
157
+ if (!b2s_has_premium)
158
+ {
159
+ jQuery('#b2s-edit-event-modal-' + calEvent.b2s_id).find("input, textarea, button").each(function () {
160
+ if (!jQuery(this).hasClass('b2s-modal-close')) {
161
+ jQuery(this).prop("disabled", true);
162
+ }
163
+ });
164
+ }
165
+ }
166
+
167
+ });
168
+ jQuery(".b2s-loading-area").hide();
169
+ });
170
+
171
+ jQuery(document).on('click', '.b2s-select-image-modal-open', function () {
172
+ jQuery('.b2s-network-select-image-content').html("");
173
+ jQuery.ajax({
174
+ url: ajaxurl,
175
+ type: "POST",
176
+ cache: false,
177
+ async: false,
178
+ data: {
179
+ 'action': 'b2s_get_image_modal',
180
+ 'id': jQuery(this).data('post-id'),
181
+ 'image_url': jQuery(this).data('image-url')
182
+ },
183
+ success: function (data) {
184
+ jQuery(".b2s-network-select-image-content").html(data);
185
+ }
186
+ });
187
+ var authId = jQuery(this).data('network-auth-id');
188
+ jQuery('.b2s-image-change-this-network').attr('data-network-auth-id', authId);
189
+ jQuery('.b2s-upload-image').attr('data-network-auth-id', authId);
190
+ 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();
191
+ jQuery('.b2s-selected-network-for-image-info').html(content);
192
+ jQuery('#b2sInsertImageType').val("0");
193
+ jQuery('.networkImage').each(function () {
194
+ var width = this.naturalWidth;
195
+ var height = this.naturalHeight;
196
+ jQuery(this).parents('.b2s-image-item').find('.b2s-image-item-caption-resolution').html(width + 'x' + height);
197
+ });
198
+ jQuery('#b2s-network-select-image').modal('show');
199
+ return false;
200
+ });
201
+ jQuery(document).on("click", ".b2s-calendar-delete", function () {
202
+ var id = jQuery(this).data("b2s-id");
203
+ var post_id = jQuery(this).data("post-id");
204
+ jQuery.ajax({
205
+ url: ajaxurl,
206
+ type: "POST",
207
+ dataType: "json",
208
+ cache: false,
209
+ data: {
210
+ 'action': 'b2s_calendar_delete',
211
+ 'b2s_id': id,
212
+ 'post_id': post_id
213
+ },
214
+ success: function (data) {
215
+ jQuery('#b2s-edit-event-modal-' + id).modal('hide');
216
+ refreshCalender();
217
+ wp.heartbeat.connectNow();
218
+ }
219
+ });
220
+ });
221
+ jQuery(document).on("click", ".b2s-calendar-save-all", function (e) {
222
+ jQuery('#save_method').val("apply-all");
223
+ e.preventDefault();
224
+ var id = jQuery(this).data("b2s-id");
225
+ jQuery.ajax({
226
+ url: ajaxurl,
227
+ type: "POST",
228
+ dataType: "json",
229
+ cache: false,
230
+ data: jQuery(this).closest("form").serialize(),
231
+ success: function (data) {
232
+ jQuery('#b2s-edit-event-modal-' + id).modal('hide');
233
+ refreshCalender();
234
+ jQuery('#b2s-edit-event-modal-' + id).remove();
235
+ wp.heartbeat.connectNow();
236
+ }
237
+ });
238
+ });
239
+ jQuery(document).on("click", ".b2s-calendar-save-this", function (e) {
240
+ e.preventDefault();
241
+ jQuery('#save_method').val("apply-this");
242
+ var id = jQuery(this).data("b2s-id");
243
+ jQuery.ajax({
244
+ url: ajaxurl,
245
+ type: "POST",
246
+ dataType: "json",
247
+ cache: false,
248
+ data: jQuery(this).closest("form").serialize(),
249
+ success: function (data) {
250
+ jQuery('#b2s-edit-event-modal-' + id).modal('hide');
251
+ refreshCalender();
252
+ jQuery('#b2s-edit-event-modal-' + id).remove();
253
+ wp.heartbeat.connectNow();
254
+ }
255
+ });
256
+ });
257
+ jQuery(document).on("click", ".release_locks", function () {
258
+ jQuery.ajax({
259
+ url: ajaxurl,
260
+ type: "POST",
261
+ cache: false,
262
+ async: false,
263
+ data: {
264
+ 'action': 'b2s_get_calendar_release_locks',
265
+ 'post_id': jQuery('#post_id').val()
266
+ },
267
+ success: function (data) {
268
+ wp.heartbeat.connectNow();
269
+ }
270
+ });
271
+ });
272
+ function refreshCalender() {
273
+ jQuery('#b2s_calendar').fullCalendar('refetchEvents');
274
+ }
275
+
276
+ jQuery('#b2s-info-meta-tag-modal').on('hidden.bs.modal', function (e) {
277
+ jQuery('body').addClass('modal-open');
278
+ });
279
+ jQuery('#b2s-network-select-image').on('hidden.bs.modal', function (e) {
280
+ jQuery('body').addClass('modal-open');
281
+ });
282
+ jQuery('#b2s-post-ship-item-post-format-modal').on('hidden.bs.modal', function (e) {
283
+ jQuery('body').addClass('modal-open');
284
+ });
285
+ //jQuery(this).attr('data-network-auth-id')
286
+ function checkSchedDateTime(dataNetworkAuthId) {
287
+ var dateElement = '.b2s-post-item-details-release-input-date[data-network-auth-id="' + dataNetworkAuthId + '"]';
288
+ var timeElement = '.b2s-post-item-details-release-input-time[data-network-auth-id="' + dataNetworkAuthId + '"]';
289
+ var dateStr = jQuery(dateElement).val();
290
+ var minStr = jQuery(timeElement).val();
291
+ var timeZone = parseInt(jQuery('#user_timezone').val()) * (-1);
292
+ if (jQuery('#b2sUserLang').val() == 'de') {
293
+ dateStr = dateStr.substring(6, 10) + '-' + dateStr.substring(3, 5) + '-' + dateStr.substring(0, 2);
294
+ } else {
295
+ var minParts = minStr.split(' ');
296
+ var minParts2 = minParts[0].split(':');
297
+ if (minParts[1] == 'PM') {
298
+ minParts2[0] = parseInt(minParts2[0]) + 12;
299
+ }
300
+ minStr = minParts2[0] + ':' + minParts2[1];
301
+ }
302
+
303
+ var minParts3 = minStr.split(':');
304
+ if (minParts3[0] < 10) {
305
+ minParts3[0] = '0' + minParts3[0];
306
+ }
307
+ var dateParts = dateStr.split('-');
308
+ //utc current time
309
+ var now = new Date();
310
+ //offset between utc und user
311
+ var offset = (parseInt(now.getTimezoneOffset()) / 60) * (-1);
312
+ //enter hour to user time
313
+ var hour = parseInt(minParts3[0]) + timeZone + offset;
314
+ //calculate datetime in utc
315
+ var enter = new Date(dateParts[0], dateParts[1] - 1, dateParts[2], hour, minParts3[1]);
316
+ //compare enter date time with allowed user time
317
+ if (enter.getTime() < now.getTime()) {
318
+ //enter set on next 15 minutes and calculate on user timezone
319
+ enter.setTime(now.getTime() + (900000 - (now.getTime() % 900000)) - (3600000 * (timeZone + offset)));
320
+ jQuery(dateElement).datepicker('update', enter);
321
+ jQuery(timeElement).timepicker('setTime', enter);
322
+ }
323
+ }
324
+
325
+
326
+ function printDateFormat(dataNetworkAuthId) {
327
+ var dateElement = '.b2s-post-item-details-release-input-date[data-network-auth-id="' + dataNetworkAuthId + '"]';
328
+ var dateStr = jQuery(dateElement).val();
329
+ dateStr = dateStr.substring(8, 10) + '.' + dateStr.substring(5, 7) + '.' + dateStr.substring(0, 4);
330
+ jQuery(dateElement).val(dateStr);
331
+ }
332
+
assets/js/b2s/general.js CHANGED
@@ -191,6 +191,74 @@ function isEmail(email) {
191
return regex.test(email);
192
}
193
194
195
196
191
return regex.test(email);
192
}
193
194
+ function hideRating(forever)
195
+ {
196
+ var data = {
197
+ 'action': 'b2s_hide_rating'
198
+ };
199
200
+ if(forever) {
201
+ data.forever = true;
202
+ }
203
+
204
+ jQuery.ajax({
205
+ url: ajaxurl,
206
+ type: "POST",
207
+ dataType: "json",
208
+ cache: false,
209
+ data: data
210
+ });
211
+ }
212
+
213
+ jQuery(document).on("click", ".b2s-hide-rating",function(e){
214
+ e.preventDefault();
215
+ hideRating(false);
216
+ jQuery(this).closest('.panel').remove();
217
+ });
218
+
219
+ jQuery(document).on("click", ".b2s-hide-rating-forever",function(e){
220
+ e.preventDefault();
221
+ hideRating(true);
222
+ jQuery(this).closest('.panel').remove();
223
+ });
224
+
225
+ jQuery(document).on("click", ".b2s-allow-rating",function(e){
226
+ hideRating(false);
227
+ jQuery(this).closest('.panel').remove();
228
+ });
229
+
230
+ jQuery(document).on("click", ".b2s-hide-premium-message",function(e) {
231
+ e.preventDefault();
232
+ jQuery.ajax({
233
+ url: ajaxurl,
234
+ type: "POST",
235
+ dataType: "json",
236
+ cache: false,
237
+ data: {action: 'b2s_hide_premium_message'}
238
+ });
239
+ jQuery(this).closest('.panel').remove();
240
+ });
241
242
+ jQuery(document).on("click", ".b2s-hide-trail-message",function(e) {
243
+ e.preventDefault();
244
+ jQuery.ajax({
245
+ url: ajaxurl,
246
+ type: "POST",
247
+ dataType: "json",
248
+ cache: false,
249
+ data: {action: 'b2s_hide_trail_message'}
250
+ });
251
+ jQuery(this).closest('.panel').remove();
252
+ });
253
254
+ jQuery(document).on("click", ".b2s-hide-trail-ended-modal",function(e) {
255
+ e.preventDefault();
256
+ jQuery.ajax({
257
+ url: ajaxurl,
258
+ type: "POST",
259
+ dataType: "json",
260
+ cache: false,
261
+ data: {action: 'b2s_hide_trail_ended_message'}
262
+ });
263
+ jQuery(this).closest('.panel').remove();
264
+ });
assets/js/b2s/post.js CHANGED
@@ -114,26 +114,33 @@ function b2sSortFormSubmit(sched_dates) {
114
jQuery('.b2s-sort-result-item-area').html("").hide();
115
jQuery('.b2s-sort-pagination-area').html("").hide();
116
117
jQuery.ajax({
118
url: ajaxurl,
119
type: "POST",
120
dataType: "json",
121
cache: false,
122
- data: {
123
- 'action': 'b2s_sort_data',
124
- 'b2sSortPostTitle': jQuery('#b2sSortPostTitle').val(),
125
- 'b2sSortPostAuthor': jQuery('#b2sSortPostAuthor').val(),
126
- 'b2sSortPostCat': jQuery('#b2sSortPostCat').val(),
127
- 'b2sSortPostType': jQuery('#b2sSortPostType').val(),
128
- 'b2sSortPostSchedDate': jQuery('#b2sSortPostSchedDate').val(),
129
- 'b2sUserAuthId': jQuery('#b2sUserAuthId').val(),
130
- 'b2sType': jQuery('#b2sType').val(),
131
- 'b2sShowByDate': jQuery('#b2sShowByDate').val(),
132
- 'b2sPagination': jQuery('#b2sPagination').val(),
133
- 'b2sSortPostStatus': jQuery('#b2sSortPostStatus').val(),
134
- 'b2sSortPostPublishDate': jQuery('#b2sSortPostPublishDate').val(),
135
- 'b2sUserLang': jQuery('#b2sUserLang').val()
136
- },
137
error: function () {
138
jQuery('.b2s-server-connection-fail').show();
139
return false;
@@ -151,8 +158,11 @@ function b2sSortFormSubmit(sched_dates) {
151
if (jQuery('#b2sType').val() == "sched") {
152
if (sched_dates != false) {
153
jQuery('#b2sCalendarSchedDates').val(data.schedDates);
154
- jQuery('#b2s-sched-datepicker-area').datepicker('destroy');
155
- getB2SSchedDatepicker();
156
return false;
157
}
158
}
@@ -359,25 +369,6 @@ if (jQuery.isFunction(jQuery.fn.datepicker)) {
359
jQuery("#b2s-change-date").datepicker().on('changeDate', function (e) {
360
checkSchedDateTime();
361
});
362
-
363
- /*jQuery("#b2s-change-date").datepicker().on('changeDate', function (e) {
364
- var element = '#b2s-change-time';
365
- var dateStr = jQuery(this).val();
366
- var minStr = jQuery(element).val()
367
- if (jQuery('#b2sUserLang').val() == 'de') {
368
- dateStr = dateStr.substring(6, 10) + '-' + dateStr.substring(3, 5) + '-' + dateStr.substring(0, 2);
369
- }
370
- var dateObj = new Date();
371
- dateObj.setTime(jQuery('#b2s-data-blog-sched-date').val());
372
- if (Date.parse(dateStr + ' ' + minStr + ':00') <= Date.parse(dateObj.getUTCFullYear() + '-' + (dateObj.getUTCMonth() + 1) + '-' + dateObj.getUTCDate() + ' ' + dateObj.getUTCHours() + ':' + dateObj.getUTCMinutes() + ':00')) {
373
- //date in past
374
- if (dateObj.getUTCMinutes() >= 30) {
375
- jQuery(element).timepicker('setTime', (dateObj.getUTCHours() + 1) + ':00');
376
- } else {
377
- jQuery(element).timepicker('setTime', (dateObj.getUTCHours()) + ':30');
378
- }
379
- }
380
- });*/
381
}
382
383
@@ -395,31 +386,6 @@ if (jQuery.isFunction(jQuery.fn.timepicker)) {
395
jQuery('#b2s-change-time').timepicker().on('changeTime.timepicker', function (e) {
396
checkSchedDateTime();
397
});
398
-
399
- /*jQuery('#b2s-change-time').timepicker().on('changeTime.timepicker', function (e) {
400
- var dateStr = jQuery('#b2s-change-date').val();
401
- var minStr = jQuery(this).val();
402
- if (jQuery('#b2sUserLang').val() == 'de') {
403
- dateStr = dateStr.substring(6, 10) + '-' + dateStr.substring(3, 5) + '-' + dateStr.substring(0, 2);
404
- } else {
405
- var minParts = minStr.split(' ');
406
- var minParts2 = minParts[0].split(':');
407
- if (minParts[1] == 'PM') {
408
- minParts2[0] = parseInt(minParts2[0]) + 12;
409
- }
410
- minStr = minParts2[0] + ':' + minParts2[1];
411
- }
412
- var dateObj = new Date();
413
- dateObj.setTime(jQuery('#b2s-data-blog-sched-date').val());
414
- if (Date.parse(dateStr + ' ' + minStr + ':00') <= Date.parse(dateObj.getUTCFullYear() + '-' + (dateObj.getUTCMonth() + 1) + '-' + dateObj.getUTCDate() + ' ' + dateObj.getUTCHours() + ':' + dateObj.getUTCMinutes() + ':00')) {
415
- //date in past
416
- if (dateObj.getUTCMinutes() >= 30) {
417
- jQuery(this).timepicker('setTime', (dateObj.getUTCHours() + 1) + ':00');
418
- } else {
419
- jQuery(this).timepicker('setTime', (dateObj.getUTCHours()) + ':30');
420
- }
421
- }
422
- });*/
423
}
424
425
jQuery(document).on('click', '.b2s-post-sched-area-edittime-btn', function () {
114
jQuery('.b2s-sort-result-item-area').html("").hide();
115
jQuery('.b2s-sort-pagination-area').html("").hide();
116
117
+ var data = {
118
+ 'action': 'b2s_sort_data',
119
+ 'b2sSortPostTitle': jQuery('#b2sSortPostTitle').val(),
120
+ 'b2sSortPostAuthor': jQuery('#b2sSortPostAuthor').val(),
121
+ 'b2sSortPostCat': jQuery('#b2sSortPostCat').val(),
122
+ 'b2sSortPostType': jQuery('#b2sSortPostType').val(),
123
+ 'b2sSortPostSchedDate': jQuery('#b2sSortPostSchedDate').val(),
124
+ 'b2sUserAuthId': jQuery('#b2sUserAuthId').val(),
125
+ 'b2sType': jQuery('#b2sType').val(),
126
+ 'b2sShowByDate': jQuery('#b2sShowByDate').val(),
127
+ 'b2sPagination': jQuery('#b2sPagination').val(),
128
+ 'b2sShowPagination': jQuery('#b2sShowPagination').length > 0 ? jQuery('#b2sShowPagination').val() : 1,
129
+ 'b2sSortPostStatus': jQuery('#b2sSortPostStatus').val(),
130
+ 'b2sSortPostPublishDate': jQuery('#b2sSortPostPublishDate').val(),
131
+ 'b2sUserLang': jQuery('#b2sUserLang').val()
132
+ };
133
+
134
+ if(jQuery('#b2sPostsPerPage').length > 0) {
135
+ data['b2sPostsPerPage'] = jQuery('#b2sPostsPerPage').val();
136
+ }
137
+
138
jQuery.ajax({
139
url: ajaxurl,
140
type: "POST",
141
dataType: "json",
142
cache: false,
143
+ data: data,
144
error: function () {
145
jQuery('.b2s-server-connection-fail').show();
146
return false;
158
if (jQuery('#b2sType').val() == "sched") {
159
if (sched_dates != false) {
160
jQuery('#b2sCalendarSchedDates').val(data.schedDates);
161
+ if(jQuery('#b2s-sched-datepicker-area').length > 0)
162
+ {
163
+ jQuery('#b2s-sched-datepicker-area').datepicker('destroy');
164
+ getB2SSchedDatepicker();
165
+ }
166
return false;
167
}
168
}
369
jQuery("#b2s-change-date").datepicker().on('changeDate', function (e) {
370
checkSchedDateTime();
371
});
372
}
373
374
386
jQuery('#b2s-change-time').timepicker().on('changeTime.timepicker', function (e) {
387
checkSchedDateTime();
388
});
389
}
390
391
jQuery(document).on('click', '.b2s-post-sched-area-edittime-btn', function () {
assets/js/b2s/settings.js CHANGED
@@ -16,9 +16,13 @@ jQuery(window).on("load", function () {
16
if (b2sShowSection != "") {
17
jQuery("." + b2sShowSection).trigger("click");
18
}
19
20
- });
21
22
23
jQuery('.b2sSaveSocialMetaTagsSettings').validate({
24
ignore: "",
@@ -71,7 +75,7 @@ jQuery('.b2sSaveSocialMetaTagsSettings').validate({
71
72
73
jQuery(document).on('click', '.b2sClearSocialMetaTags', function () {
74
-
75
jQuery('.b2s-settings-user-success').hide();
76
jQuery('.b2s-settings-user-error').hide();
77
jQuery('.b2s-clear-meta-tags').hide();
@@ -100,7 +104,7 @@ jQuery(document).on('click', '.b2sClearSocialMetaTags', function () {
100
}
101
}
102
});
103
- return false;
104
});
105
106
@@ -209,7 +213,7 @@ jQuery(document).on('click', '#b2s-user-network-settings-short-url', function ()
209
return false;
210
});
211
212
- jQuery('#b2s-user-network-settings-auto-post').validate({
213
ignore: "",
214
errorPlacement: function () {
215
return false;
@@ -244,6 +248,52 @@ jQuery('#b2s-user-network-settings-auto-post').validate({
244
return false;
245
}
246
});
247
jQuery(document).on('click', '.b2s-post-type-select-btn', function () {
248
var type = jQuery(this).attr('data-post-type');
249
var tempCurText = jQuery(this).text();
@@ -411,6 +461,44 @@ jQuery('.b2sSaveUserSettingsPostFormatTw').validate({
411
});
412
413
414
/*jQuery(document).on('change', '.b2s-user-network-settings-post-format', function () {
415
jQuery('.b2s-settings-user-success').hide();
416
jQuery('.b2s-settings-user-error').hide();
16
if (b2sShowSection != "") {
17
jQuery("." + b2sShowSection).trigger("click");
18
}
19
+ jQuery(".b2s-import-auto-post-type").chosen();
20
21
+ jQuery('.b2s-network-item-auth-list[data-network-count="true"]').each(function () {
22
+ jQuery('.b2s-network-auth-count-current[data-network-id="' + jQuery(this).attr("data-network-id") + '"').text(jQuery(this).children('li').length);
23
+ });
24
25
+ });
26
27
jQuery('.b2sSaveSocialMetaTagsSettings').validate({
28
ignore: "",
75
76
77
jQuery(document).on('click', '.b2sClearSocialMetaTags', function () {
78
+
79
jQuery('.b2s-settings-user-success').hide();
80
jQuery('.b2s-settings-user-error').hide();
81
jQuery('.b2s-clear-meta-tags').hide();
104
}
105
}
106
});
107
+ return false;
108
});
109
110
213
return false;
214
});
215
216
+ jQuery('#b2s-user-network-settings-auto-post-own').validate({
217
ignore: "",
218
errorPlacement: function () {
219
return false;
248
return false;
249
}
250
});
251
+
252
+ jQuery('#b2s-user-network-settings-auto-post-imported-own').validate({
253
+ ignore: "",
254
+ errorPlacement: function () {
255
+ return false;
256
+ },
257
+ submitHandler: function (form) {
258
+ jQuery('.b2s-settings-user-success').hide();
259
+ jQuery('.b2s-settings-user-error').hide();
260
+ jQuery('.b2s-settings-user-error-no-auth-selected').hide();
261
+ jQuery(".b2s-loading-area").show();
262
+ jQuery(".b2s-user-settings-area").hide();
263
+ jQuery('.b2s-server-connection-fail').hide();
264
+ jQuery.ajax({
265
+ processData: false,
266
+ url: ajaxurl,
267
+ type: "POST",
268
+ dataType: "json",
269
+ cache: false,
270
+ data: jQuery(form).serialize(),
271
+ error: function () {
272
+ jQuery('.b2s-server-connection-fail').show();
273
+ return false;
274
+ },
275
+ success: function (data) {
276
+ jQuery(".b2s-loading-area").hide();
277
+ jQuery(".b2s-user-settings-area").show();
278
+ if (data.result == true) {
279
+ jQuery('.b2s-settings-user-success').show();
280
+ } else {
281
+ if (data.type == 'no-auth-selected') {
282
+ jQuery('.b2s-settings-user-error-no-auth-selected').show();
283
+
284
+ } else {
285
+ jQuery('.b2s-settings-user-error').show();
286
+ }
287
+ }
288
+ }
289
+ });
290
+ return false;
291
+ }
292
+ });
293
+
294
+
295
+
296
+
297
jQuery(document).on('click', '.b2s-post-type-select-btn', function () {
298
var type = jQuery(this).attr('data-post-type');
299
var tempCurText = jQuery(this).text();
461
});
462
463
464
+ jQuery('.b2sSaveUserSettingsPostFormatIn').validate({
465
+ ignore: "",
466
+ errorPlacement: function () {
467
+ return false;
468
+ },
469
+ submitHandler: function (form) {
470
+ jQuery('.b2s-settings-user-success').hide();
471
+ jQuery('.b2s-settings-user-error').hide();
472
+ jQuery(".b2s-loading-area").show();
473
+ jQuery(".b2s-user-settings-area").hide();
474
+ jQuery('.b2s-server-connection-fail').hide();
475
+ jQuery.ajax({
476
+ processData: false,
477
+ url: ajaxurl,
478
+ type: "POST",
479
+ dataType: "json",
480
+ cache: false,
481
+ data: jQuery(form).serialize(),
482
+ error: function () {
483
+ jQuery('.b2s-server-connection-fail').show();
484
+ return false;
485
+ },
486
+ success: function (data) {
487
+ jQuery(".b2s-loading-area").hide();
488
+ jQuery(".b2s-user-settings-area").show();
489
+ if (data.result == true) {
490
+ jQuery('.b2s-settings-user-success').show();
491
+ } else {
492
+ jQuery('.b2s-settings-user-error').show();
493
+ }
494
+ }
495
+ });
496
+ return false;
497
+ }
498
+ });
499
+
500
+
501
+
502
/*jQuery(document).on('change', '.b2s-user-network-settings-post-format', function () {
503
jQuery('.b2s-settings-user-success').hide();
504
jQuery('.b2s-settings-user-error').hide();
assets/js/b2s/ship.js CHANGED
@@ -142,11 +142,10 @@ jQuery(document).on('click', '.b2s-get-settings-sched-time-default', function ()
142
jQuery('.b2s-post-item-details-release-input-time[data-network-id="' + network_id + '"][data-network-type="' + count + '"][data-network-count="0"]').val(network_type_time);
143
var hours = network_type_time.substring(0, 2);
144
if (lang == "de") {
145
- var timeparts = network_type_time.split(' ');
146
- if(timeparts[1] == 'AM'){
147
- hours = (timeparts[1] == 'AM') ? hours : (parseInt(hours) + 12);
148
- }
149
-
150
}
151
if (hours < today.getHours()) {
152
jQuery('.b2s-post-item-details-release-input-date[data-network-id="' + network_id + '"][data-network-type="' + count + '"][data-network-count="0"]').val(dateTomorrow);
@@ -276,9 +275,9 @@ jQuery(document).on('click', '.b2s-get-settings-sched-time-user', function () {
276
var hours = network_type_time.substring(0, 2);
277
if (lang == "de") {
278
var timeparts = network_type_time.split(' ');
279
- if(timeparts[1] == 'AM'){
280
- hours = (timeparts[1] == 'AM') ? hours : (parseInt(hours) + 12);
281
- }
282
}
283
284
if (hours < today.getHours()) {
@@ -364,23 +363,17 @@ jQuery(document).on("click", ".b2s-user-network-settings-post-format", function
364
var networkType = jQuery(this).attr("data-network-type");
365
var postFormat = jQuery(this).val();
366
var networkAuthId = jQuery(this).attr("data-network-auth-id");
367
368
jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').val(postFormat);
369
//PostFormat
370
if (jQuery('.b2s-post-ship-item-post-format-text[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').length > 0) {
371
var postFormatText = JSON.parse(jQuery('.b2sNetworkSettingsPostFormatText').val());
372
if (jQuery('#user_version').val() >= 2) {
373
-
374
- jQuery('.b2s-post-ship-item-post-format-text[data-network-auth-id="' + networkAuthId + '"]').html(postFormatText[postFormat]);
375
jQuery('.b2s-post-item-details-post-format[data-network-auth-id="' + networkAuthId + '"]').val(postFormat);
376
-
377
- /*
378
- jQuery('.b2s-post-ship-item-post-format-text[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').html(postFormatText[postFormat]);
379
- jQuery('.b2s-post-item-details-post-format[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').val(postFormat);
380
- */
381
-
382
} else {
383
- jQuery('.b2s-post-ship-item-post-format-text[data-network-id="' + networkId + '"]').html(postFormatText[postFormat]);
384
jQuery('.b2s-post-item-details-post-format[data-network-id="' + networkId + '"]').val(postFormat);
385
}
386
}
@@ -504,11 +497,10 @@ jQuery(document).on("click", ".b2s-network-select-btn", function () {
504
//PostFormat
505
if (jQuery('.b2s-post-ship-item-post-format-text[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').length > 0) {
506
var postFormatText = JSON.parse(jQuery('.b2sNetworkSettingsPostFormatText').val());
507
if (jQuery('#user_version').val() >= 2) {
508
-
509
- jQuery('.b2s-post-ship-item-post-format-text[data-network-auth-id="' + networkAuthId + '"]').html(postFormatText[jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').val()]);
510
jQuery('.b2s-post-item-details-post-format[data-network-auth-id="' + networkAuthId + '"]').val(jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').val());
511
-
512
//if linkpost then show btn meta tags
513
var isMetaChecked = false;
514
if (networkId == "1" && jQuery('#isOgMetaChecked').val() == "1") {
@@ -556,7 +548,7 @@ jQuery(document).on("click", ".b2s-network-select-btn", function () {
556
jQuery('.b2s-post-item-details-preview-url-reload[data-network-auth-id="' + networkAuthId + '"]').trigger("click");
557
}
558
} else {
559
- jQuery('.b2s-post-ship-item-post-format-text[data-network-id="' + networkId + '"]').html(postFormatText[jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').val()]);
560
jQuery('.b2s-post-item-details-post-format[data-network-id="' + networkId + '"]').val(jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').val());
561
}
562
}
@@ -748,19 +740,12 @@ jQuery(document).on("click", ".b2s-network-select-btn", function () {
748
//PostFormat
749
if (jQuery('.b2s-post-ship-item-post-format-text[data-network-type="' + data.networkType + '"][data-network-id="' + data.networkId + '"]').length > 0) {
750
var postFormatText = JSON.parse(jQuery('.b2sNetworkSettingsPostFormatText').val());
751
if (jQuery('#user_version').val() >= 2) {
752
753
- jQuery('.b2s-post-ship-item-post-format-text[data-network-auth-id="' + data.networkAuthId + '"]').html(postFormatText[jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + data.networkType + '"][data-network-id="' + data.networkId + '"]').val()]);
754
jQuery('.b2s-post-item-details-post-format[data-network-auth-id="' + data.networkAuthId + '"]').val(jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + data.networkType + '"][data-network-id="' + data.networkId + '"]').val());
755
756
- /*
757
- jQuery('.b2s-post-ship-item-post-format-text[data-network-type="' + data.networkType + '"][data-network-id="' + data.networkId + '"]').html(postFormatText[jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + data.networkType + '"][data-network-id="' + data.networkId + '"]').val()]);
758
- jQuery('.b2s-post-item-details-post-format[data-network-type="' + data.networkType + '"][data-network-id="' + data.networkId + '"]').val(jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + data.networkType + '"][data-network-id="' + data.networkId + '"]').val());
759
- */
760
-
761
- //if linkpost then show btn meta tags
762
-
763
-
764
var isMetaChecked = false;
765
if (data.networkId == "1" && jQuery('#isOgMetaChecked').val() == "1") {
766
isMetaChecked = true;
@@ -807,16 +792,9 @@ jQuery(document).on("click", ".b2s-network-select-btn", function () {
807
}
808
809
} else {
810
- jQuery('.b2s-post-ship-item-post-format-text[data-network-id="' + data.networkId + '"]').html(postFormatText[jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + data.networkType + '"][data-network-id="' + data.networkId + '"]').val()]);
811
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());
812
}
813
- //Change View For Twitter
814
- /*if (jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-id="' + data.networkId + '"]').val() == '0' && data.networkId == '2') {
815
- jQuery('.b2s-image-remove-btn[data-network-id="' + data.networkId + '"]').hide();
816
- jQuery('.b2s-select-image-modal-open[data-network-id="' + data.networkId + '"]').hide();
817
- jQuery('.b2s-post-item-details-preview-url-reload[data-network-id="' + data.networkId + '"]').trigger("click");
818
- }*/
819
-
820
}
821
}
822
}
@@ -873,6 +851,10 @@ jQuery(document).on('click', '.b2s-post-ship-item-post-format', function () {
873
jQuery('.b2s-user-network-settings-post-format-area[data-network-type="' + jQuery(this).attr('data-network-type') + '"][data-network-id="' + jQuery(this).attr('data-network-id') + '"]').show();
874
jQuery('#b2s-post-ship-item-post-format-network-title').html(jQuery('.b2s-user-network-settings-post-format-area[data-network-id="' + jQuery(this).attr('data-network-id') + '"]').attr('data-network-title'));
875
if (jQuery('#user_version').val() >= 2) {
876
jQuery('#b2s-post-ship-item-post-format-network-display-name').html(jQuery('.b2s-post-item-details-network-display-name[data-network-auth-id="' + jQuery(this).attr('data-network-auth-id') + '"]').text().toUpperCase());
877
}
878
jQuery('.b2s-post-format-settings-info').hide();
@@ -905,6 +887,16 @@ jQuery('.b2s-network-details-mandant-select').change(function () {
905
hideDuplicateAuths();
906
chooseMandant();
907
});
908
//Versandzeitpunkt auswahl
909
jQuery(document).on('change', '.b2s-post-item-details-release-input-date-select', function () {
910
var dataNetworkCount = 0;
@@ -1640,7 +1632,10 @@ function loadingDummyConnectionFail(networkAuthId, networkId) {
1640
+ '<div class="clearfix"></div>'
1641
+ '<div class="text-center"><small>'
1642
+ jQuery('#b2sJsTextConnectionFail').val()
1643
- + '</small></div>'
1644
+ '</div>'
1645
+ '</div>'
1646
+ '</div>'
142
jQuery('.b2s-post-item-details-release-input-time[data-network-id="' + network_id + '"][data-network-type="' + count + '"][data-network-count="0"]').val(network_type_time);
143
var hours = network_type_time.substring(0, 2);
144
if (lang == "de") {
145
+ var timeparts = network_type_time.split(' ');
146
+ if (timeparts[1] == 'AM') {
147
+ hours = (timeparts[1] == 'AM') ? hours : (parseInt(hours) + 12);
148
+ }
149
}
150
if (hours < today.getHours()) {
151
jQuery('.b2s-post-item-details-release-input-date[data-network-id="' + network_id + '"][data-network-type="' + count + '"][data-network-count="0"]').val(dateTomorrow);
275
var hours = network_type_time.substring(0, 2);
276
if (lang == "de") {
277
var timeparts = network_type_time.split(' ');
278
+ if (timeparts[1] == 'AM') {
279
+ hours = (timeparts[1] == 'AM') ? hours : (parseInt(hours) + 12);
280
+ }
281
}
282
283
if (hours < today.getHours()) {
363
var networkType = jQuery(this).attr("data-network-type");
364
var postFormat = jQuery(this).val();
365
var networkAuthId = jQuery(this).attr("data-network-auth-id");
366
+ var postFormatType = jQuery(this).attr("data-post-format-type");
367
368
jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').val(postFormat);
369
//PostFormat
370
if (jQuery('.b2s-post-ship-item-post-format-text[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').length > 0) {
371
var postFormatText = JSON.parse(jQuery('.b2sNetworkSettingsPostFormatText').val());
372
if (jQuery('#user_version').val() >= 2) {
373
+ jQuery('.b2s-post-ship-item-post-format-text[data-network-auth-id="' + networkAuthId + '"]').html(postFormatText[postFormatType][postFormat]);
374
jQuery('.b2s-post-item-details-post-format[data-network-auth-id="' + networkAuthId + '"]').val(postFormat);
375
} else {
376
+ jQuery('.b2s-post-ship-item-post-format-text[data-network-id="' + networkId + '"]').html(postFormatText[postFormatType][postFormat]);
377
jQuery('.b2s-post-item-details-post-format[data-network-id="' + networkId + '"]').val(postFormat);
378
}
379
}
497
//PostFormat
498
if (jQuery('.b2s-post-ship-item-post-format-text[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').length > 0) {
499
var postFormatText = JSON.parse(jQuery('.b2sNetworkSettingsPostFormatText').val());
500
+ var postFormatType = jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').attr('data-post-format-type');
501
if (jQuery('#user_version').val() >= 2) {
502
+ jQuery('.b2s-post-ship-item-post-format-text[data-network-auth-id="' + networkAuthId + '"]').html(postFormatText[postFormatType][jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').val()]);
503
jQuery('.b2s-post-item-details-post-format[data-network-auth-id="' + networkAuthId + '"]').val(jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').val());
504
//if linkpost then show btn meta tags
505
var isMetaChecked = false;
506
if (networkId == "1" && jQuery('#isOgMetaChecked').val() == "1") {
548
jQuery('.b2s-post-item-details-preview-url-reload[data-network-auth-id="' + networkAuthId + '"]').trigger("click");
549
}
550
} else {
551
+ 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()]);
552
jQuery('.b2s-post-item-details-post-format[data-network-id="' + networkId + '"]').val(jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').val());
553
}
554
}
740
//PostFormat
741
if (jQuery('.b2s-post-ship-item-post-format-text[data-network-type="' + data.networkType + '"][data-network-id="' + data.networkId + '"]').length > 0) {
742
var postFormatText = JSON.parse(jQuery('.b2sNetworkSettingsPostFormatText').val());
743
+ var postFormatType = jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + data.networkType + '"][data-network-id="' + data.networkId + '"]').attr('data-post-format-type');
744
if (jQuery('#user_version').val() >= 2) {
745
746
+ jQuery('.b2s-post-ship-item-post-format-text[data-network-auth-id="' + data.networkAuthId + '"]').html(postFormatText[postFormatType][jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + data.networkType + '"][data-network-id="' + data.networkId + '"]').val()]);
747
jQuery('.b2s-post-item-details-post-format[data-network-auth-id="' + data.networkAuthId + '"]').val(jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + data.networkType + '"][data-network-id="' + data.networkId + '"]').val());
748
749
var isMetaChecked = false;
750
if (data.networkId == "1" && jQuery('#isOgMetaChecked').val() == "1") {
751
isMetaChecked = true;
792
}
793
794
} else {
795
+ 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()]);
796
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());
797
}
798
}
799
}
800
}
851
jQuery('.b2s-user-network-settings-post-format-area[data-network-type="' + jQuery(this).attr('data-network-type') + '"][data-network-id="' + jQuery(this).attr('data-network-id') + '"]').show();
852
jQuery('#b2s-post-ship-item-post-format-network-title').html(jQuery('.b2s-user-network-settings-post-format-area[data-network-id="' + jQuery(this).attr('data-network-id') + '"]').attr('data-network-title'));
853
if (jQuery('#user_version').val() >= 2) {
854
+ jQuery('.b2s-user-network-settings-post-format[data-network-type="' + jQuery(this).attr('data-network-type') + '"][data-network-id="' + jQuery(this).attr('data-network-id') + '"]').removeClass('b2s-settings-checked');
855
+ var currentPostFormat = jQuery('.b2s-post-item-details-post-format[data-network-auth-id="' + jQuery(this).attr('data-network-auth-id') + '"]').val();
856
+ jQuery('.b2s-user-network-settings-post-format[data-network-type="' + jQuery(this).attr('data-network-type') + '"][data-network-id="' + jQuery(this).attr('data-network-id') + '"][data-post-format="'+currentPostFormat+'"]').addClass('b2s-settings-checked');
857
+
858
jQuery('#b2s-post-ship-item-post-format-network-display-name').html(jQuery('.b2s-post-item-details-network-display-name[data-network-auth-id="' + jQuery(this).attr('data-network-auth-id') + '"]').text().toUpperCase());
859
}
860
jQuery('.b2s-post-format-settings-info').hide();
887
hideDuplicateAuths();
888
chooseMandant();
889
});
890
+
891
+ jQuery(document).on('change', '.b2s-post-item-details-item-group-select', function () {
892
+ if (jQuery(this).attr('data-change-network-display-name') == 'true') {
893
+ var label = jQuery(this.options[this.selectedIndex]).closest('optgroup').prop('label');
894
+ jQuery('.b2s-post-item-details-network-display-name[data-network-auth-id="' + jQuery(this).attr('data-network-auth-id') + '"]').html(label);
895
+ }
896
+ return false;
897
+ });
898
+
899
+
900
//Versandzeitpunkt auswahl
901
jQuery(document).on('change', '.b2s-post-item-details-release-input-date-select', function () {
902
var dataNetworkCount = 0;
1632
+ '<div class="clearfix"></div>'
1633
+ '<div class="text-center"><small>'
1634
+ jQuery('#b2sJsTextConnectionFail').val()
1635
+ + '</small>'
1636
+ + '<br/>'
1637
+ + '<a class="btn btn-link btn-sm" target="_blank" href="' + jQuery('#b2sJsTextConnectionFailLink').val() + '">' + jQuery('#b2sJsTextConnectionFailLinkText').val() + '</a>'
1638
+ + '</div>'
1639
+ '</div>'
1640
+ '</div>'
1641
+ '</div>'
assets/js/b2s/start.js CHANGED
@@ -51,11 +51,137 @@ jQuery(window).on("load", function () {
51
52
});
53
54
55
function isMail(mail) {
56
var regex = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))#x2F;;
57
return regex.test(mail);
58
}
59
60
-
61
-
51
52
});
53
54
+ /* Content-Widget */
55
+ (function (){
56
+ if(jQuery('.b2s-dashboard-multi-widget').length > 0)
57
+ {
58
+ var data = [];
59
+
60
+ jQuery.ajax({
61
+ url: ajaxurl,
62
+ type: "GET",
63
+ dataType: "json",
64
+ data: {
65
+ 'action': 'b2s_get_multi_widget_content',
66
+ },
67
+ success: function (content) {
68
+ data = content;
69
+
70
+ widget.data('position',new Date().getSeconds() % data.length);
71
+ show();
72
+
73
+ setInterval(function(){
74
+ jQuery('.b2s-dashboard-multi-widget .glyphicon-chevron-left').trigger("click");
75
+ },30000);
76
+ }
77
+
78
+ });
79
+
80
+ var widget = jQuery('.b2s-dashboard-multi-widget');
81
+
82
+ jQuery('.b2s-dashboard-multi-widget .glyphicon-chevron-right').on("click",function(){
83
+ widget.data('position',widget.data('position')*1+1);
84
+ show(widget);
85
+ });
86
+
87
+ jQuery('.b2s-dashboard-multi-widget .glyphicon-chevron-left').on("click",function(){
88
+ widget.data('position',widget.data('position')*1-1);
89
+ show(widget);
90
+ });
91
+
92
+ function show()
93
+ {
94
+ if(widget.data('position') <0)
95
+ {
96
+ widget.data('position',data.length - 1);
97
+ }
98
+ else if(widget.data('position') > data.length-1)
99
+ {
100
+ widget.data('position',0);
101
+ }
102
+
103
+ var id = widget.data('position');
104
+
105
+ widget.find('.b2s-dashboard-multi-widget-content').html(data[id]['content']);
106
+ widget.find('.b2s-dashboard-h5').text(data[id]['title']);
107
+ }
108
+ }
109
+ })();
110
+
111
+ /* Aktivity-Chart*/
112
+ /*jQuery(document).ready(function(){
113
+ if(typeof(google) != "undefined") {
114
+ google.charts.load('current', {packages: ['corechart', 'bar'], 'language': jQuery('#b2s-activity-date-picker').data('language')});
115
+ google.charts.setOnLoadCallback(drawBasic);
116
+
117
+ function drawBasic() {
118
+
119
+ jQuery.ajax({
120
+ url: ajaxurl,
121
+ type: "GET",
122
+ dataType: "json",
123
+ data: {
124
+ 'action': 'b2s_get_stats',
125
+ 'from': jQuery('#b2s-activity-date-picker').val()
126
+ },
127
+ success: function (content) {
128
+ var activity_chart_data = [];
129
+
130
+ jQuery(Object.keys(content)).each(function () {
131
+ var date = new Date(this);
132
+ activity_chart_data.push([{
133
+ v: date,
134
+ f: jQuery('#b2s-activity-date-picker').data('language') == "de" ? date.getDay() + '.' + date.getMonth() + '.' + date.getFullYear() : date.getFullYear() + '-' + date.getMonth() + '-' + date.getDay()
135
+ }, content[this][0], content[this][1]]);
136
+ });
137
+
138
+ var data = new google.visualization.DataTable();
139
+ data.addColumn('date', 'Date');
140
+ data.addColumn('number', jQuery("#chart_div").data('text-published'))
141
+ data.addColumn('number', jQuery("#chart_div").data('text-scheduled'))
142
+
143
+ data.addRows(activity_chart_data);
144
+
145
+ var options = {
146
+ title: '',
147
+ legend: {position: 'bottom'},
148
+ vAxis: {
149
+ format: '#'
150
+ },
151
+ colors: ['#79B232', '#dddddd']
152
+ };
153
+
154
+ var chart = new google.visualization.ColumnChart(
155
+ document.getElementById('chart_div'));
156
+
157
+ chart.draw(data, options);
158
+ }
159
+
160
+ });
161
+ }
162
+
163
+ jQuery('#b2s-activity-date-picker').b2sdatepicker({
164
+ 'autoClose': true,
165
+ 'toggleSelected': true,
166
+ 'minutesStep': 15
167
+ });
168
+ jQuery('#b2s-activity-date-picker').on("selectDate", function () {
169
+ jQuery('#chart_div').html("<div class=\"b2s-loading-area\">\n" +
170
+ " <br>\n" +
171
+ " <div class=\"b2s-loader-impulse b2s-loader-impulse-md\"></div>\n" +
172
+ " <div class=\"clearfix\"></div>\n" +
173
+ " </div>");
174
+
175
+ //Warten bis das Event durch ist...
176
+ setTimeout(drawBasic);
177
+ });
178
+ }
179
+ });*/
180
+
181
+
182
183
function isMail(mail) {
184
var regex = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))#x2F;;
185
return regex.test(mail);
186
}
187
assets/js/b2s/wp/post-box.js CHANGED
@@ -17,7 +17,7 @@ jQuery(window).on("load", function () {
17
if (jQuery('#b2s-post-meta-box-time-dropdown-publish').is(':checked')) {
18
if (jQuery('#b2s-post-meta-box-version').val() == "0" && jQuery(this).val() == "publish") {
19
jQuery('#b2s-post-meta-box-time-dropdown-publish').prop('checked', false);
20
- } else {
21
if (jQuery('#b2s-post-meta-box-profil-dropdown').length == 0) {
22
jQuery('.b2s-loading-area').show();
23
jQuery.ajax({
@@ -118,6 +118,7 @@ jQuery(document).on('click', '#b2s-post-meta-box-time-dropdown-publish', functio
118
jQuery('#b2s-post-meta-box-sched-date-picker').val(setTodayDate);
119
jQuery('#b2s-post-meta-box-sched-date-picker').b2sdatepicker({'autoClose': true, 'toggleSelected': false, 'minutesStep': 15, 'minDate': today, 'startDate': today, 'todayButton': today});
120
jQuery('#b2s-post-meta-box-profil-dropdown [value="' + jQuery('#b2s-user-last-selected-profile-id').val() + '"]').prop('selected', true).trigger('change');
121
} else {
122
jQuery('#b2s-server-connection-fail').show();
123
}
@@ -145,6 +146,23 @@ jQuery(document).on('change', '.b2s-post-meta-box-sched-select', function () {
145
});
146
147
148
jQuery(document).on('click', '.b2s-btn-close-meta-box', function () {
149
jQuery('#' + jQuery(this).attr('data-area-id')).hide();
150
return false;
17
if (jQuery('#b2s-post-meta-box-time-dropdown-publish').is(':checked')) {
18
if (jQuery('#b2s-post-meta-box-version').val() == "0" && jQuery(this).val() == "publish") {
19
jQuery('#b2s-post-meta-box-time-dropdown-publish').prop('checked', false);
20
+ }else {
21
if (jQuery('#b2s-post-meta-box-profil-dropdown').length == 0) {
22
jQuery('.b2s-loading-area').show();
23
jQuery.ajax({
118
jQuery('#b2s-post-meta-box-sched-date-picker').val(setTodayDate);
119
jQuery('#b2s-post-meta-box-sched-date-picker').b2sdatepicker({'autoClose': true, 'toggleSelected': false, 'minutesStep': 15, 'minDate': today, 'startDate': today, 'todayButton': today});
120
jQuery('#b2s-post-meta-box-profil-dropdown [value="' + jQuery('#b2s-user-last-selected-profile-id').val() + '"]').prop('selected', true).trigger('change');
121
+
122
} else {
123
jQuery('#b2s-server-connection-fail').show();
124
}
146
});
147
148
149
+ jQuery(document).on('click', '#publish', function () {
150
+ //Check is Auto-Post-Import active
151
+ if (jQuery('#autoPostImportIsActive').length > 0) {
152
+ if (jQuery('#autoPostImportIsActive').val() == "1") {
153
+ jQuery.ajax({
154
+ url: ajaxurl,
155
+ type: "POST",
156
+ dataType: "json",
157
+ cache: false,
158
+ data: {
159
+ 'action': 'b2s_lock_auto_post_import',
160
+ 'userId': jQuery('#b2sBlogUserId').val()
161
+ }
162
+ });
163
+ }
164
+ }
165
+ });
166
jQuery(document).on('click', '.b2s-btn-close-meta-box', function () {
167
jQuery('#' + jQuery(this).attr('data-area-id')).hide();
168
return false;
assets/lib/btn-toogle/bootstrap-toggle.min.css ADDED
@@ -0,0 +1,28 @@
1
+ /*! ========================================================================
2
+ * Bootstrap Toggle: bootstrap-toggle.css v2.2.0
3
+ * http://www.bootstraptoggle.com
4
+ * ========================================================================
5
+ * Copyright 2014 Min Hur, The New York Times Company
6
+ * Licensed under MIT
7
+ * ======================================================================== */
8
+ .checkbox label .toggle,.checkbox-inline .toggle{margin-left:-20px;margin-right:5px}
9
+ .toggle{position:relative;overflow:hidden}
10
+ .toggle input[type=checkbox]{display:none}
11
+ .toggle-group{position:absolute;width:200%;top:0;bottom:0;left:0;transition:left .35s;-webkit-transition:left .35s;-moz-user-select:none;-webkit-user-select:none}
12
+ .toggle.off .toggle-group{left:-100%}
13
+ .toggle-on{position:absolute;top:0;bottom:0;left:0;right:50%;margin:0;border:0;border-radius:0}
14
+ .toggle-off{position:absolute;top:0;bottom:0;left:50%;right:0;margin:0;border:0;border-radius:0}
15
+ .toggle-handle{position:relative;margin:0 auto;padding-top:0;padding-bottom:0;height:100%;width:0;border-width:0 1px}
16
+ .toggle.btn{min-width:75px;min-height: 30px;}
17
+ .toggle-on.btn{padding-right:24px}
18
+ .toggle-off.btn{padding-left:24px}
19
+ .toggle.btn-lg{min-width:79px;min-height:45px}
20
+ .toggle-on.btn-lg{padding-right:31px}
21
+ .toggle-off.btn-lg{padding-left:31px}
22
+ .toggle-handle.btn-lg{width:40px}
23
+ .toggle.btn-sm{min-width:50px;min-height:30px}
24
+ .toggle-on.btn-sm{padding-right:20px}
25
+ .toggle-off.btn-sm{padding-left:20px}
26
+ .toggle.btn-xs{min-width:35px;min-height:22px}
27
+ .toggle-on.btn-xs{padding-right:12px}
28
+ .toggle-off.btn-xs{padding-left:12px}
assets/lib/btn-toogle/bootstrap-toggle.min.js ADDED
@@ -0,0 +1,9 @@
1
+ /*! ========================================================================
2
+ * Bootstrap Toggle: bootstrap-toggle.js v2.2.0
3
+ * http://www.bootstraptoggle.com
4
+ * ========================================================================
5
+ * Copyright 2014 Min Hur, The New York Times Company
6
+ * Licensed under MIT
7
+ * ======================================================================== */
8
+ +function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.toggle"),f="object"==typeof b&&b;e||d.data("bs.toggle",e=new c(this,f)),"string"==typeof b&&e[b]&&e[b]()})}var c=function(b,c){this.$element=a(b),this.options=a.extend({},this.defaults(),c),this.render()};c.VERSION="2.2.0",c.DEFAULTS={on:"On",off:"Off",onstyle:"primary",offstyle:"default",size:"normal",style:"",width:null,height:null},c.prototype.defaults=function(){return{on:this.$element.attr("data-on")||c.DEFAULTS.on,off:this.$element.attr("data-off")||c.DEFAULTS.off,onstyle:this.$element.attr("data-onstyle")||c.DEFAULTS.onstyle,offstyle:this.$element.attr("data-offstyle")||c.DEFAULTS.offstyle,size:this.$element.attr("data-size")||c.DEFAULTS.size,style:this.$element.attr("data-style")||c.DEFAULTS.style,width:this.$element.attr("data-width")||c.DEFAULTS.width,height:this.$element.attr("data-height")||c.DEFAULTS.height}},c.prototype.render=function(){this._onstyle="btn-"+this.options.onstyle,this._offstyle="btn-"+this.options.offstyle;var b="large"===this.options.size?"btn-lg":"small"===this.options.size?"btn-sm":"mini"===this.options.size?"btn-xs":"",c=a('<label class="btn">').html(this.options.on).addClass(this._onstyle+" "+b),d=a('<label class="btn">').html(this.options.off).addClass(this._offstyle+" "+b+" active"),e=a('<span class="toggle-handle btn btn-default">').addClass(b),f=a('<div class="toggle-group">').append(c,d,e),g=a('<div class="toggle btn" data-toggle="toggle">').addClass(this.$element.prop("checked")?this._onstyle:this._offstyle+" off").addClass(b).addClass(this.options.style);this.$element.wrap(g),a.extend(this,{$toggle:this.$element.parent(),$toggleOn:c,$toggleOff:d,$toggleGroup:f}),this.$toggle.append(f);var h=this.options.width||Math.max(c.outerWidth(),d.outerWidth())+e.outerWidth()/2,i=this.options.height||Math.max(c.outerHeight(),d.outerHeight());c.addClass("toggle-on"),d.addClass("toggle-off"),this.$toggle.css({width:h,height:i}),this.options.height&&(c.css("line-height",c.height()+"px"),d.css("line-height",d.height()+"px")),this.update(!0),this.trigger(!0)},c.prototype.toggle=function(){this.$element.prop("checked")?this.off():this.on()},c.prototype.on=function(a){return this.$element.prop("disabled")?!1:(this.$toggle.removeClass(this._offstyle+" off").addClass(this._onstyle),this.$element.prop("checked",!0),void(a||this.trigger()))},c.prototype.off=function(a){return this.$element.prop("disabled")?!1:(this.$toggle.removeClass(this._onstyle).addClass(this._offstyle+" off"),this.$element.prop("checked",!1),void(a||this.trigger()))},c.prototype.enable=function(){this.$toggle.removeAttr("disabled"),this.$element.prop("disabled",!1)},c.prototype.disable=function(){this.$toggle.attr("disabled","disabled"),this.$element.prop("disabled",!0)},c.prototype.update=function(a){this.$element.prop("disabled")?this.disable():this.enable(),this.$element.prop("checked")?this.on(a):this.off(a)},c.prototype.trigger=function(b){this.$element.off("change.bs.toggle"),b||this.$element.change(),this.$element.on("change.bs.toggle",a.proxy(function(){this.update()},this))},c.prototype.destroy=function(){this.$element.off("change.bs.toggle"),this.$toggleGroup.remove(),this.$element.removeData("bs.toggle"),this.$element.unwrap()};var d=a.fn.bootstrapToggle;a.fn.bootstrapToggle=b,a.fn.bootstrapToggle.Constructor=c,a.fn.toggle.noConflict=function(){return a.fn.bootstrapToggle=d,this},a(function(){a("input[type=checkbox][data-toggle^=toggle]").bootstrapToggle()}),a(document).on("click.bs.toggle","div[data-toggle^=toggle]",function(b){var c=a(this).find("input[type=checkbox]");c.bootstrapToggle("toggle"),b.preventDefault()})}(jQuery);
9
+ //# sourceMappingURL=bootstrap-toggle.min.js.map
assets/lib/chosen/chosen.jquery.min.js ADDED
@@ -0,0 +1,2 @@
1
+ /* Chosen v1.5.1 | (c) 2011-2016 by Harvest | MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md */
2
+ (function(){var a,AbstractChosen,Chosen,SelectParser,b,c={}.hasOwnProperty,d=function(a,b){function d(){this.constructor=a}for(var e in b)c.call(b,e)&&(a[e]=b[e]);return d.prototype=b.prototype,a.prototype=new d,a.__super__=b.prototype,a};SelectParser=function(){function SelectParser(){this.options_index=0,this.parsed=[]}return SelectParser.prototype.add_node=function(a){return"OPTGROUP"===a.nodeName.toUpperCase()?this.add_group(a):this.add_option(a)},SelectParser.prototype.add_group=function(a){var b,c,d,e,f,g;for(b=this.parsed.length,this.parsed.push({array_index:b,group:!0,label:this.escapeExpression(a.label),title:a.title?a.title:void 0,children:0,disabled:a.disabled,classes:a.className}),f=a.childNodes,g=[],d=0,e=f.length;e>d;d++)c=f[d],g.push(this.add_option(c,b,a.disabled));return g},SelectParser.prototype.add_option=function(a,b,c){return"OPTION"===a.nodeName.toUpperCase()?(""!==a.text?(null!=b&&(this.parsed[b].children+=1),this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:a.value,text:a.text,html:a.innerHTML,title:a.title?a.title:void 0,selected:a.selected,disabled:c===!0?c:a.disabled,group_array_index:b,group_label:null!=b?this.parsed[b].label:null,classes:a.className,style:a.style.cssText})):this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:!0}),this.options_index+=1):void 0},SelectParser.prototype.escapeExpression=function(a){var b,c;return null==a||a===!1?"":/[\&\<\>\"\'\`]/.test(a)?(b={"<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},c=/&(?!\w+;)|[\<\>\"\'\`]/g,a.replace(c,function(a){return b[a]||"&amp;"})):a},SelectParser}(),SelectParser.select_to_array=function(a){var b,c,d,e,f;for(c=new SelectParser,f=a.childNodes,d=0,e=f.length;e>d;d++)b=f[d],c.add_node(b);return c.parsed},AbstractChosen=function(){function AbstractChosen(a,b){this.form_field=a,this.options=null!=b?b:{},AbstractChosen.browser_is_supported()&&(this.is_multiple=this.form_field.multiple,this.set_default_text(),this.set_default_values(),this.setup(),this.set_up_html(),this.register_observers(),this.on_ready())}return AbstractChosen.prototype.set_default_values=function(){var a=this;return this.click_test_action=function(b){return a.test_active_click(b)},this.activate_action=function(b){return a.activate_field(b)},this.active_field=!1,this.mouse_on_container=!1,this.results_showing=!1,this.result_highlighted=null,this.allow_single_deselect=null!=this.options.allow_single_deselect&&null!=this.form_field.options[0]&&""===this.form_field.options[0].text?this.options.allow_single_deselect:!1,this.disable_search_threshold=this.options.disable_search_threshold||0,this.disable_search=this.options.disable_search||!1,this.enable_split_word_search=null!=this.options.enable_split_word_search?this.options.enable_split_word_search:!0,this.group_search=null!=this.options.group_search?this.options.group_search:!0,this.search_contains=this.options.search_contains||!1,this.single_backstroke_delete=null!=this.options.single_backstroke_delete?this.options.single_backstroke_delete:!0,this.max_selected_options=this.options.max_selected_options||1/0,this.inherit_select_classes=this.options.inherit_select_classes||!1,this.display_selected_options=null!=this.options.display_selected_options?this.options.display_selected_options:!0,this.display_disabled_options=null!=this.options.display_disabled_options?this.options.display_disabled_options:!0,this.include_group_label_in_selected=this.options.include_group_label_in_selected||!1,this.max_shown_results=this.options.max_shown_results||Number.POSITIVE_INFINITY},AbstractChosen.prototype.set_default_text=function(){return this.form_field.getAttribute("data-placeholder")?this.default_text=this.form_field.getAttribute("data-placeholder"):this.is_multiple?this.default_text=this.options.placeholder_text_multiple||this.options.placeholder_text||AbstractChosen.default_multiple_text:this.default_text=this.options.placeholder_text_single||this.options.placeholder_text||AbstractChosen.default_single_text,this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||AbstractChosen.default_no_result_text},AbstractChosen.prototype.choice_label=function(a){return this.include_group_label_in_selected&&null!=a.group_label?"<b class='group-name'>"+a.group_label+"</b>"+a.html:a.html},AbstractChosen.prototype.mouse_enter=function(){return this.mouse_on_container=!0},AbstractChosen.prototype.mouse_leave=function(){return this.mouse_on_container=!1},AbstractChosen.prototype.input_focus=function(a){var b=this;if(this.is_multiple){if(!this.active_field)return setTimeout(function(){return b.container_mousedown()},50)}else if(!this.active_field)return this.activate_field()},AbstractChosen.prototype.input_blur=function(a){var b=this;return this.mouse_on_container?void 0:(this.active_field=!1,setTimeout(function(){return b.blur_test()},100))},AbstractChosen.prototype.results_option_build=function(a){var b,c,d,e,f,g,h;for(b="",e=0,h=this.results_data,f=0,g=h.length;g>f&&(c=h[f],d="",d=c.group?this.result_add_group(c):this.result_add_option(c),""!==d&&(e++,b+=d),(null!=a?a.first:void 0)&&(c.selected&&this.is_multiple?this.choice_build(c):c.selected&&!this.is_multiple&&this.single_set_selected_text(this.choice_label(c))),!(e>=this.max_shown_results));f++);return b},AbstractChosen.prototype.result_add_option=function(a){var b,c;return a.search_match&&this.include_option_in_results(a)?(b=[],a.disabled||a.selected&&this.is_multiple||b.push("active-result"),!a.disabled||a.selected&&this.is_multiple||b.push("disabled-result"),a.selected&&b.push("result-selected"),null!=a.group_array_index&&b.push("group-option"),""!==a.classes&&b.push(a.classes),c=document.createElement("li"),c.className=b.join(" "),c.style.cssText=a.style,c.setAttribute("data-option-array-index",a.array_index),c.innerHTML=a.search_text,a.title&&(c.title=a.title),this.outerHTML(c)):""},AbstractChosen.prototype.result_add_group=function(a){var b,c;return(a.search_match||a.group_match)&&a.active_options>0?(b=[],b.push("group-result"),a.classes&&b.push(a.classes),c=document.createElement("li"),c.className=b.join(" "),c.innerHTML=a.search_text,a.title&&(c.title=a.title),this.outerHTML(c)):""},AbstractChosen.prototype.results_update_field=function(){return this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.results_build(),this.results_showing?this.winnow_results():void 0},AbstractChosen.prototype.reset_single_select_options=function(){var a,b,c,d,e;for(d=this.results_data,e=[],b=0,c=d.length;c>b;b++)a=d[b],a.selected?e.push(a.selected=!1):e.push(void 0);return e},AbstractChosen.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},AbstractChosen.prototype.results_search=function(a){return this.results_showing?this.winnow_results():this.results_show()},AbstractChosen.prototype.winnow_results=function(){var a,b,c,d,e,f,g,h,i,j,k,l;for(this.no_results_clear(),d=0,f=this.get_search_text(),a=f.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\amp;"),i=new RegExp(a,"i"),c=this.get_search_regex(a),l=this.results_data,j=0,k=l.length;k>j;j++)b=l[j],b.search_match=!1,e=null,this.include_option_in_results(b)&&(b.group&&(b.group_match=!1,b.active_options=0),null!=b.group_array_index&&this.results_data[b.group_array_index]&&(e=this.results_data[b.group_array_index],0===e.active_options&&e.search_match&&(d+=1),e.active_options+=1),b.search_text=b.group?b.label:b.html,(!b.group||this.group_search)&&(b.search_match=this.search_string_match(b.search_text,c),b.search_match&&!b.group&&(d+=1),b.search_match?(f.length&&(g=b.search_text.search(i),h=b.search_text.substr(0,g+f.length)+"</em>"+b.search_text.substr(g+f.length),b.search_text=h.substr(0,g)+"<em>"+h.substr(g)),null!=e&&(e.group_match=!0)):null!=b.group_array_index&&this.results_data[b.group_array_index].search_match&&(b.search_match=!0)));return this.result_clear_highlight(),1>d&&f.length?(this.update_results_content(""),this.no_results(f)):(this.update_results_content(this.results_option_build()),this.winnow_results_set_highlight())},AbstractChosen.prototype.get_search_regex=function(a){var b;return b=this.search_contains?"":"^",new RegExp(b+a,"i")},AbstractChosen.prototype.search_string_match=function(a,b){var c,d,e,f;if(b.test(a))return!0;if(this.enable_split_word_search&&(a.indexOf(" ")>=0||0===a.indexOf("["))&&(d=a.replace(/\[|\]/g,"").split(" "),d.length))for(e=0,f=d.length;f>e;e++)if(c=d[e],b.test(c))return!0},AbstractChosen.prototype.choices_count=function(){var a,b,c,d;if(null!=this.selected_option_count)return this.selected_option_count;for(this.selected_option_count=0,d=this.form_field.options,b=0,c=d.length;c>b;b++)a=d[b],a.selected&&(this.selected_option_count+=1);return this.selected_option_count},AbstractChosen.prototype.choices_click=function(a){return a.preventDefault(),this.results_showing||this.is_disabled?void 0:this.results_show()},AbstractChosen.prototype.keyup_checker=function(a){var b,c;switch(b=null!=(c=a.which)?c:a.keyCode,this.search_field_scale(),b){case 8:if(this.is_multiple&&this.backstroke_length<1&&this.choices_count()>0)return this.keydown_backstroke();if(!this.pending_backstroke)return this.result_clear_highlight(),this.results_search();break;case 13:if(a.preventDefault(),this.results_showing)return this.result_select(a);break;case 27:return this.results_showing&&this.results_hide(),!0;case 9:case 38:case 40:case 16:case 91:case 17:case 18:break;default:return this.results_search()}},AbstractChosen.prototype.clipboard_event_checker=function(a){var b=this;return setTimeout(function(){return b.results_search()},50)},AbstractChosen.prototype.container_width=function(){return null!=this.options.width?this.options.width:""+this.form_field.offsetWidth+"px"},AbstractChosen.prototype.include_option_in_results=function(a){return this.is_multiple&&!this.display_selected_options&&a.selected?!1:!this.display_disabled_options&&a.disabled?!1:a.empty?!1:!0},AbstractChosen.prototype.search_results_touchstart=function(a){return this.touch_started=!0,this.search_results_mouseover(a)},AbstractChosen.prototype.search_results_touchmove=function(a){return this.touch_started=!1,this.search_results_mouseout(a)},AbstractChosen.prototype.search_results_touchend=function(a){return this.touch_started?this.search_results_mouseup(a):void 0},AbstractChosen.prototype.outerHTML=function(a){var b;return a.outerHTML?a.outerHTML:(b=document.createElement("div"),b.appendChild(a),b.innerHTML)},AbstractChosen.browser_is_supported=function(){return/iP(od|hone)/i.test(window.navigator.userAgent)?!1:/Android/i.test(window.navigator.userAgent)&&/Mobile/i.test(window.navigator.userAgent)?!1:/IEMobile/i.test(window.navigator.userAgent)?!1:/Windows Phone/i.test(window.navigator.userAgent)?!1:/BlackBerry/i.test(window.navigator.userAgent)?!1:/BB10/i.test(window.navigator.userAgent)?!1:"Microsoft Internet Explorer"===window.navigator.appName?document.documentMode>=8:!0},AbstractChosen.default_multiple_text="Select Some Options",AbstractChosen.default_single_text="Select an Option",AbstractChosen.default_no_result_text="No results match",AbstractChosen}(),a=jQuery,a.fn.extend({chosen:function(b){return AbstractChosen.browser_is_supported()?this.each(function(c){var d,e;return d=a(this),e=d.data("chosen"),"destroy"===b?void(e instanceof Chosen&&e.destroy()):void(e instanceof Chosen||d.data("chosen",new Chosen(this,b)))}):this}}),Chosen=function(c){function Chosen(){return b=Chosen.__super__.constructor.apply(this,arguments)}return d(Chosen,c),Chosen.prototype.setup=function(){return this.form_field_jq=a(this.form_field),this.current_selectedIndex=this.form_field.selectedIndex,this.is_rtl=this.form_field_jq.hasClass("chosen-rtl")},Chosen.prototype.set_up_html=function(){var b,c;return b=["chosen-container"],b.push("chosen-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&b.push(this.form_field.className),this.is_rtl&&b.push("chosen-rtl"),c={"class":b.join(" "),style:"width: "+this.container_width()+";",title:this.form_field.title},this.form_field.id.length&&(c.id=this.form_field.id.replace(/[^\w]/g,"_")+"_chosen"),this.container=a("<div />",c),this.is_multiple?this.container.html('<ul class="chosen-choices"><li class="search-field"><input type="text" value="'+this.default_text+'" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chosen-drop"><ul class="chosen-results"></ul></div>'):this.container.html('<a class="chosen-single chosen-default"><span>'+this.default_text+'</span><div><b></b></div></a><div class="chosen-drop"><div class="chosen-search"><input type="text" autocomplete="off" /></div><ul class="chosen-results"></ul></div>'),this.form_field_jq.hide().after(this.container),this.dropdown=this.container.find("div.chosen-drop").first(),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chosen-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chosen-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chosen-search").first(),this.selected_item=this.container.find(".chosen-single").first()),this.results_build(),this.set_tab_index(),this.set_label_behavior()},Chosen.prototype.on_ready=function(){return this.form_field_jq.trigger("chosen:ready",{chosen:this})},Chosen.prototype.register_observers=function(){var a=this;return this.container.bind("touchstart.chosen",function(b){return a.container_mousedown(b),b.preventDefault()}),this.container.bind("touchend.chosen",function(b){return a.container_mouseup(b),b.preventDefault()}),this.container.bind("mousedown.chosen",function(b){a.container_mousedown(b)}),this.container.bind("mouseup.chosen",function(b){a.container_mouseup(b)}),this.container.bind("mouseenter.chosen",function(b){a.mouse_enter(b)}),this.container.bind("mouseleave.chosen",function(b){a.mouse_leave(b)}),this.search_results.bind("mouseup.chosen",function(b){a.search_results_mouseup(b)}),this.search_results.bind("mouseover.chosen",function(b){a.search_results_mouseover(b)}),this.search_results.bind("mouseout.chosen",function(b){a.search_results_mouseout(b)}),this.search_results.bind("mousewheel.chosen DOMMouseScroll.chosen",function(b){a.search_results_mousewheel(b)}),this.search_results.bind("touchstart.chosen",function(b){a.search_results_touchstart(b)}),this.search_results.bind("touchmove.chosen",function(b){a.search_results_touchmove(b)}),this.search_results.bind("touchend.chosen",function(b){a.search_results_touchend(b)}),this.form_field_jq.bind("chosen:updated.chosen",function(b){a.results_update_field(b)}),this.form_field_jq.bind("chosen:activate.chosen",function(b){a.activate_field(b)}),this.form_field_jq.bind("chosen:open.chosen",function(b){a.container_mousedown(b)}),this.form_field_jq.bind("chosen:close.chosen",function(b){a.input_blur(b)}),this.search_field.bind("blur.chosen",function(b){a.input_blur(b)}),this.search_field.bind("keyup.chosen",function(b){a.keyup_checker(b)}),this.search_field.bind("keydown.chosen",function(b){a.keydown_checker(b)}),this.search_field.bind("focus.chosen",function(b){a.input_focus(b)}),this.search_field.bind("cut.chosen",function(b){a.clipboard_event_checker(b)}),this.search_field.bind("paste.chosen",function(b){a.clipboard_event_checker(b)}),this.is_multiple?this.search_choices.bind("click.chosen",function(b){a.choices_click(b)}):this.container.bind("click.chosen",function(a){a.preventDefault()})},Chosen.prototype.destroy=function(){return a(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.search_field[0].tabIndex&&(this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex),this.container.remove(),this.form_field_jq.removeData("chosen"),this.form_field_jq.show()},Chosen.prototype.search_field_disabled=function(){return this.is_disabled=this.form_field_jq[0].disabled,this.is_disabled?(this.container.addClass("chosen-disabled"),this.search_field[0].disabled=!0,this.is_multiple||this.selected_item.unbind("focus.chosen",this.activate_action),this.close_field()):(this.container.removeClass("chosen-disabled"),this.search_field[0].disabled=!1,this.is_multiple?void 0:this.selected_item.bind("focus.chosen",this.activate_action))},Chosen.prototype.container_mousedown=function(b){return this.is_disabled||(b&&"mousedown"===b.type&&!this.results_showing&&b.preventDefault(),null!=b&&a(b.target).hasClass("search-choice-close"))?void 0:(this.active_field?this.is_multiple||!b||a(b.target)[0]!==this.selected_item[0]&&!a(b.target).parents("a.chosen-single").length||(b.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),a(this.container[0].ownerDocument).bind("click.chosen",this.click_test_action),this.results_show()),this.activate_field())},Chosen.prototype.container_mouseup=function(a){return"ABBR"!==a.target.nodeName||this.is_disabled?void 0:this.results_reset(a)},Chosen.prototype.search_results_mousewheel=function(a){var b;return a.originalEvent&&(b=a.originalEvent.deltaY||-a.originalEvent.wheelDelta||a.originalEvent.detail),null!=b?(a.preventDefault(),"DOMMouseScroll"===a.type&&(b=40*b),this.search_results.scrollTop(b+this.search_results.scrollTop())):void 0},Chosen.prototype.blur_test=function(a){return!this.active_field&&this.container.hasClass("chosen-container-active")?this.close_field():void 0},Chosen.prototype.close_field=function(){return a(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chosen-container-active"),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale()},Chosen.prototype.activate_field=function(){return this.container.addClass("chosen-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},Chosen.prototype.test_active_click=function(b){var c;return c=a(b.target).closest(".chosen-container"),c.length&&this.container[0]===c[0]?this.active_field=!0:this.close_field()},Chosen.prototype.results_build=function(){return this.parsing=!0,this.selected_option_count=null,this.results_data=SelectParser.select_to_array(this.form_field),this.is_multiple?this.search_choices.find("li.search-choice").remove():this.is_multiple||(this.single_set_selected_text(),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?(this.search_field[0].readOnly=!0,this.container.addClass("chosen-container-single-nosearch")):(this.search_field[0].readOnly=!1,this.container.removeClass("chosen-container-single-nosearch"))),this.update_results_content(this.results_option_build({first:!0})),this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.parsing=!1},Chosen.prototype.result_do_highlight=function(a){var b,c,d,e,f;if(a.length){if(this.result_clear_highlight(),this.result_highlight=a,this.result_highlight.addClass("highlighted"),d=parseInt(this.search_results.css("maxHeight"),10),f=this.search_results.scrollTop(),e=d+f,c=this.result_highlight.position().top+this.search_results.scrollTop(),b=c+this.result_highlight.outerHeight(),b>=e)return this.search_results.scrollTop(b-d>0?b-d:0);if(f>c)return this.search_results.scrollTop(c)}},Chosen.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},Chosen.prototype.results_show=function(){return this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.container.addClass("chosen-with-drop"),this.results_showing=!0,this.search_field.focus(),this.search_field.val(this.search_field.val()),this.winnow_results(),this.form_field_jq.trigger("chosen:showing_dropdown",{chosen:this}))},Chosen.prototype.update_results_content=function(a){return this.search_results.html(a)},Chosen.prototype.results_hide=function(){return this.results_showing&&(this.result_clear_highlight(),this.container.removeClass("chosen-with-drop"),this.form_field_jq.trigger("chosen:hiding_dropdown",{chosen:this})),this.results_showing=!1},Chosen.prototype.set_tab_index=function(a){var b;return this.form_field.tabIndex?(b=this.form_field.tabIndex,this.form_field.tabIndex=-1,this.search_field[0].tabIndex=b):void 0},Chosen.prototype.set_label_behavior=function(){var b=this;return this.form_field_label=this.form_field_jq.parents("label"),!this.form_field_label.length&&this.form_field.id.length&&(this.form_field_label=a("label[for='"+this.form_field.id+"']")),this.form_field_label.length>0?this.form_field_label.bind("click.chosen",function(a){return b.is_multiple?b.container_mousedown(a):b.activate_field()}):void 0},Chosen.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices_count()<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},Chosen.prototype.search_results_mouseup=function(b){var c;return c=a(b.target).hasClass("active-result")?a(b.target):a(b.target).parents(".active-result").first(),c.length?(this.result_highlight=c,this.result_select(b),this.search_field.focus()):void 0},Chosen.prototype.search_results_mouseover=function(b){var c;return c=a(b.target).hasClass("active-result")?a(b.target):a(b.target).parents(".active-result").first(),c?this.result_do_highlight(c):void 0},Chosen.prototype.search_results_mouseout=function(b){return a(b.target).hasClass("active-result")?this.result_clear_highlight():void 0},Chosen.prototype.choice_build=function(b){var c,d,e=this;return c=a("<li />",{"class":"search-choice"}).html("<span>"+this.choice_label(b)+"</span>"),b.disabled?c.addClass("search-choice-disabled"):(d=a("<a />",{"class":"search-choice-close","data-option-array-index":b.array_index}),d.bind("click.chosen",function(a){return e.choice_destroy_link_click(a)}),c.append(d)),this.search_container.before(c)},Chosen.prototype.choice_destroy_link_click=function(b){return b.preventDefault(),b.stopPropagation(),this.is_disabled?void 0:this.choice_destroy(a(b.target))},Chosen.prototype.choice_destroy=function(a){return this.result_deselect(a[0].getAttribute("data-option-array-index"))?(this.show_search_field_default(),this.is_multiple&&this.choices_count()>0&&this.search_field.val().length<1&&this.results_hide(),a.parents("li").first().remove(),this.search_field_scale()):void 0},Chosen.prototype.results_reset=function(){return this.reset_single_select_options(),this.form_field.options[0].selected=!0,this.single_set_selected_text(),this.show_search_field_default(),this.results_reset_cleanup(),this.form_field_jq.trigger("change"),this.active_field?this.results_hide():void 0},Chosen.prototype.results_reset_cleanup=function(){return this.current_selectedIndex=this.form_field.selectedIndex,this.selected_item.find("abbr").remove()},Chosen.prototype.result_select=function(a){var b,c;return this.result_highlight?(b=this.result_highlight,this.result_clear_highlight(),this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.is_multiple?b.removeClass("active-result"):this.reset_single_select_options(),b.addClass("result-selected"),c=this.results_data[b[0].getAttribute("data-option-array-index")],c.selected=!0,this.form_field.options[c.options_index].selected=!0,this.selected_option_count=null,this.is_multiple?this.choice_build(c):this.single_set_selected_text(this.choice_label(c)),(a.metaKey||a.ctrlKey)&&this.is_multiple||this.results_hide(),this.show_search_field_default(),(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex)&&this.form_field_jq.trigger("change",{selected:this.form_field.options[c.options_index].value}),this.current_selectedIndex=this.form_field.selectedIndex,a.preventDefault(),this.search_field_scale())):void 0},Chosen.prototype.single_set_selected_text=function(a){return null==a&&(a=this.default_text),a===this.default_text?this.selected_item.addClass("chosen-default"):(this.single_deselect_control_build(),this.selected_item.removeClass("chosen-default")),this.selected_item.find("span").html(a)},Chosen.prototype.result_deselect=function(a){var b;return b=this.results_data[a],this.form_field.options[b.options_index].disabled?!1:(b.selected=!1,this.form_field.options[b.options_index].selected=!1,this.selected_option_count=null,this.result_clear_highlight(),this.results_showing&&this.winnow_results(),this.form_field_jq.trigger("change",{deselected:this.form_field.options[b.options_index].value}),this.search_field_scale(),!0)},Chosen.prototype.single_deselect_control_build=function(){return this.allow_single_deselect?(this.selected_item.find("abbr").length||this.selected_item.find("span").first().after('<abbr class="search-choice-close"></abbr>'),this.selected_item.addClass("chosen-single-with-deselect")):void 0},Chosen.prototype.get_search_text=function(){return a("<div/>").text(a.trim(this.search_field.val())).html()},Chosen.prototype.winnow_results_set_highlight=function(){var a,b;return b=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),a=b.length?b.first():this.search_results.find(".active-result").first(),null!=a?this.result_do_highlight(a):void 0},Chosen.prototype.no_results=function(b){var c;return c=a('<li class="no-results">'+this.results_none_found+' "<span></span>"</li>'),c.find("span").first().html(b),this.search_results.append(c),this.form_field_jq.trigger("chosen:no_results",{chosen:this})},Chosen.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},Chosen.prototype.keydown_arrow=function(){var a;return this.results_showing&&this.result_highlight?(a=this.result_highlight.nextAll("li.active-result").first())?this.result_do_highlight(a):void 0:this.results_show()},Chosen.prototype.keyup_arrow=function(){var a;return this.results_showing||this.is_multiple?this.result_highlight?(a=this.result_highlight.prevAll("li.active-result"),a.length?this.result_do_highlight(a.first()):(this.choices_count()>0&&this.results_hide(),this.result_clear_highlight())):void 0:this.results_show()},Chosen.prototype.keydown_backstroke=function(){var a;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(a=this.search_container.siblings("li.search-choice").last(),a.length&&!a.hasClass("search-choice-disabled")?(this.pending_backstroke=a,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")):void 0)},Chosen.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},Chosen.prototype.keydown_checker=function(a){var b,c;switch(b=null!=(c=a.which)?c:a.keyCode,this.search_field_scale(),8!==b&&this.pending_backstroke&&this.clear_backstroke(),b){case 8:this.backstroke_length=this.search_field.val().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(a),this.mouse_on_container=!1;break;case 13:this.results_showing&&a.preventDefault();break;case 32:this.disable_search&&a.preventDefault();break;case 38:a.preventDefault(),this.keyup_arrow();break;case 40:a.preventDefault(),this.keydown_arrow()}},Chosen.prototype.search_field_scale=function(){var b,c,d,e,f,g,h,i,j;if(this.is_multiple){for(d=0,h=0,f="position:absolute; left: -1000px; top: -1000px; display:none;",g=["font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"],i=0,j=g.length;j>i;i++)e=g[i],f+=e+":"+this.search_field.css(e)+";";return b=a("<div />",{style:f}),b.text(this.search_field.val()),a("body").append(b),h=b.width()+25,b.remove(),c=this.container.outerWidth(),h>c-10&&(h=c-10),this.search_field.css({width:h+"px"})}},Chosen}(AbstractChosen)}).call(this);
assets/lib/chosen/chosen.min.css ADDED
@@ -0,0 +1,3 @@
1
+ /* Chosen v1.5.1 | (c) 2011-2016 by Harvest | MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md */
2
+
3
+ .chosen-container{position:relative;display:inline-block;vertical-align:middle;font-size:13px;-webkit-user-select:none;-moz-user-select:none;user-select:none}.chosen-container *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.chosen-container .chosen-drop{position:absolute;top:100%;left:-9999px;z-index:1010;width:100%;border:1px solid #aaa;border-top:0;background:#fff;box-shadow:0 4px 5px rgba(0,0,0,.15)}.chosen-container.chosen-with-drop .chosen-drop{left:0}.chosen-container a{cursor:pointer}.chosen-container .search-choice .group-name,.chosen-container .chosen-single .group-name{margin-right:4px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-weight:400;color:#999}.chosen-container .search-choice .group-name:after,.chosen-container .chosen-single .group-name:after{content:":";padding-left:2px;vertical-align:top}.chosen-container-single .chosen-single{position:relative;display:block;overflow:hidden;padding:0 0 0 8px;height:25px;border:1px solid #aaa;border-radius:5px;background-color:#fff;background:-webkit-gradient(linear,50% 0,50% 100%,color-stop(20%,#fff),color-stop(50%,#f6f6f6),color-stop(52%,#eee),color-stop(100%,#f4f4f4));background:-webkit-linear-gradient(#fff 20%,#f6f6f6 50%,#eee 52%,#f4f4f4 100%);background:-moz-linear-gradient(#fff 20%,#f6f6f6 50%,#eee 52%,#f4f4f4 100%);background:-o-linear-gradient(#fff 20%,#f6f6f6 50%,#eee 52%,#f4f4f4 100%);background:linear-gradient(#fff 20%,#f6f6f6 50%,#eee 52%,#f4f4f4 100%);background-clip:padding-box;box-shadow:0 0 3px #fff inset,0 1px 1px rgba(0,0,0,.1);color:#444;text-decoration:none;white-space:nowrap;line-height:24px}.chosen-container-single .chosen-default{color:#999}.chosen-container-single .chosen-single span{display:block;overflow:hidden;margin-right:26px;text-overflow:ellipsis;white-space:nowrap}.chosen-container-single .chosen-single-with-deselect span{margin-right:38px}.chosen-container-single .chosen-single abbr{position:absolute;top:6px;right:26px;display:block;width:12px;height:12px;background:url(../chosen/img/chosen-sprite.png) -42px 1px no-repeat;font-size:1px}.chosen-container-single .chosen-single abbr:hover{background-position:-42px -10px}.chosen-container-single.chosen-disabled .chosen-single abbr:hover{background-position:-42px -10px}.chosen-container-single .chosen-single div{position:absolute;top:0;right:0;display:block;width:18px;height:100%}.chosen-container-single .chosen-single div b{display:block;width:100%;height:100%;background:url(../chosen/img/chosen-sprite.png) no-repeat 0 2px}.chosen-container-single .chosen-search{position:relative;z-index:1010;margin:0;padding:3px 4px;white-space:nowrap}.chosen-container-single .chosen-search input[type=text]{margin:1px 0;padding:4px 20px 4px 5px;width:100%;height:auto;outline:0;border:1px solid #aaa;background:#fff url(../chosen/img/chosen-sprite.png) no-repeat 100% -20px;background:url(../chosen/img/chosen-sprite.png) no-repeat 100% -20px;font-size:1em;font-family:sans-serif;line-height:normal;border-radius:0}.chosen-container-single .chosen-drop{margin-top:-1px;border-radius:0 0 4px 4px;background-clip:padding-box}.chosen-container-single.chosen-container-single-nosearch .chosen-search{position:absolute;left:-9999px}.chosen-container .chosen-results{color:#444;position:relative;overflow-x:hidden;overflow-y:auto;margin:0 4px 4px 0;padding:0 0 0 4px;max-height:240px;-webkit-overflow-scrolling:touch}.chosen-container .chosen-results li{display:none;margin:0;padding:5px 6px;list-style:none;line-height:15px;word-wrap:break-word;-webkit-touch-callout:none}.chosen-container .chosen-results li.active-result{display:list-item;cursor:pointer}.chosen-container .chosen-results li.disabled-result{display:list-item;color:#ccc;cursor:default}.chosen-container .chosen-results li.highlighted{background-color:#3875d7;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(20%,#3875d7),color-stop(90%,#2a62bc));background-image:-webkit-linear-gradient(#3875d7 20%,#2a62bc 90%);background-image:-moz-linear-gradient(#3875d7 20%,#2a62bc 90%);background-image:-o-linear-gradient(#3875d7 20%,#2a62bc 90%);background-image:linear-gradient(#3875d7 20%,#2a62bc 90%);color:#fff}.chosen-container .chosen-results li.no-results{color:#777;display:list-item;background:#f4f4f4}.chosen-container .chosen-results li.group-result{display:list-item;font-weight:700;cursor:default}.chosen-container .chosen-results li.group-option{padding-left:15px}.chosen-container .chosen-results li em{font-style:normal;text-decoration:underline}.chosen-container-multi .chosen-choices{position:relative;overflow:hidden;margin:0;padding:0 5px;width:100%;height:auto!important;height:1%;border:1px solid #aaa;background-color:#fff;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(1%,#eee),color-stop(15%,#fff));background-image:-webkit-linear-gradient(#eee 1%,#fff 15%);background-image:-moz-linear-gradient(#eee 1%,#fff 15%);background-image:-o-linear-gradient(#eee 1%,#fff 15%);background-image:linear-gradient(#eee 1%,#fff 15%);cursor:text}.chosen-container-multi .chosen-choices li{float:left;list-style:none}.chosen-container-multi .chosen-choices li.search-field{margin:0;padding:0;white-space:nowrap}.chosen-container-multi .chosen-choices li.search-field input[type=text]{margin:1px 0;padding:0;height:25px;outline:0;border:0!important;background:transparent!important;box-shadow:none;color:#999;font-size:100%;font-family:sans-serif;line-height:normal;border-radius:0}.chosen-container-multi .chosen-choices li.search-choice{position:relative;margin:3px 5px 3px 0;padding:3px 20px 3px 5px;border:1px solid #aaa;max-width:100%;border-radius:3px;background-color:#eee;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(20%,#f4f4f4),color-stop(50%,#f0f0f0),color-stop(52%,#e8e8e8),color-stop(100%,#eee));background-image:-webkit-linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:-moz-linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:-o-linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-size:100% 19px;background-repeat:repeat-x;background-clip:padding-box;box-shadow:0 0 2px #fff inset,0 1px 0 rgba(0,0,0,.05);color:#333;line-height:13px;cursor:default}.chosen-container-multi .chosen-choices li.search-choice span{word-wrap:break-word}.chosen-container-multi .chosen-choices li.search-choice .search-choice-close{position:absolute;top:4px;right:3px;display:block;width:12px;height:12px;background:url(../chosen/img/chosen-sprite.png) -42px 1px no-repeat;font-size:1px}.chosen-container-multi .chosen-choices li.search-choice .search-choice-close:hover{background-position:-42px -10px}.chosen-container-multi .chosen-choices li.search-choice-disabled{padding-right:5px;border:1px solid #ccc;background-color:#e4e4e4;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(20%,#f4f4f4),color-stop(50%,#f0f0f0),color-stop(52%,#e8e8e8),color-stop(100%,#eee));background-image:-webkit-linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:-moz-linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:-o-linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);color:#666}.chosen-container-multi .chosen-choices li.search-choice-focus{background:#d4d4d4}.chosen-container-multi .chosen-choices li.search-choice-focus .search-choice-close{background-position:-42px -10px}.chosen-container-multi .chosen-results{margin:0;padding:0}.chosen-container-multi .chosen-drop .result-selected{display:list-item;color:#ccc;cursor:default}.chosen-container-active .chosen-single{border:1px solid #5897fb;box-shadow:0 0 5px rgba(0,0,0,.3)}.chosen-container-active.chosen-with-drop .chosen-single{border:1px solid #aaa;-moz-border-radius-bottomright:0;border-bottom-right-radius:0;-moz-border-radius-bottomleft:0;border-bottom-left-radius:0;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(20%,#eee),color-stop(80%,#fff));background-image:-webkit-linear-gradient(#eee 20%,#fff 80%);background-image:-moz-linear-gradient(#eee 20%,#fff 80%);background-image:-o-linear-gradient(#eee 20%,#fff 80%);background-image:linear-gradient(#eee 20%,#fff 80%);box-shadow:0 1px 0 #fff inset}.chosen-container-active.chosen-with-drop .chosen-single div{border-left:0;background:transparent}.chosen-container-active.chosen-with-drop .chosen-single div b{background-position:-18px 2px}.chosen-container-active .chosen-choices{border:1px solid #5897fb;box-shadow:0 0 5px rgba(0,0,0,.3)}.chosen-container-active .chosen-choices li.search-field input[type=text]{color:#222!important}.chosen-disabled{opacity:.5!important;cursor:default}.chosen-disabled .chosen-single{cursor:default}.chosen-disabled .chosen-choices .search-choice .search-choice-close{cursor:default}.chosen-rtl{text-align:right}.chosen-rtl .chosen-single{overflow:visible;padding:0 8px 0 0}.chosen-rtl .chosen-single span{margin-right:0;margin-left:26px;direction:rtl}.chosen-rtl .chosen-single-with-deselect span{margin-left:38px}.chosen-rtl .chosen-single div{right:auto;left:3px}.chosen-rtl .chosen-single abbr{right:auto;left:26px}.chosen-rtl .chosen-choices li{float:right}.chosen-rtl .chosen-choices li.search-field input[type=text]{direction:rtl}.chosen-rtl .chosen-choices li.search-choice{margin:3px 5px 3px 0;padding:3px 5px 3px 19px}.chosen-rtl .chosen-choices li.search-choice .search-choice-close{right:auto;left:4px}.chosen-rtl.chosen-container-single-nosearch .chosen-search,.chosen-rtl .chosen-drop{left:9999px}.chosen-rtl.chosen-container-single .chosen-results{margin:0 0 4px 4px;padding:0 4px 0 0}.chosen-rtl .chosen-results li.group-option{padding-right:15px;padding-left:0}.chosen-rtl.chosen-container-active.chosen-with-drop .chosen-single div{border-right:0}.chosen-rtl .chosen-search input[type=text]{padding:4px 5px 4px 20px;background:#fff url(../chosen/img/chosen-sprite.png) no-repeat -30px -20px;background:url(../chosen/img/chosen-sprite.png) no-repeat -30px -20px;direction:rtl}.chosen-rtl.chosen-container-single .chosen-single div b{background-position:6px 2px}.chosen-rtl.chosen-container-single.chosen-with-drop .chosen-single div b{background-position:-12px 2px}@media only screen and (-webkit-min-device-pixel-ratio:1.5),only screen and (min-resolution:144dpi),only screen and (min-resolution:1.5dppx){.chosen-rtl .chosen-search input[type=text],.chosen-container-single .chosen-single abbr,.chosen-container-single .chosen-single div b,.chosen-container-single .chosen-search input[type=text],.chosen-container-multi .chosen-choices .search-choice .search-choice-close,.chosen-container .chosen-results-scroll-down span,.chosen-container .chosen-results-scroll-up span{background-image:url(../chosen/img/chosen-sprite@2x.png)!important;background-size:52px 37px!important;background-repeat:no-repeat!important}}
assets/lib/chosen/img/chosen-sprite.png ADDED
Binary file
assets/lib/chosen/img/chosen-sprite@2x.png ADDED
Binary file
blog2social.php CHANGED
@@ -7,12 +7,12 @@
7
* Author: Blog2Social, Adenion
8
* Text Domain: blog2social
9
* Domain Path: /languages
10
- * Version: 4.3.3
11
* Author URI: https://www.blog2social.com
12
* License: GPL2+
13
*/
14
//B2SDefine
15
- define('B2S_PLUGIN_VERSION', '433');
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__));
@@ -55,7 +55,7 @@ function uninstallPlugin() {
55
$b2sCheck = new B2S_System();
56
if ($b2sCheck->check() === true) {
57
global $wpdb;
58
- $sql = $wpdb->prepare("SELECT token,blog_user_id FROM `b2s_user`");
59
$data = $wpdb->get_results($sql, ARRAY_A);
60
if (!empty($data) && is_array($data)) {
61
require_once (plugin_dir_path(__FILE__) . 'includes/B2S/Api/Post.php');
7
* Author: Blog2Social, Adenion
8
* Text Domain: blog2social
9
* Domain Path: /languages
10
+ * Version: 4.4.0
11
* Author URI: https://www.blog2social.com
12
* License: GPL2+
13
*/
14
//B2SDefine
15
+ define('B2S_PLUGIN_VERSION', '440');
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__));
55
$b2sCheck = new B2S_System();
56
if ($b2sCheck->check() === true) {
57
global $wpdb;
58
+ $sql = "SELECT token,blog_user_id FROM `b2s_user`";
59
$data = $wpdb->get_results($sql, ARRAY_A);
60
if (!empty($data) && is_array($data)) {
61
require_once (plugin_dir_path(__FILE__) . 'includes/B2S/Api/Post.php');
includes/Ajax/Get.php CHANGED
@@ -27,6 +27,8 @@ class Ajax_Get {
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_image_modal', array($this, 'getImageModal'));
30
}
31
32
public function getSortData() {
@@ -35,6 +37,7 @@ class Ajax_Get {
35
/* Sort */
36
$b2sType = isset($_POST['b2sType']) ? trim($_POST['b2sType']) : "";
37
$b2sPagination = (int) isset($_POST['b2sPagination']) ? $_POST['b2sPagination'] : 1;
38
$b2sSortPostTitle = isset($_POST['b2sSortPostTitle']) ? trim($_POST['b2sSortPostTitle']) : "";
39
$b2sSortPostAuthor = isset($_POST['b2sSortPostAuthor']) ? trim($_POST['b2sSortPostAuthor']) : "";
40
$b2sSortPostSchedDate = isset($_POST['b2sSortPostSchedDate']) ? trim($_POST['b2sSortPostSchedDate']) : "";
@@ -45,9 +48,14 @@ class Ajax_Get {
45
$b2sSortPostCat = isset($_POST['b2sSortPostCat']) ? trim($_POST['b2sSortPostCat']) : "";
46
$b2sSortPostType = isset($_POST['b2sSortPostType']) ? trim($_POST['b2sSortPostType']) : "";
47
$b2sUserLang = isset($_POST['b2sUserLang']) ? trim($_POST['b2sUserLang']) : strtolower(substr(B2S_LANGUAGE, 0, 2));
48
if (!empty($b2sType) && in_array($b2sType, array('all', 'sched', 'publish'))) {
49
- $postItem = new B2S_Post_Item($b2sType, $b2sSortPostTitle, $b2sSortPostAuthor, $b2sSortPostStatus, $b2sSortPostPublishDate, $b2sSortPostSchedDate, $b2sShowByDate, $b2sUserAuthId, $b2sPagination, $b2sSortPostCat, $b2sSortPostType, $b2sUserLang);
50
- echo json_encode(array('result' => true, 'content' => $postItem->getItemHtml(), 'schedDates' => json_encode($postItem->getCalendarSchedDate()), 'pagination' => $postItem->getPaginationHtml()));
51
wp_die();
52
}
53
echo json_encode(array('result' => false, 'content' => '', 'schedDates' => 0, 'pagination' => ''));
@@ -67,8 +75,8 @@ class Ajax_Get {
67
public function getPostMetaBox() {
68
$result = json_decode(B2S_Api_Post::post(B2S_PLUGIN_API_ENDPOINT, array('action' => 'getProfileUserAuth', 'token' => B2S_PLUGIN_TOKEN)));
69
if (isset($result->result) && (int) $result->result == 1 && isset($result->data) && !empty($result->data) && isset($result->data->mandant) && isset($result->data->auth) && !empty($result->data->mandant) && !empty($result->data->auth)) {
70
- $metaBox = new B2S_PostBox();
71
- echo json_encode(array('result' => true, 'content' => $metaBox->getPostBoxAutoHtml($result->data->mandant, $result->data->auth)));
72
wp_die();
73
}
74
echo json_encode(array('result' => false, 'content' => ''));
@@ -232,11 +240,9 @@ class Ajax_Get {
232
require_once (B2S_PLUGIN_DIR . 'includes/B2S/Settings/Item.php');
233
require_once (B2S_PLUGIN_DIR . 'includes/Util.php');
234
235
- if(isset($_GET['start']))
236
- {
237
- $calendar = B2S_Calendar_Filter::getByTimespam($_GET['start']." 00:00:00",$_GET['end']." 23:59:59");
238
- }
239
- else{
240
$calendar = B2S_Calendar_Filter::getAll();
241
}
242
echo json_encode($calendar->asCalendarArray());
@@ -246,21 +252,20 @@ class Ajax_Get {
246
public function getCalendarEditModal() {
247
require_once (B2S_PLUGIN_DIR . 'includes/B2S/Calendar/Filter.php');
248
if (isset($_POST['id']) && (int) $_POST['id'] > 0) {
249
- $item = B2S_Calendar_Filter::getById((int)$_POST['id']);
250
if ($item != null) {
251
- $lock_user_id = get_option("B2S_PLUGIN_CALENDAR_BLOCKED_".$_POST['id']);
252
- if(!$lock_user_id) {
253
update_option("B2S_PLUGIN_CALENDAR_BLOCKED_" . $_POST['id'], get_current_user_id());
254
$options = new B2S_Options(get_current_user_id());
255
$block_old = $options->_getOption("B2S_PLUGIN_USER_CALENDAR_BLOCKED");
256
257
- if($block_old) {
258
- delete_option("B2S_PLUGIN_CALENDAR_BLOCKED_".$block_old);
259
}
260
- $options->_setOption("B2S_PLUGIN_USER_CALENDAR_BLOCKED",$_POST['id']);
261
}
262
- if($lock_user_id)
263
- {
264
$lock_user = get_userdata($lock_user_id);
265
}
266
include (B2S_PLUGIN_DIR . 'views/b2s/modal.calendar.php');
@@ -285,4 +290,25 @@ class Ajax_Get {
285
wp_die();
286
}
287
288
}
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_image_modal', array($this, 'getImageModal'));
30
+ add_action('wp_ajax_b2s_get_multi_widget_content', array($this, 'getMultiWidgetContent'));
31
+ add_action('wp_ajax_b2s_get_stats', array($this, 'getStats'));
32
}
33
34
public function getSortData() {
37
/* Sort */
38
$b2sType = isset($_POST['b2sType']) ? trim($_POST['b2sType']) : "";
39
$b2sPagination = (int) isset($_POST['b2sPagination']) ? $_POST['b2sPagination'] : 1;
40
+ $b2sShowPagination = !isset($_POST['b2sShowPagination']) || $_POST['b2sShowPagination'] == 1;
41
$b2sSortPostTitle = isset($_POST['b2sSortPostTitle']) ? trim($_POST['b2sSortPostTitle']) : "";
42
$b2sSortPostAuthor = isset($_POST['b2sSortPostAuthor']) ? trim($_POST['b2sSortPostAuthor']) : "";
43
$b2sSortPostSchedDate = isset($_POST['b2sSortPostSchedDate']) ? trim($_POST['b2sSortPostSchedDate']) : "";
48
$b2sSortPostCat = isset($_POST['b2sSortPostCat']) ? trim($_POST['b2sSortPostCat']) : "";
49
$b2sSortPostType = isset($_POST['b2sSortPostType']) ? trim($_POST['b2sSortPostType']) : "";
50
$b2sUserLang = isset($_POST['b2sUserLang']) ? trim($_POST['b2sUserLang']) : strtolower(substr(B2S_LANGUAGE, 0, 2));
51
+ $b2sResultsPerPage = isset($_POST['b2sPostsPerPage']) && intval($_POST['b2sPostsPerPage']) > 0 ? intval($_POST['b2sPostsPerPage']) : B2S_PLUGIN_POSTPERPAGE;
52
if (!empty($b2sType) && in_array($b2sType, array('all', 'sched', 'publish'))) {
53
+ $postItem = new B2S_Post_Item($b2sType, $b2sSortPostTitle, $b2sSortPostAuthor, $b2sSortPostStatus, $b2sSortPostPublishDate, $b2sSortPostSchedDate, $b2sShowByDate, $b2sUserAuthId, $b2sPagination, $b2sSortPostCat, $b2sSortPostType, $b2sUserLang, $b2sResultsPerPage);
54
+ $result = array('result' => true, 'content' => $postItem->getItemHtml(), 'schedDates' => json_encode($postItem->getCalendarSchedDate()));
55
+ if ($b2sShowPagination) {
56
+ $result['pagination'] = $postItem->getPaginationHtml();
57
+ }
58
+ echo json_encode($result);
59
wp_die();
60
}
61
echo json_encode(array('result' => false, 'content' => '', 'schedDates' => 0, 'pagination' => ''));
75
public function getPostMetaBox() {
76
$result = json_decode(B2S_Api_Post::post(B2S_PLUGIN_API_ENDPOINT, array('action' => 'getProfileUserAuth', 'token' => B2S_PLUGIN_TOKEN)));
77
if (isset($result->result) && (int) $result->result == 1 && isset($result->data) && !empty($result->data) && isset($result->data->mandant) && isset($result->data->auth) && !empty($result->data->mandant) && !empty($result->data->auth)) {
78
+ $postBox = new B2S_PostBox();
79
+ echo json_encode(array('result' => true, 'content' => $postBox->getPostBoxAutoHtml($result->data->mandant, $result->data->auth)));
80
wp_die();
81
}
82
echo json_encode(array('result' => false, 'content' => ''));
240
require_once (B2S_PLUGIN_DIR . 'includes/B2S/Settings/Item.php');
241
require_once (B2S_PLUGIN_DIR . 'includes/Util.php');
242
243
+ if (isset($_GET['start'])) {
244
+ $calendar = B2S_Calendar_Filter::getByTimespam($_GET['start'] . " 00:00:00", $_GET['end'] . " 23:59:59");
245
+ } else {
246
$calendar = B2S_Calendar_Filter::getAll();
247
}
248
echo json_encode($calendar->asCalendarArray());
252
public function getCalendarEditModal() {
253
require_once (B2S_PLUGIN_DIR . 'includes/B2S/Calendar/Filter.php');
254
if (isset($_POST['id']) && (int) $_POST['id'] > 0) {
255
+ $item = B2S_Calendar_Filter::getById((int) $_POST['id']);
256
if ($item != null) {
257
+ $lock_user_id = get_option("B2S_PLUGIN_CALENDAR_BLOCKED_" . $_POST['id']);
258
+ if (!$lock_user_id) {
259
update_option("B2S_PLUGIN_CALENDAR_BLOCKED_" . $_POST['id'], get_current_user_id());
260
$options = new B2S_Options(get_current_user_id());
261
$block_old = $options->_getOption("B2S_PLUGIN_USER_CALENDAR_BLOCKED");
262
263
+ if ($block_old) {
264
+ delete_option("B2S_PLUGIN_CALENDAR_BLOCKED_" . $block_old);
265
}
266
+ $options->_setOption("B2S_PLUGIN_USER_CALENDAR_BLOCKED", $_POST['id']);
267
}
268
+ if ($lock_user_id) {
269
$lock_user = get_userdata($lock_user_id);
270
}
271
include (B2S_PLUGIN_DIR . 'views/b2s/modal.calendar.php');
290
wp_die();
291
}
292
293
+ public function getMultiWidgetContent() {
294
+ $option = get_option("B2S_MULTI_WIDGET");
295
+ if ($option !== false) {
296
+ 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"))) {
297
+ die($option['content']);
298
+ }
299
+ }
300
+ $content = B2S_Api_Post::post(B2S_PLUGIN_API_ENDPOINT, array('action' => 'getNews', 'version' => B2S_PLUGIN_VERSION, 'lang' => strtolower(substr(get_locale(), 0, 2)), 'token' => B2S_PLUGIN_TOKEN));
301
+ update_option("B2S_MULTI_WIDGET", array("timestamp" => date("Y-m-d H:i:s"), "content" => $content), false);
302
+ echo $content;
303
+ wp_die();
304
+ }
305
+
306
+ public function getStats() {
307
+ require_once (B2S_PLUGIN_DIR . 'includes/B2S/Stats.php');
308
+ $stats = new B2S_Stats();
309
+ $stats->set_from($_GET['from']);
310
+ echo json_encode($stats->get_result());
311
+ wp_die();
312
+ }
313
+
314
}
includes/Ajax/Post.php CHANGED
@@ -15,6 +15,7 @@ class Ajax_Post {
15
add_action('wp_ajax_b2s_save_ship_data', array($this, 'saveShipData'));
16
add_action('wp_ajax_b2s_save_user_mandant', array($this, 'saveUserMandant'));
17
add_action('wp_ajax_b2s_delete_mandant', array($this, 'deleteUserMandant'));
18
add_action('wp_ajax_b2s_delete_user_auth', array($this, 'deleteUserAuth'));
19
add_action('wp_ajax_b2s_update_user_version', array($this, 'updateUserVersion'));
20
add_action('wp_ajax_b2s_create_trail', array($this, 'createTrail'));
@@ -35,6 +36,10 @@ class Ajax_Post {
35
add_action('wp_ajax_b2s_calendar_delete', array($this, 'b2sCalendarDelete'));
36
add_action('wp_ajax_b2s_calendar_save', array($this, 'b2sCalendarSave'));
37
add_action("wp_ajax_b2s_get_calendar_release_locks", array($this, 'releaseLocks'));
38
}
39
40
public function prgShip() {
@@ -87,6 +92,14 @@ class Ajax_Post {
87
wp_die();
88
}
89
90
public function prgLogin() {
91
if (isset($_POST['postId']) && (int) $_POST['postId'] > 0 && isset($_POST['username']) && !empty($_POST['username']) && isset($_POST['password']) && !empty($_POST['password'])) {
92
$pubKey = json_decode(PRG_Api_Get::get(B2S_PLUGIN_PRG_API_ENDPOINT . 'auth.php?publicKey=true', array()));
@@ -335,9 +348,32 @@ class Ajax_Post {
335
$options = new B2S_Options(B2S_PLUGIN_BLOG_USER_ID);
336
$options->_setOption('user_time_zone', $_POST['user_time_zone']);
337
echo json_encode(array('result' => true));
338
wp_die();
339
}
340
341
echo json_encode(array('result' => false));
342
wp_die();
343
}
@@ -687,7 +723,7 @@ class Ajax_Post {
687
'user_timezone' => isset($post['user_timezone']) ? $post['user_timezone'] : 0,
688
'saveSetting' => isset($data['saveSchedSetting']) ? true : false
689
);
690
-
691
$b2sShipSend->saveSchedDetails(array_merge($defaultPostData, $sendData), $schedData);
692
}
693
@@ -712,4 +748,24 @@ class Ajax_Post {
712
}
713
}
714
715
}
15
add_action('wp_ajax_b2s_save_ship_data', array($this, 'saveShipData'));
16
add_action('wp_ajax_b2s_save_user_mandant', array($this, 'saveUserMandant'));
17
add_action('wp_ajax_b2s_delete_mandant', array($this, 'deleteUserMandant'));
18
+ add_action('wp_ajax_b2s_lock_auto_post_import', array($this, 'lockAutoPostImport'));
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'));
36
add_action('wp_ajax_b2s_calendar_delete', array($this, 'b2sCalendarDelete'));
37
add_action('wp_ajax_b2s_calendar_save', array($this, 'b2sCalendarSave'));
38
add_action("wp_ajax_b2s_get_calendar_release_locks", array($this, 'releaseLocks'));
39
+ add_action("wp_ajax_b2s_hide_rating", array($this, 'hideRating'));
40
+ add_action("wp_ajax_b2s_hide_premium_message", array($this, 'hidePremiumMessage'));
41
+ add_action("wp_ajax_b2s_hide_trail_message", array($this, 'hideTrailMessage'));
42
+ add_action("wp_ajax_b2s_hide_trail_ended_message", array($this, 'hideTrailEndedMessage'));
43
}
44
45
public function prgShip() {
92
wp_die();
93
}
94
95
+ public function lockAutoPostImport() {
96
+ if (isset($_POST['userId']) && (int) $_POST['userId'] > 0) {
97
+ update_option('B2S_LOCK_AUTO_POST_IMPORT_' . (int) $_POST['user_id'], 1);
98
+ }
99
+ echo json_encode(array('result' => true));
100
+ wp_die();
101
+ }
102
+
103
public function prgLogin() {
104
if (isset($_POST['postId']) && (int) $_POST['postId'] > 0 && isset($_POST['username']) && !empty($_POST['username']) && isset($_POST['password']) && !empty($_POST['password'])) {
105
$pubKey = json_decode(PRG_Api_Get::get(B2S_PLUGIN_PRG_API_ENDPOINT . 'auth.php?publicKey=true', array()));
348
$options = new B2S_Options(B2S_PLUGIN_BLOG_USER_ID);
349
$options->_setOption('user_time_zone', $_POST['user_time_zone']);
350
echo json_encode(array('result' => true));
351
+ }
352
+ if (isset($_POST['type']) && $_POST['type'] == 'auto_post_imported') {
353
+ if (isset($_POST['b2s-import-auto-post']) && (int) $_POST['b2s-import-auto-post'] == 1 && !isset($_POST['b2s-import-auto-post-network-auth-id'])) {
354
+ echo json_encode(array('result' => false, 'type' => 'no-auth-selected'));
355
+ wp_die();
356
+ }
357
+
358
+
359
+ $network_auth_id = isset($_POST['b2s-import-auto-post-network-auth-id']) && is_array($_POST['b2s-import-auto-post-network-auth-id']) ? $_POST['b2s-import-auto-post-network-auth-id'] : array();
360
+ $post_type = isset($_POST['b2s-import-auto-post-type-data']) && is_array($_POST['b2s-import-auto-post-type-data']) ? $_POST['b2s-import-auto-post-type-data'] : array();
361
+
362
+ $auto_post_import = array('active' => ((isset($_POST['b2s-import-auto-post']) && (int) $_POST['b2s-import-auto-post'] == 1) ? 1 : 0),
363
+ 'network_auth_id' => $network_auth_id,
364
+ 'ship_state' => ((isset($_POST['b2s-import-auto-post-time-state']) && (int) $_POST['b2s-import-auto-post-time-state'] == 1) ? 1 : 0),
365
+ 'ship_delay_time' => (int) $_POST['b2s-import-auto-post-time-data'],
366
+ 'post_filter' => ((isset($_POST['b2s-import-auto-post-filter']) && (int) $_POST['b2s-import-auto-post-filter'] == 1) ? 1 : 0),
367
+ 'post_type_state' => ((isset($_POST['b2s-import-auto-post-type-state']) && (int) $_POST['b2s-import-auto-post-type-state'] == 1) ? 1 : 0),
368
+ 'post_type' => $post_type);
369
+
370
+ $options = new B2S_Options(B2S_PLUGIN_BLOG_USER_ID);
371
+ $options->_setOption('auto_post_import', $auto_post_import);
372
+ echo json_encode(array('result' => true));
373
wp_die();
374
}
375
376
+
377
echo json_encode(array('result' => false));
378
wp_die();
379
}
723
'user_timezone' => isset($post['user_timezone']) ? $post['user_timezone'] : 0,
724
'saveSetting' => isset($data['saveSchedSetting']) ? true : false
725
);
726
+
727
$b2sShipSend->saveSchedDetails(array_merge($defaultPostData, $sendData), $schedData);
728
}
729
748
}
749
}
750
751
+ public function hideRating()
752
+ {
753
+ B2S_Rating::hide(isset($_POST['forever']));
754
+ }
755
+
756
+ public function hidePremiumMessage()
757
+ {
758
+ update_option("B2S_HIDE_PREMIUM_MESSAGE",true);
759
+ }
760
+
761
+ public function hideTrailMessage()
762
+ {
763
+ update_option("B2S_HIDE_TRAIL_MESSAGE",true);
764
+ }
765
+
766
+ public function hideTrailEndedMessage()
767
+ {
768
+ update_option("B2S_HIDE_TRAIL_ENDED",true);
769
+ }
770
+
771
}
includes/{AutoShare.php → B2S/AutoPost.php} RENAMED
@@ -1,6 +1,6 @@
1