Blog2Social: Social Media Auto Post & Scheduler - Version 4.3.1

Version Description

Bugfix: Social meta tags

Download this release

Release Info

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

Code changes from version 4.2.2 to 4.3.1

Files changed (142) hide show
  1. assets/css/b2s/calendar.css +209 -0
  2. assets/css/b2s/settings.css +5 -0
  3. assets/css/b2s/ship.css +16 -2
  4. assets/css/general.css +24 -20
  5. assets/images/portale/16_flat.png +0 -0
  6. assets/js/b2s/calendar.js +348 -0
  7. assets/js/b2s/general.js +18 -3
  8. assets/js/b2s/lib.js +20 -0
  9. assets/js/b2s/post.js +95 -42
  10. assets/js/b2s/settings.js +153 -38
  11. assets/js/b2s/ship.js +451 -129
  12. assets/js/b2s/wp/post-meta-box-auto.js +2 -2
  13. assets/lib/fullcalendar/CHANGELOG.txt +1160 -0
  14. assets/lib/fullcalendar/CONTRIBUTING.txt +127 -0
  15. assets/lib/fullcalendar/LICENSE.txt +20 -0
  16. assets/lib/fullcalendar/fullcalendar.css +1413 -0
  17. assets/lib/fullcalendar/fullcalendar.js +15591 -0
  18. assets/lib/fullcalendar/fullcalendar.min.css +5 -0
  19. assets/lib/fullcalendar/fullcalendar.min.js +10 -0
  20. assets/lib/fullcalendar/fullcalendar.print.css +208 -0
  21. assets/lib/fullcalendar/fullcalendar.print.min.css +5 -0
  22. assets/lib/fullcalendar/gcal.js +180 -0
  23. assets/lib/fullcalendar/gcal.min.js +6 -0
  24. assets/lib/fullcalendar/lib/cupertino/images/ui-bg_diagonals-thick_90_eeeeee_40x40.png +0 -0
  25. assets/lib/fullcalendar/lib/cupertino/images/ui-bg_glass_100_e4f1fb_1x400.png +0 -0
  26. assets/lib/fullcalendar/lib/cupertino/images/ui-bg_glass_50_3baae3_1x400.png +0 -0
  27. assets/lib/fullcalendar/lib/cupertino/images/ui-bg_glass_80_d7ebf9_1x400.png +0 -0
  28. assets/lib/fullcalendar/lib/cupertino/images/ui-bg_highlight-hard_100_f2f5f7_1x100.png +0 -0
  29. assets/lib/fullcalendar/lib/cupertino/images/ui-bg_highlight-hard_70_000000_1x100.png +0 -0
  30. assets/lib/fullcalendar/lib/cupertino/images/ui-bg_highlight-soft_100_deedf7_1x100.png +0 -0
  31. assets/lib/fullcalendar/lib/cupertino/images/ui-bg_highlight-soft_25_ffef8f_1x100.png +0 -0
  32. assets/lib/fullcalendar/lib/cupertino/images/ui-icons_2694e8_256x240.png +0 -0
  33. assets/lib/fullcalendar/lib/cupertino/images/ui-icons_2e83ff_256x240.png +0 -0
  34. assets/lib/fullcalendar/lib/cupertino/images/ui-icons_3d80b3_256x240.png +0 -0
  35. assets/lib/fullcalendar/lib/cupertino/images/ui-icons_72a7cf_256x240.png +0 -0
  36. assets/lib/fullcalendar/lib/cupertino/images/ui-icons_ffffff_256x240.png +0 -0
  37. assets/lib/fullcalendar/lib/cupertino/jquery-ui.min.css +7 -0
  38. assets/lib/fullcalendar/lib/jquery-ui.min.js +13 -0
  39. assets/lib/fullcalendar/lib/jquery.min.js +4 -0
  40. assets/lib/fullcalendar/lib/moment.min.js +7 -0
  41. assets/lib/fullcalendar/locale-all.js +5 -0
  42. assets/lib/fullcalendar/locale/af.js +1 -0
  43. assets/lib/fullcalendar/locale/ar-dz.js +1 -0
  44. assets/lib/fullcalendar/locale/ar-kw.js +1 -0
  45. assets/lib/fullcalendar/locale/ar-ly.js +1 -0
  46. assets/lib/fullcalendar/locale/ar-ma.js +1 -0
  47. assets/lib/fullcalendar/locale/ar-sa.js +1 -0
  48. assets/lib/fullcalendar/locale/ar-tn.js +1 -0
  49. assets/lib/fullcalendar/locale/ar.js +1 -0
  50. assets/lib/fullcalendar/locale/bg.js +1 -0
  51. assets/lib/fullcalendar/locale/ca.js +1 -0
  52. assets/lib/fullcalendar/locale/cs.js +1 -0
  53. assets/lib/fullcalendar/locale/da.js +1 -0
  54. assets/lib/fullcalendar/locale/de-at.js +1 -0
  55. assets/lib/fullcalendar/locale/de-ch.js +1 -0
  56. assets/lib/fullcalendar/locale/de.js +1 -0
  57. assets/lib/fullcalendar/locale/el.js +1 -0
  58. assets/lib/fullcalendar/locale/en-au.js +1 -0
  59. assets/lib/fullcalendar/locale/en-ca.js +1 -0
  60. assets/lib/fullcalendar/locale/en-gb.js +1 -0
  61. assets/lib/fullcalendar/locale/en-ie.js +1 -0
  62. assets/lib/fullcalendar/locale/en-nz.js +1 -0
  63. assets/lib/fullcalendar/locale/es-do.js +1 -0
  64. assets/lib/fullcalendar/locale/es.js +1 -0
  65. assets/lib/fullcalendar/locale/et.js +1 -0
  66. assets/lib/fullcalendar/locale/eu.js +1 -0
  67. assets/lib/fullcalendar/locale/fa.js +1 -0
  68. assets/lib/fullcalendar/locale/fi.js +1 -0
  69. assets/lib/fullcalendar/locale/fr-ca.js +1 -0
  70. assets/lib/fullcalendar/locale/fr-ch.js +1 -0
  71. assets/lib/fullcalendar/locale/fr.js +1 -0
  72. assets/lib/fullcalendar/locale/gl.js +1 -0
  73. assets/lib/fullcalendar/locale/he.js +1 -0
  74. assets/lib/fullcalendar/locale/hi.js +1 -0
  75. assets/lib/fullcalendar/locale/hr.js +1 -0
  76. assets/lib/fullcalendar/locale/hu.js +1 -0
  77. assets/lib/fullcalendar/locale/id.js +1 -0
  78. assets/lib/fullcalendar/locale/is.js +1 -0
  79. assets/lib/fullcalendar/locale/it.js +1 -0
  80. assets/lib/fullcalendar/locale/ja.js +1 -0
  81. assets/lib/fullcalendar/locale/kk.js +1 -0
  82. assets/lib/fullcalendar/locale/ko.js +1 -0
  83. assets/lib/fullcalendar/locale/lb.js +1 -0
  84. assets/lib/fullcalendar/locale/lt.js +1 -0
  85. assets/lib/fullcalendar/locale/lv.js +1 -0
  86. assets/lib/fullcalendar/locale/mk.js +1 -0
  87. assets/lib/fullcalendar/locale/ms-my.js +1 -0
  88. assets/lib/fullcalendar/locale/ms.js +1 -0
  89. assets/lib/fullcalendar/locale/nb.js +1 -0
  90. assets/lib/fullcalendar/locale/nl-be.js +1 -0
  91. assets/lib/fullcalendar/locale/nl.js +1 -0
  92. assets/lib/fullcalendar/locale/nn.js +1 -0
  93. assets/lib/fullcalendar/locale/pl.js +1 -0
  94. assets/lib/fullcalendar/locale/pt-br.js +1 -0
  95. assets/lib/fullcalendar/locale/pt.js +1 -0
  96. assets/lib/fullcalendar/locale/ro.js +1 -0
  97. assets/lib/fullcalendar/locale/ru.js +1 -0
  98. assets/lib/fullcalendar/locale/sk.js +1 -0
  99. assets/lib/fullcalendar/locale/sl.js +1 -0
  100. assets/lib/fullcalendar/locale/sr-cyrl.js +1 -0
  101. assets/lib/fullcalendar/locale/sr.js +1 -0
  102. assets/lib/fullcalendar/locale/sv.js +1 -0
  103. assets/lib/fullcalendar/locale/th.js +1 -0
  104. assets/lib/fullcalendar/locale/tr.js +1 -0
  105. assets/lib/fullcalendar/locale/uk.js +1 -0
  106. assets/lib/fullcalendar/locale/vi.js +1 -0
  107. assets/lib/fullcalendar/locale/zh-cn.js +1 -0
  108. assets/lib/fullcalendar/locale/zh-tw.js +1 -0
  109. blog2social.php +74 -0
  110. includes/Ajax/Get.php +66 -4
  111. includes/Ajax/Post.php +250 -11
  112. includes/AutoShare.php +2 -2
  113. includes/B2S/Calendar/Filter.php +206 -0
  114. includes/B2S/Calendar/Item.php +430 -0
  115. includes/B2S/Calendar/ItemEdit.php +64 -0
  116. includes/B2S/Calendar/Save.php +27 -0
  117. includes/B2S/Heartbeat.php +34 -4
  118. includes/B2S/Post/Filter.php +2 -2
  119. includes/B2S/Settings/Item.php +51 -3
  120. includes/B2S/Ship/Image.php +22 -6
  121. includes/B2S/Ship/Item.php +108 -54
  122. includes/B2S/Ship/Navbar.php +3 -3
  123. includes/B2S/Ship/Save.php +46 -16
  124. includes/{Init.php → Loader.php} +143 -26
  125. includes/Meta.php +263 -0
  126. includes/MetaBox.php +6 -5
  127. includes/Options.php +6 -2
  128. includes/Util.php +0 -1
  129. index.php +1 -67
  130. languages/blog2social-de_DE.mo +0 -0
  131. languages/blog2social-de_DE.po +1312 -887
  132. readme.txt +9 -1
  133. views/b2s/html/footer.phtml +294 -195
  134. views/b2s/html/header.phtml +39 -1
  135. views/b2s/html/post.navbar.phtml +1 -0
  136. views/b2s/image.calendar.php +7 -0
  137. views/b2s/modal.calendar.php +72 -0
  138. views/b2s/post.calendar.php +117 -0
  139. views/b2s/post.publish.php +2 -1
  140. views/b2s/post.sched.php +1 -0
  141. views/b2s/settings.php +29 -1
  142. views/b2s/ship.php +29 -30
assets/css/b2s/calendar.css ADDED
@@ -0,0 +1,209 @@
1
+
2
+ body .fc-state-default{
3
+ color: #fff;
4
+ background-color: #337ab7;
5
+ border-color: #2e6da4;
6
+ background-image: none;
7
+ text-shadow: none;
8
+ box-shadow: none;
9
+ }
10
+ body .b2s-calendar-header{
11
+ display: flex;
12
+ padding-bottom: 2px;
13
+ }
14
+ body .b2s-calendar-body > img{
15
+ float: right;
16
+ height: 28px;
17
+ width: 28px;
18
+ }
19
+ body .b2s-calendar-header .fc-content{
20
+ padding-left: 2px;
21
+ }
22
+ body .b2s-calendar-body{
23
+ background-color: #fff;
24
+ color: #000;
25
+ margin-bottom: 1px;
26
+ border-radius: 2px;
27
+ padding: 2px;
28
+ }
29
+ body .b2s-calendar-body::after{
30
+ content: "";
31
+ clear:both;
32
+ display: block;
33
+ }
34
+ body .fc-content{
35
+ display: block;
36
+ width: 100%;
37
+ }
38
+ body .fc-time{
39
+ display: block;
40
+ padding-right: 2px;
41
+ text-align: right;
42
+ float:right;
43
+ }
44
+ .network-name{
45
+ font-weight: bold;
46
+ }
47
+ .network-profile{
48
+ margin-bottom: 5px;
49
+ }
50
+ .b2s-post-item-thumb {
51
+ width: 5%;
52
+ margin-right: 8px;
53
+ }
54
+
55
+ .b2s-post-item-thumb img {
56
+ border-radius: 50%;
57
+ width: 48px;
58
+ }
59
+
60
+ .b2s-post-item-details {
61
+ width: 93%;
62
+ }
63
+
64
+ .b2s-post-item-details, .b2s-post-item-thumb {
65
+ float: left;
66
+ }
67
+ .b2s-post-item-details h4 {
68
+ font-size: 16px;
69
+ font-weight: 600;
70
+ text-transform: uppercase;
71
+ margin: 3px 3px 3px 0px;
72
+ }
73
+ .btn-circle {
74
+ width: 30px;
75
+ height: 30px;
76
+ text-align: center;
77
+ padding: 6px 0;
78
+ font-size: 12px;
79
+ line-height: 1.428571429;
80
+ border-radius: 15px;
81
+ }
82
+ .fb-url-image, .xing-url-image, .linkedin-url-image, .tw-url-image, .b2s-image-border {
83
+ margin-right: 10px;
84
+ margin-bottom: 20px;
85
+ border: 1px dashed #bdbfc2;
86
+ box-shadow: none;
87
+ padding: 5px;
88
+ }
89
+ textarea.form-control {
90
+ height: auto;
91
+ }
92
+ .fb-textarea-input, .tw-textarea-input, .xing-textarea-input, .linkedin-textarea-input {
93
+ font-size: 14px;
94
+ font-weight: normal;
95
+ line-height: 1.125;
96
+ width: 100%;
97
+ border: medium none;
98
+ border-radius: 0;
99
+ margin-top: 10px;
100
+ margin-bottom: 10px;
101
+ font-family: helvetica,arial,sans-serif;
102
+ }
103
+ .b2s-post-item-details-item-message-input{
104
+ min-height: 100px;
105
+ }
106
+ .b2s-post-item-details-url-image{
107
+ cursor: pointer;
108
+ }
109
+ .b2s-user-network-settings-post-format-area label > input {
110
+ visibility: hidden;
111
+ position: absolute;
112
+ }
113
+ .b2s-settings-checked + img {
114
+ border: 3px solid #79b232 !important;
115
+ }
116
+ .b2s-image-item {
117
+ background-color: #fff;
118
+ border: 1px solid #ddd;
119
+ display: block;
120
+ float: left;
121
+ height: 200px;
122
+ line-height: 1.42857;
123
+ margin-bottom: 15px;
124
+ margin-left: 15px;
125
+ margin-top: 15px;
126
+ overflow: hidden;
127
+ padding: 4px;
128
+ transition: border 0.2s ease-in-out 0s;
129
+ width: 185px;
130
+ }
131
+ .b2s-image-item-thumb {
132
+ height: 150px;
133
+ }
134
+ .b2s-image-change-all-network,.b2s-upload-image-free-version,.b2s-image-change-this-network{
135
+ margin-right: 5px !important;
136
+ }
137
+ .b2s-image-remove-btn {
138
+ position: absolute;
139
+ top: -5px;
140
+ right: 0px;
141
+ font-weight: 700 !important;
142
+ }
143
+ .b2s-calendar-delete{
144
+ cursor: pointer;
145
+ }
146
+ .b2s-btn-label-premium{
147
+ color: #fff;
148
+ text-decoration: none !important;
149
+ cursor: default !important;
150
+ }
151
+ .b2s-btn-label-premium:hover{
152
+ color: #fff;
153
+ text-decoration: none !important;
154
+ cursor: default !important;
155
+ }
156
+ .b2s-post-item .label-success{
157
+ display: none;
158
+ }
159
+ body .fc-day-grid-event .fc-content{
160
+ white-space: normal;
161
+ }
162
+
163
+ @media(max-width: 425px)
164
+ {
165
+ .b2s-calendar-body{
166
+ display: none;
167
+ }
168
+ }
169
+
170
+ @media(max-width: 350px)
171
+ {
172
+ body .fc-time{
173
+ font-size: 8px;
174
+ }
175
+ }
176
+
177
+ .b2s-loading-area {
178
+ width: 100% !important;
179
+ }
180
+
181
+ .og_title, .og_desc, .card_desc, .card_title, .b2s-post-item-details-item-title-input, .b2s-select{
182
+ margin-bottom: 8px !important;
183
+ }
184
+
185
+ .b2s-post-item-info-area {
186
+ font-size: 11px !important;
187
+ }
188
+
189
+ .b2s-post-ship-item-full-text, .b2s-post-ship-item-message-delete, .b2s-post-ship-item-network-settings, .b2s-post-ship-item-post-format{
190
+ line-height: 1.5 !important;
191
+ padding: 0 1px 3px !important;
192
+ }
193
+
194
+ .b2s-load-info-meta-tag-modal{
195
+ margin-top: 8px !important;
196
+ display: block !important;
197
+ margin-right: auto !important;
198
+ margin-left: auto !important;
199
+ }
200
+
201
+ .b2s-post-item-details-tag-add-div {
202
+ border: 0px !important;
203
+ box-shadow: 0px 0px 0px #000 !important;
204
+ }
205
+
206
+ .b2s-post-item-details-tag-input-elem {
207
+ margin: 2px 4px;
208
+ max-width: 145px !important;
209
+ }
assets/css/b2s/settings.css CHANGED
@@ -72,3 +72,8 @@ hr{
72
.font-gray{
73
color: #9B9B9B !important;
74
}
72
.font-gray{
73
color: #9B9B9B !important;
74
}
75
+
76
+ .b2s-post-item-network-image{
77
+ height: 16px;
78
+ width: 16px;
79
+ }
assets/css/b2s/ship.css CHANGED
@@ -176,6 +176,10 @@
176
177
/*Network List*/
178
179
.active {
180
background-color: #32373C;
181
}
@@ -611,6 +615,7 @@ input[type="checkbox"], input[type="radio"] {
611
.fb-url-desc{
612
font-size: 12px;
613
line-height: 16px;
614
}
615
616
@@ -624,6 +629,7 @@ input[type="checkbox"], input[type="radio"] {
624
.tw-url-desc{
625
margin: 5px 0 5px !important;
626
color: inherit !important;
627
}
628
629
.xing-container{
@@ -763,6 +769,14 @@ input[type="checkbox"], input[type="radio"] {
763
764
.b2s-settings-time-zone-text{
765
font-size: 13px;
766
- font-style: italic;
767
- color: #adadad;
768
}
176
177
/*Network List*/
178
179
+ .b2s-network-select-btn{
180
+ text-decoration:none !important;
181
+ }
182
+
183
.active {
184
background-color: #32373C;
185
}
615
.fb-url-desc{
616
font-size: 12px;
617
line-height: 16px;
618
+ margin-bottom: 8px !important;
619
}
620
621
629
.tw-url-desc{
630
margin: 5px 0 5px !important;
631
color: inherit !important;
632
+ margin-bottom: 8px !important;
633
}
634
635
.xing-container{
769
770
.b2s-settings-time-zone-text{
771
font-size: 13px;
772
+ font-style: italic;
773
+ color: #adadad;
774
+ }
775
+
776
+ .b2s-sidbar-wrapper-nav-li,.b2s-sidbar-network-auth-btn,.btn-toggle-menu{
777
+ cursor: pointer;
778
+ }
779
+
780
+ .b2s-load-info-meta-tag-modal{
781
+ float:right;
782
}
assets/css/general.css CHANGED
@@ -6952,6 +6952,7 @@ p {
6952
6953
.b2s-select,.b2s-input{
6954
height: 30px !important;
6955
}
6956
6957
.b2s-logo{
@@ -7104,36 +7105,36 @@ input[type="checkbox"].error + label{
7104
-webkit-box-shadow: none;
7105
-moz-box-shadow: none;
7106
box-shadow: none;
7107
-
7108
}
7109
.panel-no-padding{
7110
padding: 0px;
7111
}
7112
7113
.btn-circle {
7114
- width: 30px;
7115
- height: 30px;
7116
- text-align: center;
7117
- padding: 6px 0;
7118
- font-size: 12px;
7119
- line-height: 1.428571429;
7120
- border-radius: 15px;
7121
}
7122
.btn-circle.btn-lg {
7123
- width: 50px;
7124
- height: 50px;
7125
- padding: 10px 16px;
7126
- font-size: 18px;
7127
- line-height: 1.33;
7128
- border-radius: 25px;
7129
}
7130
.btn-circle.btn-xl {
7131
- width: 70px;
7132
- height: 70px;
7133
- padding: 10px 16px;
7134
- font-size: 24px;
7135
- line-height: 1.33;
7136
- border-radius: 35px;
7137
}
7138
7139
.b2s-info-btn {
@@ -7151,4 +7152,7 @@ input[type="checkbox"].error + label{
7151
7152
.btn-label-premium {
7153
color: #fff !important;
7154
}
6952
6953
.b2s-select,.b2s-input{
6954
height: 30px !important;
6955
+ margin-bottom: 8px !important;
6956
}
6957
6958
.b2s-logo{
7105
-webkit-box-shadow: none;
7106
-moz-box-shadow: none;
7107
box-shadow: none;
7108
+
7109
}
7110
.panel-no-padding{
7111
padding: 0px;
7112
}
7113
7114
.btn-circle {
7115
+ width: 30px;
7116
+ height: 30px;
7117
+ text-align: center;
7118
+ padding: 6px 0;
7119
+ font-size: 12px;
7120
+ line-height: 1.428571429;
7121
+ border-radius: 15px;
7122
}
7123
.btn-circle.btn-lg {
7124
+ width: 50px;
7125
+ height: 50px;
7126
+ padding: 10px 16px;
7127
+ font-size: 18px;
7128
+ line-height: 1.33;
7129
+ border-radius: 25px;
7130
}
7131
.btn-circle.btn-xl {
7132
+ width: 70px;
7133
+ height: 70px;
7134
+ padding: 10px 16px;
7135
+ font-size: 24px;
7136
+ line-height: 1.33;
7137
+ border-radius: 35px;
7138
}
7139
7140
.b2s-info-btn {
7152
7153
.btn-label-premium {
7154
color: #fff !important;
7155
+ }
7156
+ .btn-label-premium-xs{
7157
+ font-size: 11px !important;
7158
}
assets/images/portale/16_flat.png ADDED
Binary file
assets/js/b2s/calendar.js ADDED
@@ -0,0 +1,348 @@
1
+ jQuery.noConflict();
2
+
3
+ jQuery(document).ready(function () {
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
+
28
+ element.append($body);
29
+ },
30
+ eventDrop: function (event, delta, revertFunc) {
31
+ jQuery.ajax({
32
+ url: ajaxurl,
33
+ type: "POST",
34
+ dataType: "json",
35
+ cache: false,
36
+ data: {
37
+ 'action': 'b2s_calendar_move_post',
38
+ 'b2s_id': event.b2s_id,
39
+ 'user_timezone': event.user_timezone,
40
+ 'sched_date': event.start.format(),
41
+ },
42
+ success: function (data) {
43
+ wp.heartbeat.connectNow();
44
+ }
45
+ });
46
+ },
47
+ eventAllow: function (dropLocation, draggedEvent) {
48
+ return dropLocation.start.isAfter(b2s_calendar_date) && draggedEvent.start.isAfter(b2s_calendar_datetime);
49
+ },
50
+ eventClick: function (calEvent, jsEvent, view) {
51
+
52
+ if (jQuery('#b2s-edit-event-modal-' + calEvent.b2s_id).length == 1)
53
+ {
54
+ jQuery('#b2s-edit-event-modal-' + calEvent.b2s_id).remove();
55
+ }
56
+ b2s_current_post_id = calEvent.post_id;
57
+ var $modal = jQuery("<div>");
58
+
59
+ jQuery.ajax({
60
+ url: ajaxurl,
61
+ type: "POST",
62
+ cache: false,
63
+ async: false,
64
+ data: {
65
+ 'action': 'b2s_get_calendar_edit_modal',
66
+ 'id': calEvent.b2s_id
67
+ },
68
+ success: function (data) {
69
+ $modal = $modal.html(data);
70
+ }
71
+ });
72
+ jQuery("body").append($modal);
73
+
74
+ jQuery('#b2s-edit-event-modal-' + calEvent.b2s_id).modal('show');
75
+ activatePortal(calEvent.network_auth_id);
76
+ initSceditor(calEvent.network_auth_id);
77
+ networkCount(calEvent.network_auth_id);
78
+
79
+ console.log(calEvent.post_format);
80
+
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
+ if (jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + calEvent.network_type + '"][data-network-id="' + calEvent.network_id + '"]').val() == "0") {
103
+ jQuery('.b2s-post-item-details-preview-title[data-network-auth-id="' + calEvent.network_auth_id + '"]').prop("readonly", false);
104
+ jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + calEvent.network_auth_id + '"]').prop("readonly", false);
105
+ jQuery('.b2s-post-item-details-preview-url-reload[data-network-id="' + calEvent.network_id + '"]').hide();
106
+
107
+ var dataMetaType = jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + calEvent.network_auth_id + '"]').attr("data-meta-type");
108
+ if (dataMetaType == "og") {
109
+ jQuery('#b2sChangeOgMeta').val("1");
110
+ } else {
111
+ jQuery('#b2sChangeCardMeta').val("1");
112
+ }
113
+
114
+ } else {
115
+ jQuery('.b2s-post-item-details-preview-title[data-network-auth-id="' + calEvent.network_auth_id + '"]').prop("readonly", true);
116
+ jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + calEvent.network_auth_id + '"]').prop("readonly", true);
117
+ jQuery('.b2s-post-item-details-preview-url-reload[data-network-id="' + calEvent.network_id + '"]').show();
118
+ jQuery('.b2s-post-item-details-preview-url-reload[data-network-id="' + calEvent.network_id + '"]').trigger("click");
119
+ }
120
+
121
+
122
+ }
123
+
124
+ jQuery("#b2sPostId").val(calEvent.post_id);
125
+
126
+ var today = new Date();
127
+ var dateFormat = "yyyy-mm-dd";
128
+ var language = "en";
129
+ var showMeridian = true;
130
+ if (jQuery('#b2sUserLang').val() == "de") {
131
+ dateFormat = "dd.mm.yyyy";
132
+ language = "de";
133
+ showMeridian = false;
134
+ }
135
+
136
+ jQuery(".b2s-post-item-details-release-input-date").datepicker({
137
+ format: dateFormat,
138
+ language: language,
139
+ maxViewMode: 2,
140
+ todayHighlight: true,
141
+ startDate: today,
142
+ calendarWeeks: true,
143
+ autoclose: true
144
+ });
145
+ jQuery('.b2s-post-item-details-release-input-time').timepicker({
146
+ minuteStep: 15,
147
+ appendWidgetTo: 'body',
148
+ showSeconds: false,
149
+ showMeridian: showMeridian,
150
+ defaultTime: 'current',
151
+ snapToStep: true
152
+ });
153
+
154
+ jQuery(".b2s-post-item-details-release-input-date").datepicker().on('changeDate', function (e) {
155
+ checkSchedDateTime(calEvent.network_auth_id);
156
+ });
157
+ jQuery('.b2s-post-item-details-release-input-time').timepicker().on('changeTime.timepicker', function (e) {
158
+ checkSchedDateTime(calEvent.network_auth_id);
159
+
160
+ });
161
+
162
+ init();
163
+
164
+ if (!b2s_has_premium)
165
+ {
166
+ jQuery('#b2s-edit-event-modal-' + calEvent.b2s_id).find("input, textarea, button").each(function () {
167
+ if (!jQuery(this).hasClass('b2s-modal-close')) {
168
+ jQuery(this).prop("disabled", true);
169
+ }
170
+ });
171
+ }
172
+ }
173
+
174
+ });
175
+
176
+ jQuery(".b2s-loading-area").hide();
177
+
178
+ jQuery(document).on('click', '.b2s-select-image-modal-open', function () {
179
+ jQuery('.b2s-network-select-image-content').html("");
180
+ jQuery.ajax({
181
+ url: ajaxurl,
182
+ type: "POST",
183
+ cache: false,
184
+ async: false,
185
+ data: {
186
+ 'action': 'b2s_get_image_modal',
187
+ 'id': jQuery(this).data('post-id'),
188
+ 'image_url': jQuery(this).data('image-url')
189
+ },
190
+ success: function (data) {
191
+ jQuery(".b2s-network-select-image-content").html(data);
192
+ }
193
+ });
194
+
195
+ var authId = jQuery(this).data('network-auth-id');
196
+ jQuery('.b2s-image-change-this-network').attr('data-network-auth-id', authId);
197
+ jQuery('.b2s-upload-image').attr('data-network-auth-id', authId);
198
+
199
+ 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();
200
+ jQuery('.b2s-selected-network-for-image-info').html(content);
201
+ jQuery('#b2sInsertImageType').val("0");
202
+
203
+ jQuery('.networkImage').each(function () {
204
+ var width = this.naturalWidth;
205
+ var height = this.naturalHeight;
206
+ jQuery(this).parents('.b2s-image-item').find('.b2s-image-item-caption-resolution').html(width + 'x' + height);
207
+ });
208
+ jQuery('#b2s-network-select-image').modal('show');
209
+ return false;
210
+ });
211
+
212
+ jQuery(document).on("click", ".b2s-calendar-delete", function () {
213
+ var id = jQuery(this).data("b2s-id");
214
+ var post_id = jQuery(this).data("post-id");
215
+ jQuery.ajax({
216
+ url: ajaxurl,
217
+ type: "POST",
218
+ dataType: "json",
219
+ cache: false,
220
+ data: {
221
+ 'action': 'b2s_calendar_delete',
222
+ 'b2s_id': id,
223
+ 'post_id' : post_id
224
+ },
225
+ success: function (data) {
226
+ jQuery('#b2s-edit-event-modal-' + id).modal('hide');
227
+
228
+ refreshCalender();
229
+ wp.heartbeat.connectNow();
230
+ }
231
+ });
232
+ });
233
+
234
+ jQuery(document).on("click", ".b2s-calendar-save-all", function (e) {
235
+ jQuery('#save_method').val("apply-all");
236
+ e.preventDefault();
237
+ var id = jQuery(this).data("b2s-id");
238
+ jQuery.ajax({
239
+ url: ajaxurl,
240
+ type: "POST",
241
+ dataType: "json",
242
+ cache: false,
243
+ data: jQuery(this).closest("form").serialize(),
244
+ success: function (data) {
245
+ jQuery('#b2s-edit-event-modal-' + id).modal('hide');
246
+
247
+ refreshCalender();
248
+ jQuery('#b2s-edit-event-modal-' + id).remove();
249
+ wp.heartbeat.connectNow();
250
+ }
251
+ });
252
+ });
253
+
254
+ jQuery(document).on("click", ".b2s-calendar-save-this", function (e) {
255
+ e.preventDefault();
256
+ jQuery('#save_method').val("apply-this");
257
+ var id = jQuery(this).data("b2s-id");
258
+ jQuery.ajax({
259
+ url: ajaxurl,
260
+ type: "POST",
261
+ dataType: "json",
262
+ cache: false,
263
+ data: jQuery(this).closest("form").serialize(),
264
+ success: function (data) {
265
+ jQuery('#b2s-edit-event-modal-' + id).modal('hide');
266
+ refreshCalender();
267
+ jQuery('#b2s-edit-event-modal-' + id).remove();
268
+ wp.heartbeat.connectNow();
269
+ }
270
+ });
271
+ });
272
+
273
+ jQuery(document).on("click", ".release_locks", function () {
274
+ jQuery.ajax({
275
+ url: ajaxurl,
276
+ type: "POST",
277
+ cache: false,
278
+ async: false,
279
+ data: {
280
+ 'action': 'b2s_get_calendar_release_locks',
281
+ 'post_id' : jQuery('#post_id').val()
282
+ },
283
+ success: function (data) {
284
+ wp.heartbeat.connectNow();
285
+ }
286
+ });
287
+ });
288
+ });
289
+
290
+ function refreshCalender() {
291
+ jQuery('#b2s_calendar').fullCalendar('refetchEvents');
292
+ }
293
+
294
+ jQuery('#b2s-info-meta-tag-modal').on('hidden.bs.modal', function (e) {
295
+ jQuery('body').addClass('modal-open');
296
+ });
297
+
298
+ jQuery('#b2s-network-select-image').on('hidden.bs.modal', function (e) {
299
+ jQuery('body').addClass('modal-open');
300
+ });
301
+
302
+ jQuery('#b2s-post-ship-item-post-format-modal').on('hidden.bs.modal', function (e) {
303
+ jQuery('body').addClass('modal-open');
304
+ });
305
+
306
+
307
+ //jQuery(this).attr('data-network-auth-id')
308
+ function checkSchedDateTime(dataNetworkAuthId) {
309
+ var dateElement = '.b2s-post-item-details-release-input-date[data-network-auth-id="' + dataNetworkAuthId + '"]';
310
+ var timeElement = '.b2s-post-item-details-release-input-time[data-network-auth-id="' + dataNetworkAuthId + '"]';
311
+ var dateStr = jQuery(dateElement).val();
312
+ var minStr = jQuery(timeElement).val();
313
+ var timeZone = parseInt(jQuery('#user_timezone').val()) * (-1);
314
+
315
+ if (jQuery('#b2sUserLang').val() == 'de') {
316
+ dateStr = dateStr.substring(6, 10) + '-' + dateStr.substring(3, 5) + '-' + dateStr.substring(0, 2);
317
+ } else {
318
+ var minParts = minStr.split(' ');
319
+ var minParts2 = minParts[0].split(':');
320
+ if (minParts[1] == 'PM') {
321
+ minParts2[0] = parseInt(minParts2[0]) + 12;
322
+ }
323
+ minStr = minParts2[0] + ':' + minParts2[1];
324
+ }
325
+
326
+ var minParts3 = minStr.split(':');
327
+ if (minParts3[0] < 10) {
328
+ minParts3[0] = '0' + minParts3[0];
329
+ }
330
+ var dateParts = dateStr.split('-');
331
+
332
+ //utc current time
333
+ var now = new Date();
334
+ //offset between utc und user
335
+ var offset = (parseInt(now.getTimezoneOffset()) / 60) * (-1);
336
+ //enter hour to user time
337
+ var hour = parseInt(minParts3[0]) + timeZone + offset;
338
+ //calculate datetime in utc
339
+ var enter = new Date(dateParts[0], dateParts[1] - 1, dateParts[2], hour, minParts3[1]);
340
+ //compare enter date time with allowed user time
341
+ if (enter.getTime() < now.getTime()) {
342
+ //enter set on next 15 minutes and calculate on user timezone
343
+ enter.setTime(now.getTime() + (900000 - (now.getTime() % 900000)) - (3600000 * (timeZone + offset)));
344
+ jQuery(dateElement).datepicker('update', enter);
345
+ jQuery(timeElement).timepicker('setTime', enter);
346
+ }
347
+ }
348
+
assets/js/b2s/general.js CHANGED
@@ -3,7 +3,7 @@ jQuery(window).on("load", function () {
3
jQuery('.b2s-heartbeat-fail').show();
4
} else {
5
jQuery('.b2s-heartbeat-fail').hide();
6
- }
7
});
8
9
jQuery(document).on('click', '.b2s-show-feedback-modal', function () {
@@ -138,7 +138,7 @@ jQuery(document).on('click', '.b2s-trail-btn-start', function () {
138
jQuery('#b2s-trial-modal').modal('hide');
139
jQuery('.b2s-key-area-success').show();
140
jQuery('.b2s-trail-tracking').show();
141
- jQuery('#b2s-trail-tracking-src').attr('src','https://www.googleadservices.com/pagead/conversion/1072559458/?label=HB4lCM27oHMQ4uq3_wM&amp;guid=ON&amp;script=0');
142
jQuery('.b2s-key-area-key-name').html(data.lizenzName);
143
jQuery('.b2s-key-name').html(data.lizenzName);
144
jQuery('.b2s-trail-premium-info-area').hide();
@@ -160,7 +160,7 @@ jQuery('#b2sPreFeatureModal').on('show.bs.modal', function (e) {
160
jQuery('#b2sProFeatureModal').on('show.bs.modal', function (e) {
161
jQuery(this).find('.modal-title').html(jQuery(e.relatedTarget).attr('data-title'));
162
jQuery(this).find('.modal-body').hide();
163
- jQuery(this).find('.'+jQuery(e.relatedTarget).attr('data-type')).show();
164
});
165
166
jQuery(document).on('heartbeat-send', function (e, data) {
@@ -175,7 +175,22 @@ jQuery(document).on('click', '.b2s-modal-close', function () {
175
return false;
176
});
177
178
function isEmail(email) {
179
var regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+#x2F;;
180
return regex.test(email);
181
}
3
jQuery('.b2s-heartbeat-fail').show();
4
} else {
5
jQuery('.b2s-heartbeat-fail').hide();
6
+ }
7
});
8
9
jQuery(document).on('click', '.b2s-show-feedback-modal', function () {
138
jQuery('#b2s-trial-modal').modal('hide');
139
jQuery('.b2s-key-area-success').show();
140
jQuery('.b2s-trail-tracking').show();
141
+ jQuery('#b2s-trail-tracking-src').attr('src', 'https://www.googleadservices.com/pagead/conversion/1072559458/?label=HB4lCM27oHMQ4uq3_wM&amp;guid=ON&amp;script=0');
142
jQuery('.b2s-key-area-key-name').html(data.lizenzName);
143
jQuery('.b2s-key-name').html(data.lizenzName);
144
jQuery('.b2s-trail-premium-info-area').hide();
160
jQuery('#b2sProFeatureModal').on('show.bs.modal', function (e) {
161
jQuery(this).find('.modal-title').html(jQuery(e.relatedTarget).attr('data-title'));
162
jQuery(this).find('.modal-body').hide();
163
+ jQuery(this).find('.' + jQuery(e.relatedTarget).attr('data-type')).show();
164
});
165
166
jQuery(document).on('heartbeat-send', function (e, data) {
175
return false;
176
});
177
178
+
179
+ jQuery(document).on('click', '.b2s-load-info-meta-tag-modal', function () {
180
+ var dataType = jQuery(this).attr('data-meta-type');
181
+ var dataOrigin = jQuery(this).attr('data-meta-origin');
182
+ jQuery('.modal-meta-content').hide();
183
+ jQuery('.meta-body[data-meta-type=' + dataType + '][data-meta-origin=' + dataOrigin + ']').show();
184
+ jQuery('.meta-title[data-meta-origin=' + dataOrigin + ']').show();
185
+ jQuery('#b2s-info-meta-tag-modal').modal('show');
186
+ return false;
187
+ });
188
+
189
function isEmail(email) {
190
var regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+#x2F;;
191
return regex.test(email);
192
}
193
+
194
+
195
+
196
+
assets/js/b2s/lib.js ADDED
@@ -0,0 +1,20 @@
1
+ b2s = typeof(b2s) == "undefined" ? {network: {}} : b2s;
2
+
3
+ b2s.network.showImageDialog = function(data){
4
+ var authId = data.network_auth_id;
5
+ jQuery('.b2s-image-change-this-network').attr('data-network-auth-id', authId);
6
+ jQuery('.b2s-upload-image').attr('data-network-auth-id', authId);
7
+
8
+ 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();
9
+ jQuery('.b2s-selected-network-for-image-info').html(content);
10
+ jQuery('#b2sInsertImageType').val("0");
11
+ jQuery('#b2s-network-select-image').modal('show');
12
+
13
+ jQuery('.networkImage').each(function () {
14
+ var width = this.naturalWidth;
15
+ var height = this.naturalHeight;
16
+ jQuery(this).parents('.b2s-image-item').find('.b2s-image-item-caption-resolution').html(width + 'x' + height);
17
+ });
18
+
19
+ return false;
20
+ };
assets/js/b2s/post.js CHANGED
@@ -179,7 +179,7 @@ jQuery(document).on('click', '.b2sDetailsSchedPostBtn', function () {
179
'action': 'b2s_sched_post_data',
180
'postId': postId,
181
'showByDate': showByDate,
182
- 'userAuthId' : userAuthId
183
},
184
error: function () {
185
jQuery('.b2s-server-connection-fail').show();
@@ -339,7 +339,7 @@ jQuery(document).on('click', '.b2s-publish-delete-confirm-btn', function () {
339
var dateFormat = "yyyy-mm-dd";
340
var language = "en";
341
var showMeridian = true;
342
- if (jQuery('#b2sLang').val() == "de") {
343
dateFormat = "dd.mm.yyyy";
344
language = "de";
345
showMeridian = false;
@@ -355,24 +355,29 @@ if (jQuery.isFunction(jQuery.fn.datepicker)) {
355
calendarWeeks: true,
356
autoclose: true
357
});
358
jQuery("#b2s-change-date").datepicker().on('changeDate', function (e) {
359
- var element = '#b2s-change-time';
360
- var dateStr = jQuery(this).val();
361
- var minStr = jQuery(element).val()
362
- if (jQuery('#b2sLang').val() == 'de') {
363
- dateStr = dateStr.substring(6, 10) + '-' + dateStr.substring(3, 5) + '-' + dateStr.substring(0, 2);
364
- }
365
- var dateObj = new Date();
366
- dateObj.setTime(jQuery('#b2s-data-blog-sched-date').val());
367
- if (Date.parse(dateStr + ' ' + minStr + ':00') <= Date.parse(dateObj.getUTCFullYear() + '-' + (dateObj.getUTCMonth() + 1) + '-' + dateObj.getUTCDate() + ' ' + dateObj.getUTCHours() + ':' + dateObj.getUTCMinutes() + ':00')) {
368
- //date in past
369
- if (dateObj.getUTCMinutes() >= 30) {
370
- jQuery(element).timepicker('setTime', (dateObj.getUTCHours() + 1) + ':00');
371
- } else {
372
- jQuery(element).timepicker('setTime', (dateObj.getUTCHours()) + ':30');
373
- }
374
- }
375
});
376
}
377
378
@@ -386,30 +391,35 @@ if (jQuery.isFunction(jQuery.fn.timepicker)) {
386
defaultTime: 'current',
387
snapToStep: true
388
});
389
jQuery('#b2s-change-time').timepicker().on('changeTime.timepicker', function (e) {
390
- var dateStr = jQuery('#b2s-change-date').val();
391
- var minStr = jQuery(this).val();
392
- if (jQuery('#b2sLang').val() == 'de') {
393
- dateStr = dateStr.substring(6, 10) + '-' + dateStr.substring(3, 5) + '-' + dateStr.substring(0, 2);
394
- } else {
395
- var minParts = minStr.split(' ');
396
- var minParts2 = minParts[0].split(':');
397
- if (minParts[1] == 'PM') {
398
- minParts2[0] = parseInt(minParts2[0]) + 12;
399
- }
400
- minStr = minParts2[0] + ':' + minParts2[1];
401
- }
402
- var dateObj = new Date();
403
- dateObj.setTime(jQuery('#b2s-data-blog-sched-date').val());
404
- if (Date.parse(dateStr + ' ' + minStr + ':00') <= Date.parse(dateObj.getUTCFullYear() + '-' + (dateObj.getUTCMonth() + 1) + '-' + dateObj.getUTCDate() + ' ' + dateObj.getUTCHours() + ':' + dateObj.getUTCMinutes() + ':00')) {
405
- //date in past
406
- if (dateObj.getUTCMinutes() >= 30) {
407
- jQuery(this).timepicker('setTime', (dateObj.getUTCHours() + 1) + ':00');
408
- } else {
409
- jQuery(this).timepicker('setTime', (dateObj.getUTCHours()) + ':30');
410
- }
411
- }
412
});
413
}
414
415
jQuery(document).on('click', '.b2s-post-sched-area-edittime-btn', function () {
@@ -483,7 +493,7 @@ function showFilter(typ) {
483
function getB2SSchedDatepicker() {
484
485
var language = "en";
486
- if (jQuery('#b2sLang').val() == "de") {
487
language = "de";
488
}
489
var sched_dates = JSON.parse(jQuery('#b2sCalendarSchedDates').val());
@@ -522,4 +532,47 @@ function getB2SSchedDatepicker() {
522
523
function padDate(n) {
524
return ("0" + n).slice(-2);
525
- }
179
'action': 'b2s_sched_post_data',
180
'postId': postId,
181
'showByDate': showByDate,
182
+ 'userAuthId': userAuthId
183
},
184
error: function () {
185
jQuery('.b2s-server-connection-fail').show();
339
var dateFormat = "yyyy-mm-dd";
340
var language = "en";
341
var showMeridian = true;
342
+ if (jQuery('#b2sUserLang').val() == "de") {
343
dateFormat = "dd.mm.yyyy";
344
language = "de";
345
showMeridian = false;
355
calendarWeeks: true,
356
autoclose: true
357
});
358
+
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
391
defaultTime: 'current',
392
snapToStep: true
393
});
394
+
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 () {
493
function getB2SSchedDatepicker() {
494
495
var language = "en";
496
+ if (jQuery('#b2sUserLang').val() == "de") {
497
language = "de";
498
}
499
var sched_dates = JSON.parse(jQuery('#b2sCalendarSchedDates').val());
532
533
function padDate(n) {
534
return ("0" + n).slice(-2);
535
+ }
536
+
537
+
538
+ function checkSchedDateTime() {
539
+ var dateElement = '#b2s-change-date';
540
+ var timeElement = '#b2s-change-time';
541
+ var dateStr = jQuery(dateElement).val();
542
+ var minStr = jQuery(timeElement).val();
543
+ var timeZone = parseInt(jQuery('#user_timezone').val()) * (-1);
544
+
545
+ if (jQuery('#b2sUserLang').val() == 'de') {
546
+ dateStr = dateStr.substring(6, 10) + '-' + dateStr.substring(3, 5) + '-' + dateStr.substring(0, 2);
547
+ } else {
548
+ var minParts = minStr.split(' ');
549
+ var minParts2 = minParts[0].split(':');
550
+ if (minParts[1] == 'PM') {
551
+ minParts2[0] = parseInt(minParts2[0]) + 12;
552
+ }
553
+ minStr = minParts2[0] + ':' + minParts2[1];
554
+ }
555
+
556
+ var minParts3 = minStr.split(':');
557
+ if (minParts3[0] < 10) {
558
+ minParts3[0] = '0' + minParts3[0];
559
+ }
560
+ var dateParts = dateStr.split('-');
561
+
562
+ //utc current time
563
+ var now = new Date();
564
+ //offset between utc und user
565
+ var offset = (parseInt(now.getTimezoneOffset()) / 60) * (-1);
566
+ //enter hour to user time
567
+ var hour = parseInt(minParts3[0]) + timeZone + offset;
568
+ //calculate datetime in utc
569
+ var enter = new Date(dateParts[0], dateParts[1] - 1, dateParts[2], hour, minParts3[1]);
570
+ //compare enter date time with allowed user time
571
+ if (enter.getTime() < now.getTime()) {
572
+ //enter set on next 15 minutes and calculate on user timezone
573
+ enter.setTime(now.getTime() + (900000 - (now.getTime() % 900000)) - (3600000 * (timeZone + offset)));
574
+ jQuery(dateElement).datepicker('update', enter);
575
+ jQuery(timeElement).timepicker('setTime', enter);
576
+ }
577
+ }
578
+
assets/js/b2s/settings.js CHANGED
@@ -2,7 +2,7 @@ jQuery.noConflict();
2
jQuery(window).on("load", function () {
3
4
var showMeridian = true;
5
- if (jQuery('#b2sLang').val() == 'de') {
6
showMeridian = false;
7
}
8
jQuery('.b2s-settings-sched-item-input-time').timepicker({
@@ -18,6 +18,121 @@ jQuery(window).on("load", function () {
18
}
19
20
});
21
jQuery(document).on('click', '.b2s-save-settings-pro-info', function () {
22
return false;
23
});
@@ -146,7 +261,7 @@ jQuery(document).on('click', '.b2s-post-type-select-btn', function () {
146
147
148
jQuery(document).on('change', '#b2s-user-time-zone', function () {
149
- var curUserTime = calcCurrentExternTimeByOffset(jQuery('option:selected', this).attr('data-offset'), jQuery('#b2sLang').val());
150
jQuery('#b2s-user-time').text(curUserTime);
151
152
jQuery('.b2s-settings-user-success').hide();
@@ -297,42 +412,42 @@ jQuery('.b2sSaveUserSettingsPostFormatTw').validate({
297
298
299
/*jQuery(document).on('change', '.b2s-user-network-settings-post-format', function () {
300
- jQuery('.b2s-settings-user-success').hide();
301
- jQuery('.b2s-settings-user-error').hide();
302
- jQuery('.b2s-server-connection-fail').hide();
303
- jQuery(".b2s-loading-area").show();
304
- jQuery(".b2s-user-settings-area").hide();
305
-
306
- var networkId = jQuery(this).attr("data-network-id");
307
- jQuery('.b2s-user-network-settings-post-format[data-network-id="' + networkId + '"]').removeClass('b2s-settings-checked');
308
- jQuery(this).addClass('b2s-settings-checked');
309
-
310
- jQuery.ajax({
311
- url: ajaxurl,
312
- type: "POST",
313
- dataType: "json",
314
- cache: false,
315
- data: {
316
- 'action': 'b2s_user_network_settings',
317
- 'post_format': jQuery(this).val(),
318
- 'network_id': networkId
319
- },
320
- error: function () {
321
- jQuery('.b2s-server-connection-fail').show();
322
- return false;
323
- },
324
- success: function (data) {
325
- jQuery(".b2s-loading-area").hide();
326
- jQuery(".b2s-user-settings-area").show();
327
- if (data.result == true) {
328
- jQuery('.b2s-settings-user-success').show();
329
- } else {
330
- jQuery('.b2s-settings-user-error').show();
331
- }
332
- }
333
- });
334
- return false;
335
- });*/
336
337
jQuery(document).on('click', '.b2s-get-settings-sched-time-default', function () {
338
jQuery('.b2s-server-connection-fail').hide();
2
jQuery(window).on("load", function () {
3
4
var showMeridian = true;
5
+ if (jQuery('#b2sUserLang').val() == 'de') {
6
showMeridian = false;
7
}
8
jQuery('.b2s-settings-sched-item-input-time').timepicker({
18
}
19
20
});
21
+
22
+
23
+ jQuery('.b2sSaveSocialMetaTagsSettings').validate({
24
+ ignore: "",
25
+ errorPlacement: function () {
26
+ return false;
27
+ },
28
+ submitHandler: function (form) {
29
+ jQuery('.b2s-settings-user-success').hide();
30
+ jQuery('.b2s-settings-user-error').hide();
31
+ jQuery(".b2s-loading-area").show();
32
+ jQuery(".b2s-user-settings-area").hide();
33
+ jQuery('.b2s-server-connection-fail').hide();
34
+ jQuery('.b2s-meta-tags-success').hide();
35
+ jQuery('.b2s-meta-tags-danger').hide();
36
+ jQuery.ajax({
37
+ processData: false,
38
+ url: ajaxurl,
39
+ type: "POST",
40
+ dataType: "json",
41
+ cache: false,
42
+ data: jQuery(form).serialize(),
43
+ error: function () {
44
+ jQuery('.b2s-server-connection-fail').show();
45
+ return false;
46
+ },
47
+ success: function (data) {
48
+ jQuery(".b2s-loading-area").hide();
49
+ jQuery(".b2s-user-settings-area").show();
50
+ if (data.result == true) {
51
+ jQuery('.b2s-settings-user-success').show();
52
+ if (data.b2s == true) {
53
+ if (data.yoast == true) {
54
+ jQuery('.b2s-meta-tags-yoast').show();
55
+ }
56
+ if (data.aioseop) {
57
+ jQuery('.b2s-meta-tags-aioseop').show();
58
+ }
59
+ if (data.webdados) {
60
+ jQuery('.b2s-meta-tags-webdados').show();
61
+ }
62
+ }
63
+ } else {
64
+ jQuery('.b2s-settings-user-error').show();
65
+ }
66
+ }
67
+ });
68
+ return false;
69
+ }
70
+ });
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();
78
+ jQuery(".b2s-loading-area").show();
79
+ jQuery(".b2s-user-settings-area").hide();
80
+ jQuery('.b2s-server-connection-fail').hide();
81
+ jQuery.ajax({
82
+ url: ajaxurl,
83
+ type: "POST",
84
+ dataType: "json",
85
+ cache: false,
86
+ data: {
87
+ 'action': 'b2s_reset_social_meta_tags',
88
+ },
89
+ error: function () {
90
+ jQuery('.b2s-server-connection-fail').show();
91
+ return false;
92
+ },
93
+ success: function (data) {
94
+ jQuery(".b2s-loading-area").hide();
95
+ jQuery(".b2s-user-settings-area").show();
96
+ if (data.result == true) {
97
+ jQuery('.b2s-clear-meta-tags-success').show();
98
+ } else {
99
+ jQuery('.b2s-clear-meta-tags-error').show();
100
+ }
101
+ }
102
+ });
103
+ return false;
104
+ });
105
+
106
+
107
+
108
+ jQuery(document).on('click', '.b2s-upload-image', function () {
109
+ var targetId = jQuery(this).attr('data-id');
110
+ if (typeof wp !== 'undefined' && wp.media && wp.media.editor) {
111
+ wpMedia = wp.media({
112
+ title: jQuery('#b2s_wp_media_headline').val(),
113
+ button: {
114
+ text: jQuery('#b2s_wp_media_btn').val(),
115
+ },
116
+ multiple: false,
117
+ library: {type: 'image'}
118
+ });
119
+ wpMedia.open();
120
+
121
+ wpMedia.on('select', function () {
122
+ var validExtensions = ['jpg', 'jpeg', 'png'];
123
+ var attachment = wpMedia.state().get('selection').first().toJSON();
124
+
125
+ jQuery('#' + targetId).val(attachment.url);
126
+ });
127
+ } else {
128
+ jQuery('.b2s-upload-image-no-permission').show();
129
+ }
130
+ return false;
131
+ });
132
+
133
+
134
+
135
+
136
jQuery(document).on('click', '.b2s-save-settings-pro-info', function () {
137
return false;
138
});
261
262
263
jQuery(document).on('change', '#b2s-user-time-zone', function () {
264
+ var curUserTime = calcCurrentExternTimeByOffset(jQuery('option:selected', this).attr('data-offset'), jQuery('#b2sUserLang').val());
265
jQuery('#b2s-user-time').text(curUserTime);
266
267
jQuery('.b2s-settings-user-success').hide();
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();
417
+ jQuery('.b2s-server-connection-fail').hide();
418
+ jQuery(".b2s-loading-area").show();
419
+ jQuery(".b2s-user-settings-area").hide();
420
+
421
+ var networkId = jQuery(this).attr("data-network-id");
422
+ jQuery('.b2s-user-network-settings-post-format[data-network-id="' + networkId + '"]').removeClass('b2s-settings-checked');
423
+ jQuery(this).addClass('b2s-settings-checked');
424
+
425
+ jQuery.ajax({
426
+ url: ajaxurl,
427
+ type: "POST",
428
+ dataType: "json",
429
+ cache: false,
430
+ data: {
431
+ 'action': 'b2s_user_network_settings',
432
+ 'post_format': jQuery(this).val(),
433
+ 'network_id': networkId
434
+ },
435
+ error: function () {
436
+ jQuery('.b2s-server-connection-fail').show();
437
+ return false;
438
+ },
439
+ success: function (data) {
440
+ jQuery(".b2s-loading-area").hide();
441
+ jQuery(".b2s-user-settings-area").show();
442
+ if (data.result == true) {
443
+ jQuery('.b2s-settings-user-success').show();
444
+ } else {
445
+ jQuery('.b2s-settings-user-error').show();
446
+ }
447
+ }
448
+ });
449
+ return false;
450
+ });*/
451
452
jQuery(document).on('click', '.b2s-get-settings-sched-time-default', function () {
453
jQuery('.b2s-server-connection-fail').hide();
assets/js/b2s/ship.js CHANGED
@@ -54,6 +54,25 @@ jQuery.sceditor.command.set(
54
jQuery.sceditor.command.set(
55
"custom-image", {
56
exec: function () {
57
var networkAuthId = jQuery(this.getContentAreaContainer()).parents('.b2s-post-item-details').find('.b2s-post-item-details-network-display-name').attr('data-network-auth-id');
58
jQuery('.b2s-image-change-this-network').attr('data-network-auth-id', networkAuthId);
59
jQuery('.b2s-upload-image').attr('data-network-auth-id', networkAuthId);
@@ -62,6 +81,7 @@ jQuery.sceditor.command.set(
62
jQuery('#b2s-network-select-image').modal('show');
63
jQuery('#b2sInsertImageType').val("1");
64
imageSize();
65
},
66
txtExec: function () {
67
var networkAuthId = jQuery(this.getContentAreaContainer()).parents('.b2s-post-item-details').find('.b2s-post-item-details-network-display-name').attr('data-network-auth-id');
@@ -108,7 +128,7 @@ jQuery(document).on('click', '.b2s-get-settings-sched-time-default', function ()
108
var todayDate = ("0" + today.getDate()).slice(-2);
109
var dateToday = today.getFullYear() + "-" + todayMonth + "-" + todayDate;
110
111
- var lang = jQuery('#b2sLang').val();
112
if (lang == "de") {
113
dateTomorrow = tomorrowDate + "." + tomorrowMonth + "." + tomorrow.getFullYear();
114
dateToday = todayDate + "." + todayMonth + "." + today.getFullYear();
@@ -121,7 +141,7 @@ jQuery(document).on('click', '.b2s-get-settings-sched-time-default', function ()
121
jQuery('.b2s-post-item-details-release-input-date-select[data-network-id="' + network_id + '"][data-network-type="' + count + '"]').val('1').trigger("change");
122
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);
123
var hours = network_type_time.substring(0, 2);
124
- if (lang != 'de') {
125
var timeparts = network_type_time.split(' ');
126
hours = (timeparts[1] == 'AM') ? hours : (parseInt(hours) + 12);
127
}
@@ -141,6 +161,41 @@ jQuery(document).on('click', '.b2s-get-settings-sched-time-default', function ()
141
return false;
142
});
143
144
jQuery(document).on('click', '.b2s-get-settings-sched-time-user', function () {
145
jQuery('.b2s-server-connection-fail').hide();
146
jQuery.ajax({
@@ -175,7 +230,7 @@ jQuery(document).on('click', '.b2s-get-settings-sched-time-user', function () {
175
var todayDate = ("0" + today.getDate()).slice(-2);
176
var dateToday = today.getFullYear() + "-" + todayMonth + "-" + todayDate;
177
178
- var lang = jQuery('#b2sLang').val();
179
if (lang == "de") {
180
dateTomorrow = tomorrowDate + "." + tomorrowMonth + "." + tomorrow.getFullYear();
181
dateToday = todayDate + "." + todayMonth + "." + today.getFullYear();
@@ -188,7 +243,7 @@ jQuery(document).on('click', '.b2s-get-settings-sched-time-user', function () {
188
jQuery('.b2s-post-item-details-release-input-date-select[data-network-id="' + network_id + '"][data-network-type="' + count + '"]').val('1').trigger("change");
189
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);
190
var hours = network_type_time.substring(0, 2);
191
- if (lang != 'de') {
192
var timeparts = network_type_time.split(' ');
193
hours = (timeparts[1] == 'AM') ? hours : (parseInt(hours) + 12);
194
}
@@ -255,11 +310,11 @@ jQuery(document).on('click', '.b2s-post-item-details-release-area-sched-for-all'
255
if (dataNetworkCount == 2) {
256
jQuery('.b2s-post-item-details-release-input-add[data-network-count="0"]').hide();
257
jQuery('.b2s-post-item-details-release-input-add[data-network-count="1"]').hide();
258
- jQuery('.b2s-post-item-details-release-input-hide[data-network-count="1"').hide();
259
- jQuery('.b2s-post-item-details-release-input-hide[data-network-count="2"').show();
260
} else if (dataNetworkCount == 1) {
261
jQuery('.b2s-post-item-details-release-input-add[data-network-count="0"]').hide();
262
- jQuery('.b2s-post-item-details-release-input-hide[data-network-count="1"').show();
263
}
264
}
265
@@ -275,38 +330,85 @@ jQuery(document).on("click", ".b2s-user-network-settings-post-format", function
275
var networkId = jQuery(this).attr("data-network-id");
276
var networkType = jQuery(this).attr("data-network-type");
277
var postFormat = jQuery(this).val();
278
279
jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').val(postFormat);
280
//PostFormat
281
if (jQuery('.b2s-post-ship-item-post-format-text[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').length > 0) {
282
var postFormatText = JSON.parse(jQuery('.b2sNetworkSettingsPostFormatText').val());
283
if (jQuery('#user_version').val() >= 2) {
284
- jQuery('.b2s-post-ship-item-post-format-text[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').html(postFormatText[postFormat]);
285
- jQuery('.b2s-post-item-details-post-format[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').val(postFormat);
286
} else {
287
jQuery('.b2s-post-ship-item-post-format-text[data-network-id="' + networkId + '"]').html(postFormatText[postFormat]);
288
jQuery('.b2s-post-item-details-post-format[data-network-id="' + networkId + '"]').val(postFormat);
289
}
290
}
291
- //Change View For Twitter
292
- if (postFormat == '0' && networkId == '2') {
293
- jQuery('.b2s-image-remove-btn[data-network-id="' + networkId + '"]').hide();
294
- jQuery('.b2s-select-image-modal-open[data-network-id="' + networkId + '"]').hide();
295
- jQuery('.b2s-post-item-details-preview-url-reload[data-network-id="' + networkId + '"]').trigger("click");
296
- }
297
- if (postFormat == '1' && networkId == '2') {
298
- jQuery('.b2s-image-remove-btn[data-network-id="' + networkId + '"]').show();
299
- jQuery('.b2s-select-image-modal-open[data-network-id="' + networkId + '"]').show();
300
- if (jQuery('#b2s_blog_default_image').val() != "") {
301
- jQuery('.b2s-post-item-details-url-image[data-network-id="' + networkId + '"]').attr('src', jQuery('#b2s_blog_default_image').val());
302
- jQuery('.b2s-image-url-hidden-field[data-network-id="' + networkId + '"]').val(jQuery('#b2s_blog_default_image').val());
303
}
304
}
305
306
jQuery('.b2s-user-network-settings-post-format[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').removeClass('b2s-settings-checked');
307
jQuery(this).addClass('b2s-settings-checked');
308
jQuery('#b2s-post-ship-item-post-format-modal').modal('hide');
309
-
310
return false;
311
});
312
@@ -363,8 +465,53 @@ jQuery(document).on("click", ".b2s-network-select-btn", function () {
363
if (jQuery('.b2s-post-ship-item-post-format-text[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').length > 0) {
364
var postFormatText = JSON.parse(jQuery('.b2sNetworkSettingsPostFormatText').val());
365
if (jQuery('#user_version').val() >= 2) {
366
- jQuery('.b2s-post-ship-item-post-format-text[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').html(postFormatText[jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').val()]);
367
- jQuery('.b2s-post-item-details-post-format[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').val(jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').val());
368
} else {
369
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()]);
370
jQuery('.b2s-post-item-details-post-format[data-network-id="' + networkId + '"]').val(jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').val());
@@ -437,7 +584,7 @@ jQuery(document).on("click", ".b2s-network-select-btn", function () {
437
var dateFormat = "yyyy-mm-dd";
438
var language = "en";
439
var showMeridian = true;
440
- if (jQuery('#b2sLang').val() == "de") {
441
dateFormat = "dd.mm.yyyy";
442
language = "de";
443
showMeridian = false;
@@ -464,65 +611,76 @@ jQuery(document).on("click", ".b2s-network-select-btn", function () {
464
snapToStep: true
465
});
466
467
- jQuery(".b2s-post-item-details-release-input-date").datepicker().on('changeDate', function (e) {
468
- var element = '.b2s-post-item-details-release-input-time[data-network-auth-id="' + jQuery(this).attr('data-network-auth-id') + '"]';
469
- var dateStr = jQuery(this).val();
470
- var minStr = jQuery(element).val();
471
- if (jQuery('#b2sLang').val() == 'de') {
472
- dateStr = dateStr.substring(6, 10) + '-' + dateStr.substring(3, 5) + '-' + dateStr.substring(0, 2);
473
- } else {
474
- var minParts = minStr.split(' ');
475
- var minParts2 = minParts[0].split(':');
476
- if (minParts[1] == 'PM') {
477
- minParts2[0] = parseInt(minParts2[0]) + 12;
478
- }
479
- minStr = minParts2[0] + ':' + minParts2[1];
480
- }
481
- var dateObj = new Date();
482
- if (jQuery('#b2sBlogPostSchedDate').length > 0) {
483
- dateObj.setTime(jQuery('#b2sBlogPostSchedDate').val());
484
- }
485
486
- if (Date.parse(dateStr + ' ' + minStr + ':00') <= Date.parse(dateObj.getUTCFullYear() + '-' + (dateObj.getUTCMonth() + 1) + '-' + dateObj.getUTCDate() + ' ' + dateObj.getUTCHours() + ':' + dateObj.getUTCMinutes() + ':00')) {
487
- //date in past
488
- if (dateObj.getUTCMinutes() >= 30) {
489
- jQuery(element).timepicker('setTime', (dateObj.getUTCHours() + 1) + ':00');
490
- } else {
491
- jQuery(element).timepicker('setTime', (dateObj.getUTCHours()) + ':30');
492
- }
493
- }
494
});
495
-
496
jQuery('.b2s-post-item-details-release-input-time').timepicker().on('changeTime.timepicker', function (e) {
497
- var dataNetworkAuthId = jQuery(this).attr('data-network-auth-id');
498
- if (jQuery('.b2s-post-item-details-release-input-date-select[data-network-auth-id="' + dataNetworkAuthId + '"]').val() == "1") {
499
- var dateStr = jQuery('.b2s-post-item-details-release-input-date[data-network-auth-id="' + jQuery(this).attr('data-network-auth-id') + '"]').val();
500
- var minStr = jQuery(this).val();
501
- if (jQuery('#b2sLang').val() == 'de') {
502
- dateStr = dateStr.substring(6, 10) + '-' + dateStr.substring(3, 5) + '-' + dateStr.substring(0, 2);
503
- } else {
504
- var minParts = minStr.split(' ');
505
- var minParts2 = minParts[0].split(':');
506
- if (minParts[1] == 'PM') {
507
- minParts2[0] = parseInt(minParts2[0]) + 12;
508
- }
509
- minStr = minParts2[0] + ':' + minParts2[1];
510
- }
511
- var dateObj = new Date();
512
- if (jQuery('#b2sBlogPostSchedDate').length > 0) {
513
- dateObj.setTime(jQuery('#b2sBlogPostSchedDate').val());
514
- }
515
516
- if (Date.parse(dateStr + ' ' + minStr + ':00') <= Date.parse(dateObj.getUTCFullYear() + '-' + (dateObj.getUTCMonth() + 1) + '-' + dateObj.getUTCDate() + ' ' + dateObj.getUTCHours() + ':' + dateObj.getUTCMinutes() + ':00')) {
517
- //date in past
518
- if (dateObj.getUTCMinutes() >= 30) {
519
- jQuery(this).timepicker('setTime', (dateObj.getUTCHours() + 1) + ':00');
520
- } else {
521
- jQuery(this).timepicker('setTime', (dateObj.getUTCHours()) + ':30');
522
- }
523
- }
524
- }
525
});
526
//Check Text Limit
527
var textLimit = jQuery('.b2s-post-item-details-item-message-input[data-network-auth-id="' + data.networkAuthId + '"]').attr('data-network-text-limit');
528
if (textLimit != "0") {
@@ -548,18 +706,64 @@ jQuery(document).on("click", ".b2s-network-select-btn", function () {
548
if (jQuery('.b2s-post-ship-item-post-format-text[data-network-type="' + data.networkType + '"][data-network-id="' + data.networkId + '"]').length > 0) {
549
var postFormatText = JSON.parse(jQuery('.b2sNetworkSettingsPostFormatText').val());
550
if (jQuery('#user_version').val() >= 2) {
551
- 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()]);
552
- 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());
553
} else {
554
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()]);
555
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());
556
}
557
//Change View For Twitter
558
- if (jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-id="' + data.networkId + '"]').val() == '0' && data.networkId == '2') {
559
- jQuery('.b2s-image-remove-btn[data-network-id="' + data.networkId + '"]').hide();
560
- jQuery('.b2s-select-image-modal-open[data-network-id="' + data.networkId + '"]').hide();
561
- jQuery('.b2s-post-item-details-preview-url-reload[data-network-id="' + data.networkId + '"]').trigger("click");
562
- }
563
}
564
}
565
}
@@ -595,6 +799,7 @@ jQuery(document).on('click', '.b2s-post-ship-item-post-format', function () {
595
jQuery('.b2s-post-format-settings-info').hide();
596
jQuery('.b2s-post-format-settings-info[data-network-id="' + jQuery(this).attr('data-network-id') + '"]').show();
597
jQuery('#b2s-post-ship-item-post-format-modal').modal('show');
598
} else {
599
jQuery('#b2sInfoFormatModal').modal('show');
600
}
@@ -652,33 +857,35 @@ jQuery(document).on('change', '.b2s-post-item-details-release-input-date-select'
652
jQuery('#b2s-sched-post-modal').modal('show');
653
return false;
654
} else {
655
//Überprüfen ob Zeit in der Vergangenheit
656
- var dateStr = jQuery('.b2s-post-item-details-release-input-date[data-network-auth-id="' + jQuery(this).attr('data-network-auth-id') + '"]').val();
657
- var minStr = jQuery('.b2s-post-item-details-release-input-time[data-network-auth-id="' + jQuery(this).attr('data-network-auth-id') + '"]').val();
658
- if (dateStr !== undefined && minStr !== undefined) {
659
- if (jQuery('#b2sLang').val() == 'de') {
660
- dateStr = dateStr.substring(6, 10) + '-' + dateStr.substring(3, 5) + '-' + dateStr.substring(0, 2);
661
- } else {
662
- var minParts = minStr.split(' ');
663
- var minParts2 = minParts[0].split(':');
664
- if (minParts[1] == 'PM') {
665
- minParts2[0] = parseInt(minParts2[0]) + 12;
666
- }
667
- minStr = minParts2[0] + ':' + minParts2[1];
668
- }
669
- var dateObj = new Date();
670
- if (jQuery('#b2sBlogPostSchedDate').length > 0) {
671
- dateObj.setTime(jQuery('#b2sBlogPostSchedDate').val());
672
- }
673
- if (Date.parse(dateStr + ' ' + minStr + ':00') <= Date.parse(dateObj.getUTCFullYear() + '-' + (dateObj.getUTCMonth() + 1) + '-' + dateObj.getUTCDate() + ' ' + dateObj.getUTCHours() + ':' + dateObj.getUTCMinutes() + ':00')) {
674
- //date in past
675
- if (dateObj.getUTCMinutes() >= 30) {
676
- jQuery('.b2s-post-item-details-release-input-time[data-network-auth-id="' + jQuery(this).attr('data-network-auth-id') + '"]').timepicker('setTime', (dateObj.getUTCHours() + 1) + ':00');
677
- } else {
678
- jQuery('.b2s-post-item-details-release-input-time[data-network-auth-id="' + jQuery(this).attr('data-network-auth-id') + '"]').timepicker('setTime', (dateObj.getUTCHours()) + ':30');
679
- }
680
- }
681
- }
682
}
683
}
684
releaseChoose(jQuery(this).val(), jQuery(this).attr('data-network-auth-id'), dataNetworkCount);
@@ -799,8 +1006,14 @@ jQuery(document).on('click', '.b2s-post-item-details-preview-url-reload', functi
799
success: function (data) {
800
jQuery('.b2s-post-item-details-preview-url-reload[data-network-auth-id="' + data.networkAuthId + '"]').removeClass('glyphicon-refresh-animate');
801
if (data.result == true) {
802
- jQuery('.b2s-post-item-details-preview-title[data-network-auth-id="' + data.networkAuthId + '"]').html(data.title);
803
- jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + data.networkAuthId + '"]').html(data.description);
804
if (jQuery('.b2s-post-item-details-url-image[data-network-auth-id="' + data.networkAuthId + '"]').attr('data-network-image-change') == '0') {
805
jQuery('.b2s-post-item-details-url-image[data-network-auth-id="' + data.networkAuthId + '"]').attr('src', data.image);
806
}
@@ -822,41 +1035,96 @@ jQuery(document).on('click', '.b2s-post-item-details-preview-url-reload', functi
822
});
823
824
jQuery(document).on('click', '.b2s-select-image-modal-open', function () {
825
var authId = jQuery(this).attr('data-network-auth-id');
826
jQuery('.b2s-image-change-this-network').attr('data-network-auth-id', authId);
827
jQuery('.b2s-upload-image').attr('data-network-auth-id', authId);
828
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();
829
jQuery('.b2s-selected-network-for-image-info').html(content);
830
jQuery('#b2sInsertImageType').val("0");
831
jQuery('#b2s-network-select-image').modal('show');
832
imageSize();
833
return false;
834
});
835
836
jQuery(document).on('click', '.b2s-image-remove-btn', function () {
837
- jQuery('.b2s-post-item-details-url-image[data-network-auth-id="' + jQuery(this).attr('data-network-auth-id') + '"]').attr('src', jQuery('#b2sDefaultNoImage').val());
838
- jQuery('.b2s-image-url-hidden-field[data-network-auth-id="' + jQuery(this).attr('data-network-auth-id') + '"]').val("");
839
- jQuery('.b2s-image-remove-btn[data-network-auth-id="' + jQuery(this).attr('data-network-auth-id') + '"]').hide();
840
return false;
841
});
842
843
jQuery(document).on('click', '.b2s-image-change-this-network', function () {
844
-
845
if (jQuery('#b2sInsertImageType').val() == '1') { //HTML-Network
846
- var sceditor = jQuery('.b2s-post-item-details-item-message-input-allow-html[data-network-auth-id="' + jQuery(this).attr('data-network-auth-id') + '"]').sceditor('instance');
847
- sceditor.insert("<br /><img src='" + jQuery('input[name=image_url]:checked').val() + "'/><br />");
848
- jQuery('.b2s-image-url-hidden-field[data-network-auth-id="' + jQuery(this).attr('data-network-auth-id') + '"]').val(jQuery('input[name=image_url]:checked').val()); //Torial
849
850
} else {
851
- jQuery('.b2s-post-item-details-url-image[data-network-auth-id="' + jQuery(this).attr('data-network-auth-id') + '"]').attr('src', jQuery('input[name=image_url]:checked').val());
852
- jQuery('.b2s-post-item-details-url-image[data-network-auth-id="' + jQuery(this).attr('data-network-auth-id') + '"]').removeClass('b2s-img-required');
853
- jQuery('.b2s-image-url-hidden-field[data-network-auth-id="' + jQuery(this).attr('data-network-auth-id') + '"]').val(jQuery('input[name=image_url]:checked').val());
854
- jQuery('.b2s-image-remove-btn[data-network-auth-id="' + jQuery(this).attr('data-network-auth-id') + '"]').show();
855
}
856
jQuery('.b2s-upload-image-invalid-extension').hide();
857
jQuery('.b2s-upload-image-no-permission').hide();
858
jQuery('.b2s-upload-image-free-version-info').hide();
859
jQuery('#b2s-network-select-image').modal('hide');
860
});
861
862
jQuery(document).on('click', '.b2s-image-change-all-network', function () {
@@ -878,7 +1146,12 @@ jQuery(document).on('click', '.b2s-image-change-all-network', function () {
878
jQuery('.b2s-upload-image-invalid-extension').hide();
879
jQuery('.b2s-upload-image-no-permission').hide();
880
jQuery('.b2s-upload-image-free-version-info').hide();
881
jQuery('#b2s-network-select-image').modal('hide');
882
});
883
884
jQuery(document).on('click', '.b2s-upload-image', function () {
@@ -1101,7 +1374,7 @@ jQuery('#b2s-network-list-modal').on('show.bs.modal', function (e) {
1101
1102
jQuery(window).on("load", function () {
1103
var showMeridian = true;
1104
- if (jQuery('#b2sLang').val() == 'de') {
1105
showMeridian = false;
1106
}
1107
jQuery('.b2s-settings-sched-item-input-time').timepicker({
@@ -1275,7 +1548,7 @@ function init(firstrun) {
1275
var dateFormat = "yyyy-mm-dd";
1276
var language = "en";
1277
var showMeridian = true;
1278
- if (jQuery('#b2sLang').val() == "de") {
1279
dateFormat = "dd.mm.yyyy";
1280
language = "de";
1281
showMeridian = false;
@@ -1361,6 +1634,13 @@ function imageSize() {
1361
var width = this.naturalWidth;
1362
var height = this.naturalHeight;
1363
jQuery(this).parents('.b2s-image-item').find('.b2s-image-item-caption-resolution').html(width + 'x' + height);
1364
});
1365
}
1366
@@ -1545,7 +1825,7 @@ function releaseChoose(choose, dataNetworkAuthId, dataNetworkCount) {
1545
}
1546
1547
var showMeridian = true;
1548
- if (jQuery('#b2sLang').val() == 'de') {
1549
showMeridian = false;
1550
}
1551
@@ -1764,4 +2044,46 @@ function loginSuccess(networkId, networkType, displayName, networkAuthId, mandan
1764
jQuery('.b2s-network-select-btn[data-network-auth-id="' + networkAuthId + '"]').removeAttr('onclick');
1765
jQuery('.b2s-network-select-btn[data-network-auth-id="' + networkAuthId + '"]').trigger('click');
1766
}
1767
- }
54
jQuery.sceditor.command.set(
55
"custom-image", {
56
exec: function () {
57
+ var me = this;
58
+ if (typeof (b2s_is_calendar) != "undefined" && b2s_is_calendar)
59
+ {
60
+ jQuery('.b2s-network-select-image-content').html("");
61
+ jQuery.ajax({
62
+ url: ajaxurl,
63
+ type: "POST",
64
+ cache: false,
65
+ async: false,
66
+ data: {
67
+ 'action': 'b2s_get_image_modal',
68
+ 'id': b2s_current_post_id,
69
+ 'image_url': ''
70
+ },
71
+ success: function (data) {
72
+ jQuery(".b2s-network-select-image-content").html(data);
73
+ }
74
+ });
75
+ }
76
var networkAuthId = jQuery(this.getContentAreaContainer()).parents('.b2s-post-item-details').find('.b2s-post-item-details-network-display-name').attr('data-network-auth-id');
77
jQuery('.b2s-image-change-this-network').attr('data-network-auth-id', networkAuthId);
78
jQuery('.b2s-upload-image').attr('data-network-auth-id', networkAuthId);
81
jQuery('#b2s-network-select-image').modal('show');
82
jQuery('#b2sInsertImageType').val("1");
83
imageSize();
84
+
85
},
86
txtExec: function () {
87
var networkAuthId = jQuery(this.getContentAreaContainer()).parents('.b2s-post-item-details').find('.b2s-post-item-details-network-display-name').attr('data-network-auth-id');
128
var todayDate = ("0" + today.getDate()).slice(-2);
129
var dateToday = today.getFullYear() + "-" + todayMonth + "-" + todayDate;
130
131
+ var lang = jQuery('#b2sUserLang').val();
132
if (lang == "de") {
133
dateTomorrow = tomorrowDate + "." + tomorrowMonth + "." + tomorrow.getFullYear();
134
dateToday = todayDate + "." + todayMonth + "." + today.getFullYear();
141
jQuery('.b2s-post-item-details-release-input-date-select[data-network-id="' + network_id + '"][data-network-type="' + count + '"]').val('1').trigger("change");
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
hours = (timeparts[1] == 'AM') ? hours : (parseInt(hours) + 12);
147
}
161
return false;
162
});
163
164
+
165
+ jQuery(document).on('click', '.b2s-sidbar-network-auth-btn', function () {
166
+ jQuery('#b2s-network-list-modal').modal('show');
167
+ return false;
168
+ });
169
+
170
+ jQuery(document).on('click', '.change-meta-tag', function () {
171
+ var attr = jQuery(this).attr('readonly');
172
+ if (typeof attr !== typeof undefined && attr !== false) {
173
+ jQuery('#b2s-info-change-meta-tag-modal').modal('show');
174
+ }
175
+ return false;
176
+ });
177
+
178
+ // Linkpost change Meta Tags title + desc
179
+ jQuery(document).on('keyup', '.change-meta-tag', function () {
180
+ var currentText = jQuery(this).val();
181
+ var metaTag = jQuery(this).attr('data-meta');
182
+ var networkAuthId = jQuery(this).attr('data-network-auth-id');
183
+ var postFormat = jQuery('.b2s-post-item-details-post-format[data-network-auth-id=' + networkAuthId + ']').val();
184
+ var networkId = jQuery('.b2s-post-item-details-post-format[data-network-auth-id=' + networkAuthId + ']').attr('data-network-id');
185
+ if (typeof postFormat !== typeof undefined && postFormat !== false) {
186
+ if (postFormat == "0") { //if linkpost
187
+ jQuery('.b2s-post-item-details-post-format[data-network-id=' + networkId + ']').each(function () {
188
+ if (jQuery(this).val() == "0" && jQuery('.b2s-post-ship-item-post-format[data-network-auth-id=' + jQuery(this).attr('data-network-auth-id') + ']').is(":visible") && jQuery(this).attr('data-network-auth-id') != networkAuthId) { //other Linkpost by same network
189
+ //override this content with current content by keyup
190
+ jQuery('.' + metaTag + '[data-network-auth-id=' + jQuery(this).attr('data-network-auth-id') + ']').val(currentText);
191
+ }
192
+ });
193
+ }
194
+ }
195
+ return false;
196
+ });
197
+
198
+
199
jQuery(document).on('click', '.b2s-get-settings-sched-time-user', function () {
200
jQuery('.b2s-server-connection-fail').hide();
201
jQuery.ajax({
230
var todayDate = ("0" + today.getDate()).slice(-2);
231
var dateToday = today.getFullYear() + "-" + todayMonth + "-" + todayDate;
232
233
+ var lang = jQuery('#b2sUserLang').val();
234
if (lang == "de") {
235
dateTomorrow = tomorrowDate + "." + tomorrowMonth + "." + tomorrow.getFullYear();
236
dateToday = todayDate + "." + todayMonth + "." + today.getFullYear();
243
jQuery('.b2s-post-item-details-release-input-date-select[data-network-id="' + network_id + '"][data-network-type="' + count + '"]').val('1').trigger("change");
244
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);
245
var hours = network_type_time.substring(0, 2);
246
+ if (lang == "de") {
247
var timeparts = network_type_time.split(' ');
248
hours = (timeparts[1] == 'AM') ? hours : (parseInt(hours) + 12);
249
}
310
if (dataNetworkCount == 2) {
311
jQuery('.b2s-post-item-details-release-input-add[data-network-count="0"]').hide();
312
jQuery('.b2s-post-item-details-release-input-add[data-network-count="1"]').hide();
313
+ jQuery('.b2s-post-item-details-release-input-hide[data-network-count="1"]').hide();
314
+ jQuery('.b2s-post-item-details-release-input-hide[data-network-count="2"]').show();
315
} else if (dataNetworkCount == 1) {
316
jQuery('.b2s-post-item-details-release-input-add[data-network-count="0"]').hide();
317
+ jQuery('.b2s-post-item-details-release-input-hide[data-network-count="1"]').show();
318
}
319
}
320
330
var networkId = jQuery(this).attr("data-network-id");
331
var networkType = jQuery(this).attr("data-network-type");
332
var postFormat = jQuery(this).val();
333
+ var networkAuthId = jQuery(this).attr("data-network-auth-id");
334
335
jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').val(postFormat);
336
//PostFormat
337
if (jQuery('.b2s-post-ship-item-post-format-text[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').length > 0) {
338
var postFormatText = JSON.parse(jQuery('.b2sNetworkSettingsPostFormatText').val());
339
if (jQuery('#user_version').val() >= 2) {
340
+
341
+ jQuery('.b2s-post-ship-item-post-format-text[data-network-auth-id="' + networkAuthId + '"]').html(postFormatText[postFormat]);
342
+ jQuery('.b2s-post-item-details-post-format[data-network-auth-id="' + networkAuthId + '"]').val(postFormat);
343
+
344
+ /*
345
+ jQuery('.b2s-post-ship-item-post-format-text[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').html(postFormatText[postFormat]);
346
+ jQuery('.b2s-post-item-details-post-format[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').val(postFormat);
347
+ */
348
+
349
} else {
350
jQuery('.b2s-post-ship-item-post-format-text[data-network-id="' + networkId + '"]').html(postFormatText[postFormat]);
351
jQuery('.b2s-post-item-details-post-format[data-network-id="' + networkId + '"]').val(postFormat);
352
}
353
}
354
+
355
+ //Edit Meta Tags
356
+ if (postFormat == '0' && jQuery('#user_version').val() > 0) { //If linkpost
357
+ jQuery('.b2s-post-item-details-preview-title[data-network-auth-id="' + networkAuthId + '"]').prop("readonly", false);
358
+ jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + networkAuthId + '"]').prop("readonly", false);
359
+ var dataMetaType = jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + networkAuthId + '"]').attr("data-meta-type");
360
+ if (dataMetaType == "og") {
361
+ jQuery('#b2sChangeOgMeta').val("1");
362
+ } else {
363
+ jQuery('#b2sChangeCardMeta').val("1");
364
}
365
+
366
+ //Copy from further item meta tags by same network
367
+ jQuery('.b2s-post-item-details-post-format[data-network-id=' + networkId + ']').each(function () {
368
+ if (jQuery(this).val() == "0" && jQuery('.b2s-post-ship-item-post-format[data-network-auth-id=' + jQuery(this).attr('data-network-auth-id') + ']').is(":visible") && jQuery(this).attr('data-network-auth-id') != networkAuthId) { //other Linkpost by same network
369
+ jQuery('.b2s-post-item-details-preview-title[data-network-auth-id="' + networkAuthId + '"]').val(jQuery('.b2s-post-item-details-preview-title[data-network-auth-id="' + jQuery(this).attr('data-network-auth-id') + '"]').val());
370
+ jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + networkAuthId + '"]').val(jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + jQuery(this).attr('data-network-auth-id') + '"]').val());
371
+
372
+ jQuery('.b2s-post-item-details-url-image[data-network-auth-id="' + networkAuthId + '"]').attr('src', jQuery('.b2s-post-item-details-url-image[data-network-auth-id="' + jQuery(this).attr('data-network-auth-id') + '"]').attr('src'));
373
+ jQuery('.b2s-image-url-hidden-field[data-network-auth-id="' + networkAuthId + '"]').val(jQuery('.b2s-image-url-hidden-field[data-network-auth-id="' + jQuery(this).attr('data-network-auth-id') + '"]').val());
374
+
375
+ if (jQuery('.b2s-image-remove-btn[data-network-auth-id="' + jQuery(this).attr('data-network-auth-id') + '"]').is(":visible")) {
376
+ jQuery('.b2s-image-remove-btn[data-network-auth-id="' + networkAuthId + '"]').show();
377
+ } else {
378
+ jQuery('.b2s-image-remove-btn[data-network-auth-id="' + networkAuthId + '"]').hide();
379
+ }
380
+
381
+ return true;
382
+ }
383
+ });
384
+ jQuery('.b2s-post-item-details-preview-url-reload[data-network-auth-id="' + networkAuthId + '"]').hide();
385
+
386
+
387
+ } else {
388
+ jQuery('.b2s-post-item-details-preview-title[data-network-auth-id="' + networkAuthId + '"]').prop("readonly", true);
389
+ jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + networkAuthId + '"]').prop("readonly", true);
390
+ jQuery('.b2s-post-item-details-preview-url-reload[data-network-auth-id="' + networkAuthId + '"]').show();
391
+ jQuery('.b2s-post-item-details-preview-url-reload[data-network-auth-id="' + networkAuthId + '"]').trigger("click");
392
}
393
394
+ //Change View For Twitter
395
+ //if (postFormat == '0' && networkId == '2') {
396
+ //jQuery('.b2s-image-remove-btn[data-network-id="' + networkId + '"]').hide();
397
+ //jQuery('.b2s-select-image-modal-open[data-network-id="' + networkId + '"]').hide();
398
+ //jQuery('.b2s-post-item-details-preview-url-reload[data-network-id="' + networkId + '"]').trigger("click");
399
+ //}
400
+ /*if (postFormat == '1' && networkId == '2') {
401
+ jQuery('.b2s-image-remove-btn[data-network-id="' + networkId + '"]').show();
402
+ jQuery('.b2s-select-image-modal-open[data-network-id="' + networkId + '"]').show();
403
+ if (jQuery('#b2s_blog_default_image').val() != "") {
404
+ jQuery('.b2s-post-item-details-url-image[data-network-id="' + networkId + '"]').attr('src', jQuery('#b2s_blog_default_image').val());
405
+ jQuery('.b2s-image-url-hidden-field[data-network-id="' + networkId + '"]').val(jQuery('#b2s_blog_default_image').val());
406
+ }
407
+ }*/
408
+
409
jQuery('.b2s-user-network-settings-post-format[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').removeClass('b2s-settings-checked');
410
jQuery(this).addClass('b2s-settings-checked');
411
jQuery('#b2s-post-ship-item-post-format-modal').modal('hide');
412
return false;
413
});
414
465
if (jQuery('.b2s-post-ship-item-post-format-text[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').length > 0) {
466
var postFormatText = JSON.parse(jQuery('.b2sNetworkSettingsPostFormatText').val());
467
if (jQuery('#user_version').val() >= 2) {
468
+
469
+ 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()]);
470
+ jQuery('.b2s-post-item-details-post-format[data-network-auth-id="' + networkAuthId + '"]').val(jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').val());
471
+
472
+ /*
473
+ jQuery('.b2s-post-ship-item-post-format-text[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').html(postFormatText[jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').val()]);
474
+ jQuery('.b2s-post-item-details-post-format[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').val(jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').val());
475
+ */
476
+ //if linkpost then show btn meta tags
477
+ if (jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').val() == "0" && jQuery('#user_version').val() > 0) {
478
+ jQuery('.b2s-post-item-details-preview-title[data-network-auth-id="' + networkAuthId + '"]').prop("readonly", false);
479
+ jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + networkAuthId + '"]').prop("readonly", false);
480
+
481
+ var dataMetaType = jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + networkAuthId + '"]').attr("data-meta-type");
482
+ if (dataMetaType == "og") {
483
+ jQuery('#b2sChangeOgMeta').val("1");
484
+ } else {
485
+ jQuery('#b2sChangeCardMeta').val("1");
486
+ }
487
+
488
+ //Copy from further item meta tags by same network
489
+ jQuery('.b2s-post-item-details-post-format[data-network-id=' + networkId + ']').each(function () {
490
+ if (jQuery(this).val() == "0" && jQuery('.b2s-post-ship-item-post-format[data-network-auth-id=' + jQuery(this).attr('data-network-auth-id') + ']').is(":visible") && jQuery(this).attr('data-network-auth-id') != networkAuthId) { //other Linkpost by same network
491
+ jQuery('.b2s-post-item-details-preview-title[data-network-auth-id="' + networkAuthId + '"]').val(jQuery('.b2s-post-item-details-preview-title[data-network-auth-id="' + jQuery(this).attr('data-network-auth-id') + '"]').val());
492
+ jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + networkAuthId + '"]').val(jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + jQuery(this).attr('data-network-auth-id') + '"]').val());
493
+
494
+ jQuery('.b2s-post-item-details-url-image[data-network-auth-id="' + networkAuthId + '"]').attr('src', jQuery('.b2s-post-item-details-url-image[data-network-auth-id="' + jQuery(this).attr('data-network-auth-id') + '"]').attr('src'));
495
+ jQuery('.b2s-image-url-hidden-field[data-network-auth-id="' + networkAuthId + '"]').val(jQuery('.b2s-image-url-hidden-field[data-network-auth-id="' + jQuery(this).attr('data-network-auth-id') + '"]').val());
496
+
497
+ if (jQuery('.b2s-image-remove-btn[data-network-auth-id="' + jQuery(this).attr('data-network-auth-id') + '"]').is(":visible")) {
498
+ jQuery('.b2s-image-remove-btn[data-network-auth-id="' + networkAuthId + '"]').show();
499
+ } else {
500
+ jQuery('.b2s-image-remove-btn[data-network-auth-id="' + networkAuthId + '"]').hide();
501
+ }
502
+
503
+ return true;
504
+ }
505
+ });
506
+
507
+ jQuery('.b2s-post-item-details-preview-url-reload[data-network-auth-id="' + networkAuthId + '"]').hide();
508
+
509
+ } else {
510
+ jQuery('.b2s-post-item-details-preview-title[data-network-auth-id="' + networkAuthId + '"]').prop("readonly", true);
511
+ jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + networkAuthId + '"]').prop("readonly", true);
512
+ jQuery('.b2s-post-item-details-preview-url-reload[data-network-auth-id="' + networkAuthId + '"]').show();
513
+ jQuery('.b2s-post-item-details-preview-url-reload[data-network-auth-id="' + networkAuthId + '"]').trigger("click");
514
+ }
515
} else {
516
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()]);
517
jQuery('.b2s-post-item-details-post-format[data-network-id="' + networkId + '"]').val(jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + networkType + '"][data-network-id="' + networkId + '"]').val());
584
var dateFormat = "yyyy-mm-dd";
585
var language = "en";
586
var showMeridian = true;
587
+ if (jQuery('#b2sUserLang').val() == "de") {
588
dateFormat = "dd.mm.yyyy";
589
language = "de";
590
showMeridian = false;
611
snapToStep: true
612
});
613
614
615
+ jQuery(".b2s-post-item-details-release-input-date").datepicker().on('changeDate', function (e) {
616
+ checkSchedDateTime(jQuery(this).attr('data-network-auth-id'));
617
});
618
jQuery('.b2s-post-item-details-release-input-time').timepicker().on('changeTime.timepicker', function (e) {
619
+ checkSchedDateTime(jQuery(this).attr('data-network-auth-id'));
620
621
});
622
+
623
+ /*jQuery(".b2s-post-item-details-release-input-date").datepicker().on('changeDate', function (e) {
624
+ var element = '.b2s-post-item-details-release-input-time[data-network-auth-id="' + jQuery(this).attr('data-network-auth-id') + '"]';
625
+ var dateStr = jQuery(this).val();
626
+ var minStr = jQuery(element).val();
627
+ if (jQuery('#b2sUserLang').val() == 'de') {
628
+ dateStr = dateStr.substring(6, 10) + '-' + dateStr.substring(3, 5) + '-' + dateStr.substring(0, 2);
629
+ } else {
630
+ var minParts = minStr.split(' ');
631
+ var minParts2 = minParts[0].split(':');
632
+ if (minParts[1] == 'PM') {
633
+ minParts2[0] = parseInt(minParts2[0]) + 12;
634
+ }
635
+ minStr = minParts2[0] + ':' + minParts2[1];
636
+ }
637
+ var dateObj = new Date();
638
+ if (jQuery('#b2sBlogPostSchedDate').length > 0) {
639
+ dateObj.setTime(jQuery('#b2sBlogPostSchedDate').val());
640
+ }
641
+
642
+ if (Date.parse(dateStr + ' ' + minStr + ':00') <= Date.parse(dateObj.getUTCFullYear() + '-' + (dateObj.getUTCMonth() + 1) + '-' + dateObj.getUTCDate() + ' ' + dateObj.getUTCHours() + ':' + dateObj.getUTCMinutes() + ':00')) {
643
+ //date in past
644
+ if (dateObj.getUTCMinutes() >= 30) {
645
+ jQuery(element).timepicker('setTime', (dateObj.getUTCHours() + 1) + ':00');
646
+ } else {
647
+ jQuery(element).timepicker('setTime', (dateObj.getUTCHours()) + ':30');
648
+ }
649
+ }
650
+ });*/
651
+
652
+ /*jQuery('.b2s-post-item-details-release-input-time').timepicker().on('changeTime.timepicker', function (e) {
653
+ var dataNetworkAuthId = jQuery(this).attr('data-network-auth-id');
654
+ if (jQuery('.b2s-post-item-details-release-input-date-select[data-network-auth-id="' + dataNetworkAuthId + '"]').val() == "1") {
655
+ var dateStr = jQuery('.b2s-post-item-details-release-input-date[data-network-auth-id="' + jQuery(this).attr('data-network-auth-id') + '"]').val();
656
+ var minStr = jQuery(this).val();
657
+ var timeZone = jQuery('#user_timezone').val();
658
+ if (jQuery('#b2sUserLang').val() == 'de') {
659
+ dateStr = dateStr.substring(6, 10) + '-' + dateStr.substring(3, 5) + '-' + dateStr.substring(0, 2);
660
+ } else {
661
+ var minParts = minStr.split(' ');
662
+ var minParts2 = minParts[0].split(':');
663
+ if (minParts[1] == 'PM') {
664
+ minParts2[0] = parseInt(minParts2[0]) + 12;
665
+ }
666
+ minStr = minParts2[0] + ':' + minParts2[1];
667
+ }
668
+ var dateObj = new Date();
669
+ if (jQuery('#b2sBlogPostSchedDate').length > 0) {
670
+ dateObj.setTime(jQuery('#b2sBlogPostSchedDate').val());
671
+ }
672
+
673
+ if (Date.parse(dateStr + ' ' + minStr + ':00') <= Date.parse(dateObj.getUTCFullYear() + '-' + (dateObj.getUTCMonth() + 1) + '-' + dateObj.getUTCDate() + ' ' + dateObj.getUTCHours() + ':' + dateObj.getUTCMinutes() + ':00')) {
674
+ //date in past
675
+ if (dateObj.getUTCMinutes() >= 30) {
676
+ jQuery(this).timepicker('setTime', (dateObj.getUTCHours() + 1) + ':00');
677
+ } else {
678
+ jQuery(this).timepicker('setTime', (dateObj.getUTCHours()) + ':30');
679
+ }
680
+ }
681
+ }
682
+ });*/
683
+
684
//Check Text Limit
685
var textLimit = jQuery('.b2s-post-item-details-item-message-input[data-network-auth-id="' + data.networkAuthId + '"]').attr('data-network-text-limit');
686
if (textLimit != "0") {
706
if (jQuery('.b2s-post-ship-item-post-format-text[data-network-type="' + data.networkType + '"][data-network-id="' + data.networkId + '"]').length > 0) {
707
var postFormatText = JSON.parse(jQuery('.b2sNetworkSettingsPostFormatText').val());
708
if (jQuery('#user_version').val() >= 2) {
709
+
710
+ 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()]);
711
+ 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());
712
+
713
+ /*
714
+ 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()]);
715
+ 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());
716
+ */
717
+
718
+ //if linkpost then show btn meta tags
719
+ if (jQuery('.b2sNetworkSettingsPostFormatCurrent[data-network-type="' + data.networkType + '"][data-network-id="' + data.networkId + '"]').val() == "0") {
720
+ jQuery('.b2s-post-item-details-preview-title[data-network-auth-id="' + data.networkAuthId + '"]').prop("readonly", false);
721
+ jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + data.networkAuthId + '"]').prop("readonly", false);
722
+ var dataMetaType = jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + data.networkAuthId + '"]').attr("data-meta-type");
723
+ if (dataMetaType == "og") {
724
+ jQuery('#b2sChangeOgMeta').val("1");
725
+ } else {
726
+ jQuery('#b2sChangeCardMeta').val("1");
727
+ }
728
+
729
+ //Copy from further item meta tags by same network
730
+ jQuery('.b2s-post-item-details-post-format[data-network-id=' + data.networkId + ']').each(function () {
731
+ if (jQuery(this).val() == "0" && jQuery('.b2s-post-ship-item-post-format[data-network-auth-id=' + jQuery(this).attr('data-network-auth-id') + ']').is(":visible") && jQuery(this).attr('data-network-auth-id') != data.networkAuthId) { //other Linkpost by same network
732
+ jQuery('.b2s-post-item-details-preview-title[data-network-auth-id="' + data.networkAuthId + '"]').val(jQuery('.b2s-post-item-details-preview-title[data-network-auth-id="' + jQuery(this).attr('data-network-auth-id') + '"]').val());
733
+ jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + data.networkAuthId + '"]').val(jQuery('.b2s-post-item-details-preview-desc[data-network-auth-id="' + jQuery(this).attr('data-network-auth-id') + '"]').val());
734
+
735
+ jQuery('.b2s-post-item-details-url-image[data-network-auth-id="' + data.networkAuthId + '"]').attr('src', jQuery('.b2s-post-item-details-url-image[data-network-auth-id="' + jQuery(this).attr('data-network-auth-id') + '"]').attr('src'));
736
+ jQuery('.b2s-image-url-hidden-field[data-network-auth-id="' + data.networkAuthId + '"]').val(jQuery('.b2s-image-url-hidden-field[data-network-auth-id="' + jQuery(this).attr('data-network-auth-id') + '"]').val());
737
+
738