Version Description
- internal code improvements
- My Items page UI update
- Removed Placements page
- Modified sidebar widget management UI
Download this release
Release Info
Developer | artemopinionstage |
Plugin | Poll, Survey, Quiz, Slideshow, Form, Story & Landing Page |
Version | 19.7.8 |
Comparing to | |
See all releases |
Code changes from version 19.7.7 to 19.7.8
- admin/content-popup-template.html.php +1 -1
- admin/content-popup.php +20 -1
- admin/css/menu-page.css +202 -211
- admin/css/sidebar-widget.css +85 -6
- admin/js/content-popup.js +1 -1
- admin/js/menu-page.js +57 -26
- admin/js/widgets-page.js +23 -0
- admin/menu-page.php +2 -5
- admin/resources/common.php +0 -1
- admin/template-parts/my-items-tbody-element.php +10 -9
- admin/template-parts/widget-form.php +66 -0
- admin/views/my_placements.php +0 -153
- admin/views/settings.php +86 -10
- admin/views/view_my_items.php +0 -75
- assets/content-popup/app/components/popup-content.js +1 -1
- assets/content-popup/index.js +5 -6
- includes/opinionstage-ajax-functions.php +6 -52
- includes/opinionstage-sidebar-widget.php +137 -127
- includes/opinionstage-utility-functions.php +0 -11
- opinionstage-polls.php +1 -1
- plugin.php +17 -7
- public/shortcodes.php +50 -41
- readme.txt +8 -6
admin/content-popup-template.html.php
CHANGED
@@ -124,7 +124,7 @@ $opinionstage_user_logged_in = opinionstage_user_logged_in();
|
|
124 |
</a>
|
125 |
<p class='content__info'><a target="_blank" :href='widget.editUrl'>{{ widget.title }}</a></p>
|
126 |
<div class='content__links'>
|
127 |
-
<button class='popup-content-btn content__links-itm' @click="select(widget)"><?php esc_html_e( 'insert', 'social-polls-by-opinionstage' ); ?></button>
|
128 |
<div class="dropdown dropdown-popup-action">
|
129 |
<div class="popup-action popup-content-btn"></div>
|
130 |
<div class="popup-action-dropdown dropdown-content">
|
124 |
</a>
|
125 |
<p class='content__info'><a target="_blank" :href='widget.editUrl'>{{ widget.title }}</a></p>
|
126 |
<div class='content__links'>
|
127 |
+
<button class='popup-content-btn content__links-itm' @click="select(widget)" ><?php esc_html_e( 'insert', 'social-polls-by-opinionstage' ); ?></button>
|
128 |
<div class="dropdown dropdown-popup-action">
|
129 |
<div class="popup-action popup-content-btn"></div>
|
130 |
<div class="popup-action-dropdown dropdown-content">
|
admin/content-popup.php
CHANGED
@@ -3,6 +3,7 @@ defined( 'ABSPATH' ) || die();
|
|
3 |
|
4 |
add_action( 'media_buttons', 'opinionstage_content_popup_add_editor_button' );
|
5 |
add_action( 'admin_enqueue_scripts', 'opinionstage_content_popup_js' );
|
|
|
6 |
add_action( 'admin_footer', 'opinionstage_content_popup_html' );
|
7 |
|
8 |
/**
|
@@ -15,7 +16,11 @@ function opinionstage_content_popup_add_editor_button() {
|
|
15 |
/**
|
16 |
* Include content popup JS
|
17 |
*/
|
18 |
-
function opinionstage_content_popup_js() {
|
|
|
|
|
|
|
|
|
19 |
|
20 |
// asset loader hotfix TODO: improve this loader machanism.
|
21 |
opinionstage_register_javascript_asset(
|
@@ -27,6 +32,20 @@ function opinionstage_content_popup_js() {
|
|
27 |
opinionstage_enqueue_js_asset( 'content-popup' );
|
28 |
}
|
29 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
/**
|
31 |
* Include content popup HTML
|
32 |
*/
|
3 |
|
4 |
add_action( 'media_buttons', 'opinionstage_content_popup_add_editor_button' );
|
5 |
add_action( 'admin_enqueue_scripts', 'opinionstage_content_popup_js' );
|
6 |
+
add_action( 'admin_enqueue_scripts', 'opinionstage_enqueue_widgets_page_js' );
|
7 |
add_action( 'admin_footer', 'opinionstage_content_popup_html' );
|
8 |
|
9 |
/**
|
16 |
/**
|
17 |
* Include content popup JS
|
18 |
*/
|
19 |
+
function opinionstage_content_popup_js( $hook_suffix ) {
|
20 |
+
|
21 |
+
if( ! in_array( $hook_suffix, array( 'post.php', 'widgets.php' ) )) {
|
22 |
+
return;
|
23 |
+
}
|
24 |
|
25 |
// asset loader hotfix TODO: improve this loader machanism.
|
26 |
opinionstage_register_javascript_asset(
|
32 |
opinionstage_enqueue_js_asset( 'content-popup' );
|
33 |
}
|
34 |
|
35 |
+
function opinionstage_enqueue_widgets_page_js( $hook_suffix ){
|
36 |
+
if( 'widgets.php' !== $hook_suffix ) {
|
37 |
+
return;
|
38 |
+
}
|
39 |
+
|
40 |
+
opinionstage_register_javascript_asset(
|
41 |
+
'widgets-page',
|
42 |
+
'widgets-page.js',
|
43 |
+
array( 'jquery', opinionstage_asset_name('content-popup') )
|
44 |
+
);
|
45 |
+
|
46 |
+
opinionstage_enqueue_js_asset( 'widgets-page' );
|
47 |
+
}
|
48 |
+
|
49 |
/**
|
50 |
* Include content popup HTML
|
51 |
*/
|
admin/css/menu-page.css
CHANGED
@@ -140,6 +140,19 @@
|
|
140 |
#opinionstage-content .opinionstage-dashboard-section {
|
141 |
margin-bottom: 30px;
|
142 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
143 |
#opinionstage-content .opinionstage-dashboard-section .opinionstage-section-header {
|
144 |
height: 58px;
|
145 |
margin-top: 10px;
|
@@ -149,6 +162,7 @@
|
|
149 |
float: left;
|
150 |
font-size: 30px;
|
151 |
padding: 0;
|
|
|
152 |
}
|
153 |
#opinionstage-content .opinionstage-dashboard-section .opinionstage-section-header a {
|
154 |
float: left;
|
@@ -162,6 +176,7 @@
|
|
162 |
display: table;
|
163 |
border-collapse: collapse;
|
164 |
width: 100%;
|
|
|
165 |
}
|
166 |
#opinionstage-content .opinionstage-dashboard-section .opinionstage-video-container {
|
167 |
height: 0;
|
@@ -233,52 +248,18 @@
|
|
233 |
#opinionstage-section-create .opinionstage-section-cell.opinionstage-btn-cell {
|
234 |
width: 10%;
|
235 |
}
|
236 |
-
#opinionstage-section-create .opinionstage-section-cell.opinionstage-description-cell .title
|
237 |
font-size: 22px;
|
238 |
font-weight: 600;
|
239 |
margin-bottom: 5px;
|
|
|
|
|
240 |
}
|
241 |
-
#opinionstage-section-
|
242 |
-
color: #a4a4a5;
|
243 |
-
}
|
244 |
-
#opinionstage-section-create .opinionstage-section-cell.opinionstage-description-cell .example, #opinionstage-section-placements .opinionstage-section-cell.opinionstage-description-cell .example {
|
245 |
color: #b1b1b1;
|
246 |
font-size: 14px;
|
247 |
line-height: normal;
|
248 |
}
|
249 |
-
.opinionstage-placement-dashboard .opinionstage-section-content .opinionstage-description-cell .os-long-text a, .opinionstage-placement-dashboard .opinionstage-section-content .opinionstage-description-cell .os-long-text a:hover {
|
250 |
-
color: #3aaebd;
|
251 |
-
}
|
252 |
-
#opinionstage-section-placements .opinionstage-section-raw {
|
253 |
-
padding: 5px;
|
254 |
-
}
|
255 |
-
#opinionstage-section-placements .opinionstage-section-cell.opinionstage-toggle-cell {
|
256 |
-
width: 7%;
|
257 |
-
}
|
258 |
-
#opinionstage-section-placements .opinionstage-section-cell.opinionstage-description-cell {
|
259 |
-
width: 68%;
|
260 |
-
}
|
261 |
-
#opinionstage-section-placements .opinionstage-section-cell.opinionstage-btns-cell {
|
262 |
-
width: 20%;
|
263 |
-
}
|
264 |
-
#opinionstage-section-placements .opinionstage-btns-cell .opinionstage-edit-content {
|
265 |
-
padding: 13px 15px !important;
|
266 |
-
}
|
267 |
-
#opinionstage-section-placements .opinionstage-btns-cell .opinionstage-edit-settings {
|
268 |
-
padding: 9px 8px !important;
|
269 |
-
}
|
270 |
-
#opinionstage-section-placements .opinionstage-btns-cell .icon-os-common-settings:before {
|
271 |
-
font-size: 26px;
|
272 |
-
}
|
273 |
-
#opinionstage-section-placements .opinionstage-section-cell.opinionstage-btns-cell .opinionstage-edit-content {
|
274 |
-
margin-right: 10px;
|
275 |
-
width: 107px;
|
276 |
-
font-size: 15px;
|
277 |
-
}
|
278 |
-
#opinionstage-section-placements .opinionstage-section-cell.opinionstage-btns-cell .opinionstage-edit-settings {
|
279 |
-
font-size: 19px;
|
280 |
-
width: 29px;
|
281 |
-
}
|
282 |
#opinionstage-section-help .opinionstage-section-content {
|
283 |
height: 307px;
|
284 |
}
|
@@ -287,83 +268,6 @@
|
|
287 |
margin-bottom: 5px;
|
288 |
text-decoration: none;
|
289 |
}
|
290 |
-
#opinionstage-content .opinionstage-onoffswitch {
|
291 |
-
display: inline-block;
|
292 |
-
position: relative;
|
293 |
-
width: 50px;
|
294 |
-
-webkit-user-select:none;
|
295 |
-
-moz-user-select:none;
|
296 |
-
-ms-user-select: none;
|
297 |
-
}
|
298 |
-
#opinionstage-content .opinionstage-onoffswitch.disabled {
|
299 |
-
opacity: 0.4;
|
300 |
-
}
|
301 |
-
#opinionstage-content input.opinionstage-onoffswitch-checkbox {
|
302 |
-
display: none;
|
303 |
-
}
|
304 |
-
#opinionstage-content .opinionstage-onoffswitch-label {
|
305 |
-
border-radius: 15px;
|
306 |
-
cursor: pointer;
|
307 |
-
display: block;
|
308 |
-
overflow: hidden;
|
309 |
-
}
|
310 |
-
#opinionstage-content .opinionstage-onoffswitch.disabled .opinionstage-onoffswitch-label:hover {
|
311 |
-
cursor: default;
|
312 |
-
}
|
313 |
-
#opinionstage-content .opinionstage-onoffswitch-inner {
|
314 |
-
margin-left: -100%;
|
315 |
-
width: 200%;
|
316 |
-
}
|
317 |
-
#opinionstage-content .opinionstage-onoffswitch-inner:before, .opinionstage-onoffswitch-inner:after {
|
318 |
-
float: left;
|
319 |
-
width: 50%;
|
320 |
-
height: 28px;
|
321 |
-
padding: 0;
|
322 |
-
line-height: 24px;
|
323 |
-
font-size: 13px;
|
324 |
-
color: rgba(0, 0, 0, 0.9);
|
325 |
-
font-family: Trebuchet, Arial, sans-serif;
|
326 |
-
font-weight: bold;
|
327 |
-
-moz-box-sizing: border-box;
|
328 |
-
-webkit-box-sizing: border-box;
|
329 |
-
box-sizing: border-box;
|
330 |
-
text-shadow: 0 1px 1px rgba(255, 255, 255, 0.63);
|
331 |
-
}
|
332 |
-
#opinionstage-content .opinionstage-onoffswitch-inner:before {
|
333 |
-
background-color: #32adbc;
|
334 |
-
content: '';
|
335 |
-
padding-left: 15px;
|
336 |
-
}
|
337 |
-
#opinionstage-content .opinionstage-onoffswitch-inner:after {
|
338 |
-
background-color: #c8c8c9;
|
339 |
-
content: '';
|
340 |
-
padding-left: 18px;
|
341 |
-
text-align: center;
|
342 |
-
}
|
343 |
-
#opinionstage-content .opinionstage-onoffswitch.disabled .opinionstage-onoffswitch-inner:after {
|
344 |
-
background-color: #c8c8c9;
|
345 |
-
}
|
346 |
-
#opinionstage-content .opinionstage-onoffswitch-switch {
|
347 |
-
width: 22px;
|
348 |
-
margin: 0;
|
349 |
-
background: #ffffff;
|
350 |
-
border-radius: 50%;
|
351 |
-
position: absolute;
|
352 |
-
top: 3px;
|
353 |
-
bottom: 0;
|
354 |
-
right: 25px;
|
355 |
-
-moz-transition: all 0.1s ease-in 0s;
|
356 |
-
-webkit-transition: all 0.1s ease-in 0s;
|
357 |
-
-o-transition: all 0.1s ease-in 0s;
|
358 |
-
transition: all 0.1s ease-in 0s;
|
359 |
-
height: 22px;
|
360 |
-
}
|
361 |
-
#opinionstage-content .opinionstage-onoffswitch-checkbox:checked + .opinionstage-onoffswitch-label .opinionstage-onoffswitch-inner {
|
362 |
-
margin-left: 0;
|
363 |
-
}
|
364 |
-
#opinionstage-content .opinionstage-onoffswitch-checkbox:checked + .opinionstage-onoffswitch-label .opinionstage-onoffswitch-switch {
|
365 |
-
right: 3px;
|
366 |
-
}
|
367 |
/* Getting started */
|
368 |
.gettingStartedSection {
|
369 |
background: #fff;
|
@@ -480,7 +384,7 @@ h1.gettingStartedHeading_logo {
|
|
480 |
/* My Items Page Css */
|
481 |
td.long {
|
482 |
padding-left: 10px;
|
483 |
-
width:
|
484 |
}
|
485 |
td.long > div {
|
486 |
position: relative;
|
@@ -505,6 +409,9 @@ span.os-icon-plugin.icon-os-common-date {
|
|
505 |
float: left;
|
506 |
margin-right: 10px;
|
507 |
}
|
|
|
|
|
|
|
508 |
.label {
|
509 |
line-height: 15px;
|
510 |
}
|
@@ -557,6 +464,8 @@ td.long a {
|
|
557 |
height: 90px;
|
558 |
position: relative;
|
559 |
width: 120px;
|
|
|
|
|
560 |
}
|
561 |
.content-item-image.quiz img {
|
562 |
bottom: 0;
|
@@ -632,6 +541,7 @@ div#container .opinionstage-section-header {
|
|
632 |
|
633 |
/* Load More */
|
634 |
div#opinionstage-load-more {
|
|
|
635 |
cursor:pointer;
|
636 |
-webkit-box-sizing: border-box;
|
637 |
box-sizing: border-box;
|
@@ -717,6 +627,12 @@ td.image {
|
|
717 |
float: right;
|
718 |
position: relative;
|
719 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
720 |
.opinionstage-header-inner-container .opinionstage-header-inner-section {
|
721 |
border-right: 1px solid #f3f3f3;
|
722 |
float: left;
|
@@ -773,39 +689,6 @@ div#opinionstage-load-more {
|
|
773 |
color: #444;
|
774 |
margin: 0;
|
775 |
}
|
776 |
-
.opinionstage-placement-dashboard {
|
777 |
-
margin: 30px;
|
778 |
-
width: 1000px;
|
779 |
-
}
|
780 |
-
#opinionstage-section-placements .opinionstage-section-content-wrapper {
|
781 |
-
border: none !important;
|
782 |
-
}
|
783 |
-
#opinionstage-section-placements .opinionstage-section-content-wrapper {
|
784 |
-
padding: 0 !important;
|
785 |
-
}
|
786 |
-
.opinionstage-btns-cell .opinionstage-blue-bordered-btn {
|
787 |
-
font-weight: bold;
|
788 |
-
padding: 12px 15px !important;
|
789 |
-
}
|
790 |
-
.opinionstage-setting-title {
|
791 |
-
font-size: 18px;
|
792 |
-
font-weight: 600;
|
793 |
-
margin-bottom: 10px;
|
794 |
-
}
|
795 |
-
.os-setting-container {
|
796 |
-
border-bottom: 1px solid #c8c8c9;
|
797 |
-
border-top: 1px solid #c8c8c9;
|
798 |
-
margin-bottom: 20px;
|
799 |
-
padding: 25px 0;
|
800 |
-
}
|
801 |
-
.opinionstage-setting-content {
|
802 |
-
color: #444;
|
803 |
-
font-size: 14px;
|
804 |
-
}
|
805 |
-
#opinionstage-content .opinionstage-setting-content a {
|
806 |
-
color: #444;
|
807 |
-
text-decoration: none;
|
808 |
-
}
|
809 |
.gettingStartedContainer {
|
810 |
background: url(../images/bitmap_top.png) no-repeat 0 0;
|
811 |
background-color: #32adbc;
|
@@ -819,7 +702,7 @@ div#opinionstage-load-more {
|
|
819 |
.gettingBlockContainer {
|
820 |
width: 760px;
|
821 |
}
|
822 |
-
.gettingTemplateGallery, .
|
823 |
border: 2px solid #32adbc;
|
824 |
color: #32adbc;
|
825 |
font-size: 15px;
|
@@ -831,17 +714,17 @@ div#opinionstage-load-more {
|
|
831 |
width: 100%;
|
832 |
max-width: 370px;
|
833 |
}
|
834 |
-
.gettingTemplateGallery
|
835 |
float: left;
|
836 |
}
|
837 |
.gettingTemplateTutorial {
|
838 |
margin-right: 10px;
|
839 |
}
|
840 |
-
.gettingTemplateGallery:hover, .
|
841 |
background-color: rgba(49, 174, 190, 0.1);
|
842 |
color: #32adbc;
|
843 |
}
|
844 |
-
.gettingTemplateGallery:focus, .
|
845 |
background-color: rgba(49, 174, 190, 0.1);
|
846 |
box-shadow: none;
|
847 |
color: #32adbc;
|
@@ -866,6 +749,9 @@ div#opinionstage-load-more {
|
|
866 |
.opinionstage-item-view-dashboard #opinionstage-items-table {
|
867 |
width: 100%;
|
868 |
}
|
|
|
|
|
|
|
869 |
.opinionstage-item-create:before {
|
870 |
bottom: 0;
|
871 |
content: "+";
|
@@ -902,58 +788,166 @@ a.help-center-os.help-link:focus {
|
|
902 |
box-shadow: none;
|
903 |
color: #32adbc;
|
904 |
}
|
905 |
-
|
906 |
-
|
907 |
-
|
908 |
-
|
909 |
-
|
910 |
-
|
911 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
912 |
}
|
913 |
-
|
914 |
-
|
915 |
-
|
916 |
}
|
917 |
-
|
918 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
919 |
}
|
920 |
-
|
921 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
922 |
}
|
923 |
-
#
|
924 |
-
|
925 |
}
|
926 |
-
|
927 |
-
|
928 |
}
|
929 |
-
#
|
930 |
-
|
931 |
-
|
932 |
-
|
933 |
-
|
|
|
|
|
|
|
934 |
}
|
935 |
-
|
936 |
-
|
937 |
-
width: 39%;
|
938 |
}
|
939 |
-
#
|
940 |
-
|
941 |
}
|
|
|
942 |
|
943 |
-
#opinionstage-content .opinionstage-item-view-dashboard .opinionstage-dashboard-section .opinionstage-section-header {
|
944 |
-
height: 95px;
|
945 |
-
}
|
946 |
|
947 |
-
|
948 |
-
|
949 |
-
|
950 |
-
|
951 |
-
|
952 |
-
|
953 |
-
|
954 |
-
|
955 |
-
|
956 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
957 |
}
|
958 |
|
959 |
|
@@ -969,21 +963,18 @@ a.opinionstage-add-our-first-item {
|
|
969 |
color: #3499c2;
|
970 |
}
|
971 |
@media only screen and (max-width: 768px) {
|
972 |
-
.gettingStartedSection {
|
973 |
-
|
974 |
-
}
|
975 |
-
|
976 |
-
|
977 |
-
|
978 |
-
|
979 |
-
|
980 |
-
|
981 |
-
|
982 |
-
|
983 |
-
|
984 |
-
|
985 |
-
|
986 |
-
margin-bottom: 10px;
|
987 |
-
width: auto;
|
988 |
-
}
|
989 |
}
|
140 |
#opinionstage-content .opinionstage-dashboard-section {
|
141 |
margin-bottom: 30px;
|
142 |
}
|
143 |
+
#opinionstage-content .opinionstage-dashboard-section .opinionstage-section-header.opinionstage-overflow-visible {
|
144 |
+
overflow: visible;
|
145 |
+
}
|
146 |
+
.opinionstage-my-items-message {
|
147 |
+
display: none;
|
148 |
+
font-size: 16px;
|
149 |
+
text-align: center;
|
150 |
+
}
|
151 |
+
#opinionstage-failed-load-items-request {
|
152 |
+
display: none;
|
153 |
+
font-size: 15px;
|
154 |
+
text-align: center;
|
155 |
+
}
|
156 |
#opinionstage-content .opinionstage-dashboard-section .opinionstage-section-header {
|
157 |
height: 58px;
|
158 |
margin-top: 10px;
|
162 |
float: left;
|
163 |
font-size: 30px;
|
164 |
padding: 0;
|
165 |
+
line-height: 1;
|
166 |
}
|
167 |
#opinionstage-content .opinionstage-dashboard-section .opinionstage-section-header a {
|
168 |
float: left;
|
176 |
display: table;
|
177 |
border-collapse: collapse;
|
178 |
width: 100%;
|
179 |
+
position: relative;
|
180 |
}
|
181 |
#opinionstage-content .opinionstage-dashboard-section .opinionstage-video-container {
|
182 |
height: 0;
|
248 |
#opinionstage-section-create .opinionstage-section-cell.opinionstage-btn-cell {
|
249 |
width: 10%;
|
250 |
}
|
251 |
+
#opinionstage-section-create .opinionstage-section-cell.opinionstage-description-cell .title {
|
252 |
font-size: 22px;
|
253 |
font-weight: 600;
|
254 |
margin-bottom: 5px;
|
255 |
+
color: #3c434a;
|
256 |
+
text-decoration: none;
|
257 |
}
|
258 |
+
#opinionstage-section-create .opinionstage-section-cell.opinionstage-description-cell .example {
|
|
|
|
|
|
|
259 |
color: #b1b1b1;
|
260 |
font-size: 14px;
|
261 |
line-height: normal;
|
262 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
263 |
#opinionstage-section-help .opinionstage-section-content {
|
264 |
height: 307px;
|
265 |
}
|
268 |
margin-bottom: 5px;
|
269 |
text-decoration: none;
|
270 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
271 |
/* Getting started */
|
272 |
.gettingStartedSection {
|
273 |
background: #fff;
|
384 |
/* My Items Page Css */
|
385 |
td.long {
|
386 |
padding-left: 10px;
|
387 |
+
width: 48%;
|
388 |
}
|
389 |
td.long > div {
|
390 |
position: relative;
|
409 |
float: left;
|
410 |
margin-right: 10px;
|
411 |
}
|
412 |
+
.icon-os-common-date:before {
|
413 |
+
content: "\E91A";
|
414 |
+
}
|
415 |
.label {
|
416 |
line-height: 15px;
|
417 |
}
|
464 |
height: 90px;
|
465 |
position: relative;
|
466 |
width: 120px;
|
467 |
+
background-repeat: no-repeat;
|
468 |
+
background-size: cover;
|
469 |
}
|
470 |
.content-item-image.quiz img {
|
471 |
bottom: 0;
|
541 |
|
542 |
/* Load More */
|
543 |
div#opinionstage-load-more {
|
544 |
+
display: none;
|
545 |
cursor:pointer;
|
546 |
-webkit-box-sizing: border-box;
|
547 |
box-sizing: border-box;
|
627 |
float: right;
|
628 |
position: relative;
|
629 |
}
|
630 |
+
.opinionstage-header-inner-container .select-wrapper {
|
631 |
+
padding: 0 9px;
|
632 |
+
width: 150px;
|
633 |
+
display: inline-block;
|
634 |
+
position: relative;
|
635 |
+
}
|
636 |
.opinionstage-header-inner-container .opinionstage-header-inner-section {
|
637 |
border-right: 1px solid #f3f3f3;
|
638 |
float: left;
|
689 |
color: #444;
|
690 |
margin: 0;
|
691 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
692 |
.gettingStartedContainer {
|
693 |
background: url(../images/bitmap_top.png) no-repeat 0 0;
|
694 |
background-color: #32adbc;
|
702 |
.gettingBlockContainer {
|
703 |
width: 760px;
|
704 |
}
|
705 |
+
.gettingTemplateGallery, .gettingTemplateTutorial {
|
706 |
border: 2px solid #32adbc;
|
707 |
color: #32adbc;
|
708 |
font-size: 15px;
|
714 |
width: 100%;
|
715 |
max-width: 370px;
|
716 |
}
|
717 |
+
.gettingTemplateGallery,.gettingTemplateTutorial {
|
718 |
float: left;
|
719 |
}
|
720 |
.gettingTemplateTutorial {
|
721 |
margin-right: 10px;
|
722 |
}
|
723 |
+
.gettingTemplateGallery:hover, .gettingTemplateTutorial:hover {
|
724 |
background-color: rgba(49, 174, 190, 0.1);
|
725 |
color: #32adbc;
|
726 |
}
|
727 |
+
.gettingTemplateGallery:focus, .gettingTemplateTutorial:focus {
|
728 |
background-color: rgba(49, 174, 190, 0.1);
|
729 |
box-shadow: none;
|
730 |
color: #32adbc;
|
749 |
.opinionstage-item-view-dashboard #opinionstage-items-table {
|
750 |
width: 100%;
|
751 |
}
|
752 |
+
.opinionstage-item-view-dashboard #opinionstage-items-table div.label {
|
753 |
+
font-size: 13px;
|
754 |
+
}
|
755 |
.opinionstage-item-create:before {
|
756 |
bottom: 0;
|
757 |
content: "+";
|
788 |
box-shadow: none;
|
789 |
color: #32adbc;
|
790 |
}
|
791 |
+
|
792 |
+
|
793 |
+
/* my items page - modal form --start */
|
794 |
+
#opinionistage-my-items-page-modal-wrapper {
|
795 |
+
display: none;
|
796 |
+
position: fixed;
|
797 |
+
height: 100%;
|
798 |
+
width: 100%;
|
799 |
+
bottom: 0;
|
800 |
+
left: 0;
|
801 |
+
border-radius: 6px / 6px;
|
802 |
+
background-color: rgba(0,0,0,.8);
|
803 |
+
z-index: 9999;
|
804 |
+
-webkit-user-select: none;
|
805 |
+
-moz-user-select: none;
|
806 |
+
-ms-user-select: none;
|
807 |
+
user-select: none;
|
808 |
+
}
|
809 |
+
#opinionistage-my-items-page-modal-wrapper .inner {
|
810 |
+
background: #f5f5f5;
|
811 |
+
padding: 1px 15px 10px 15px;
|
812 |
+
margin-top: 20px;
|
813 |
+
}
|
814 |
+
#opinionistage-my-items-page-modal-wrapper .opinionistage-my-items-page-modal {
|
815 |
+
background-color: #fff;
|
816 |
+
position: absolute;
|
817 |
+
top: 50%;
|
818 |
+
left: 50%;
|
819 |
+
transform: translate(-50%, -50%);
|
820 |
+
-webkit-border-radius: 6px;
|
821 |
+
border-radius: 6px;
|
822 |
+
box-shadow: 0 0 6px rgb(0 0 0 / 30%), inset 0 0 5px rgb(161 142 16 / 0%);
|
823 |
+
overflow: hidden;
|
824 |
+
width: 650px;
|
825 |
+
padding: 25px 35px;
|
826 |
+
font-size: 14px;
|
827 |
+
}
|
828 |
+
#opinionistage-my-items-page-modal-wrapper .opinionistage-my-items-page-modal a {
|
829 |
+
color: #32adbc;
|
830 |
+
}
|
831 |
+
#opinionistage-my-items-page-modal-wrapper .opinionistage-my-items-page-modal a:focus {
|
832 |
+
outline: none;
|
833 |
+
box-shadow: none
|
834 |
+
}
|
835 |
+
#opinionistage-my-items-page-modal-wrapper .opinionistage-my-items-page-modal a.no-text-decoration {
|
836 |
+
text-decoration: none;
|
837 |
}
|
838 |
+
|
839 |
+
#opinionistage-my-items-page-modal-wrapper .opinionistage-my-items-page-modal p {
|
840 |
+
font-size: 14px;
|
841 |
}
|
842 |
+
|
843 |
+
#opinionistage-my-items-page-modal-wrapper .opinionstage-textarea-wrapper {
|
844 |
+
display: flex;
|
845 |
+
align-items: center;
|
846 |
+
}
|
847 |
+
#opinionistage-my-items-page-modal-wrapper .opinionstage-textarea-wrapper textarea {
|
848 |
+
resize: none;
|
849 |
+
margin: 10px 10px 10px 0;
|
850 |
+
padding: 10px;
|
851 |
+
width: 500px;
|
852 |
+
border-radius: 0 0 3px 3px;
|
853 |
+
border: 1px solid #3aaebd;
|
854 |
+
background: #fff;
|
855 |
+
}
|
856 |
+
#opinionistage-my-items-page-modal-wrapper .opinionstage-textarea-wrapper textarea:focus {
|
857 |
+
box-shadow: none;
|
858 |
}
|
859 |
+
|
860 |
+
#opinionistage-my-items-page-modal-wrapper .opinionstage-close {
|
861 |
+
position: absolute;
|
862 |
+
right: 16px;
|
863 |
+
top: 12px;
|
864 |
+
width: 20px;
|
865 |
+
height: 20px;
|
866 |
+
cursor: pointer;
|
867 |
}
|
868 |
+
#opinionistage-my-items-page-modal-wrapper ol {
|
869 |
+
margin-left: 17px;
|
870 |
}
|
871 |
+
#opinionistage-my-items-page-modal-wrapper ol li {
|
872 |
+
margin-bottom: 15px;
|
873 |
}
|
874 |
+
#opinionistage-my-items-page-modal-wrapper .opinionstage-close:before,
|
875 |
+
#opinionistage-my-items-page-modal-wrapper .opinionstage-close:after {
|
876 |
+
position: absolute;
|
877 |
+
left: 15px;
|
878 |
+
content: ' ';
|
879 |
+
height: 17px;
|
880 |
+
width: 2px;
|
881 |
+
background-color: #b1b1b1;
|
882 |
}
|
883 |
+
#opinionistage-my-items-page-modal-wrapper .opinionstage-close:after {
|
884 |
+
transform: rotate(-45deg);
|
|
|
885 |
}
|
886 |
+
#opinionistage-my-items-page-modal-wrapper .opinionstage-close:before {
|
887 |
+
transform: rotate(45deg);
|
888 |
}
|
889 |
+
/* my items page - modal form --end */
|
890 |
|
|
|
|
|
|
|
891 |
|
892 |
+
@media only screen and (max-width: 1230px) {
|
893 |
+
#opinionstage-content .opinionstage-dashboard-left, #opinionstage-content .opinionstage-dashboard-right {
|
894 |
+
float: none;
|
895 |
+
width: auto;
|
896 |
+
}
|
897 |
+
|
898 |
+
.opinionstage-dashboard-section .opinionstage-btn-cell .template {
|
899 |
+
display: block !important;
|
900 |
+
}
|
901 |
+
|
902 |
+
.opinionstage-dashboard-section .opinionstage-btn-cell .os_create_new_btn {
|
903 |
+
margin-bottom: 10px;
|
904 |
+
margin-right: 0;
|
905 |
+
}
|
906 |
+
|
907 |
+
#opinionstage-content .opinionstage-item-view-dashboard .opinionstage-section-header .opinionstage-section-title {
|
908 |
+
padding: 25px 0;
|
909 |
+
}
|
910 |
+
|
911 |
+
#opinionstage-content .opinionstage-dashboard {
|
912 |
+
overflow-y: scroll;
|
913 |
+
}
|
914 |
+
|
915 |
+
.opinionstage-item-action-container {
|
916 |
+
float: none;
|
917 |
+
}
|
918 |
+
|
919 |
+
#opinionstage-items-table .action .opinionstage-item-action-container a {
|
920 |
+
display: block;
|
921 |
+
float: none;
|
922 |
+
margin-bottom: 10px;
|
923 |
+
width: 80%;
|
924 |
+
}
|
925 |
+
|
926 |
+
|
927 |
+
#opinionstage-content .opinionstage-item-view-dashboard .opinionstage-dashboard-section .opinionstage-section-header {
|
928 |
+
height: 95px;
|
929 |
+
}
|
930 |
+
|
931 |
+
#opinionstage-content .opinionstage-dashboard-section .opinionstage-section-header .opinionstage-header-inner-section a {
|
932 |
+
display: block;
|
933 |
+
float: none;
|
934 |
+
}
|
935 |
+
|
936 |
+
.search.search-container:before {
|
937 |
+
top: 36px;
|
938 |
+
}
|
939 |
+
|
940 |
+
#opinionstage-content .opinionstage-dashboard-section .opinionstage-section-header .opinionstage-header-inner-container .opinionstage-item-create {
|
941 |
+
margin-top: 36px;
|
942 |
+
}
|
943 |
+
|
944 |
+
tr.settingBorderOs > td {
|
945 |
+
display: block;
|
946 |
+
width: 100%;
|
947 |
+
}
|
948 |
+
.opinionstage-item-view-dashboard {
|
949 |
+
width: auto;
|
950 |
+
}
|
951 |
}
|
952 |
|
953 |
|
963 |
color: #3499c2;
|
964 |
}
|
965 |
@media only screen and (max-width: 768px) {
|
966 |
+
.gettingStartedSection {
|
967 |
+
width: auto;
|
968 |
+
}
|
969 |
+
|
970 |
+
.gettingStartedContainer, .gettingBlockContainer {
|
971 |
+
width: 100%;
|
972 |
+
}
|
973 |
+
|
974 |
+
.gettingBlockContainer .gettingTemplateGallery,
|
975 |
+
.gettingBlockContainer .gettingTemplateTutorial {
|
976 |
+
display: block;
|
977 |
+
float: none;
|
978 |
+
width: 100%;
|
979 |
+
}
|
|
|
|
|
|
|
980 |
}
|
admin/css/sidebar-widget.css
CHANGED
@@ -16,6 +16,7 @@
|
|
16 |
line-height: normal;
|
17 |
}
|
18 |
.opinionstage-sidebar-widget a.opinionstage-edit-content {
|
|
|
19 |
padding: 9px 17px;
|
20 |
}
|
21 |
.opinionstage-sidebar-widget a.opinionstage-edit-settings {
|
@@ -52,9 +53,7 @@
|
|
52 |
float: left;
|
53 |
margin-top: 10px;
|
54 |
}
|
55 |
-
|
56 |
-
float: right;
|
57 |
-
}*/
|
58 |
.opinionstage-sidebar-widget input[type="text"] {
|
59 |
padding: 10px;
|
60 |
width: 100%;
|
@@ -81,9 +80,9 @@
|
|
81 |
|
82 |
.wp-admin .opinionstage-sidebar-widget input[type=checkbox], input[type=radio] {
|
83 |
border: 1px solid #0085ba;
|
84 |
-
height: 20px;
|
85 |
width: 20px;
|
86 |
-
box-shadow: none;
|
87 |
border-radius: 2px;
|
88 |
}
|
89 |
.wp-admin .opinionstage-sidebar-widget input[type=checkbox]:checked:before {
|
@@ -158,4 +157,84 @@ h3.sidebar-widget-heading-label {
|
|
158 |
font-weight: normal;
|
159 |
margin-bottom: 0;
|
160 |
margin-top: 10px;
|
161 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
line-height: normal;
|
17 |
}
|
18 |
.opinionstage-sidebar-widget a.opinionstage-edit-content {
|
19 |
+
text-transform: uppercase;
|
20 |
padding: 9px 17px;
|
21 |
}
|
22 |
.opinionstage-sidebar-widget a.opinionstage-edit-settings {
|
53 |
float: left;
|
54 |
margin-top: 10px;
|
55 |
}
|
56 |
+
|
|
|
|
|
57 |
.opinionstage-sidebar-widget input[type="text"] {
|
58 |
padding: 10px;
|
59 |
width: 100%;
|
80 |
|
81 |
.wp-admin .opinionstage-sidebar-widget input[type=checkbox], input[type=radio] {
|
82 |
border: 1px solid #0085ba;
|
83 |
+
height: 20px;
|
84 |
width: 20px;
|
85 |
+
box-shadow: none;
|
86 |
border-radius: 2px;
|
87 |
}
|
88 |
.wp-admin .opinionstage-sidebar-widget input[type=checkbox]:checked:before {
|
157 |
font-weight: normal;
|
158 |
margin-bottom: 0;
|
159 |
margin-top: 10px;
|
160 |
+
}
|
161 |
+
|
162 |
+
.opinionstage-sidebar-enabled label {
|
163 |
+
font-weight: bold;
|
164 |
+
}
|
165 |
+
.opinionstage-selected-widget {
|
166 |
+
display: flex;
|
167 |
+
flex-direction: column;
|
168 |
+
text-align: center;
|
169 |
+
padding: 10px;
|
170 |
+
border: 1px solid #40aacd;
|
171 |
+
border-radius: 3px;
|
172 |
+
margin-bottom: 10px;
|
173 |
+
margin-top: 10px;
|
174 |
+
}
|
175 |
+
.opinionstage-clearfix {
|
176 |
+
clear: both;
|
177 |
+
}
|
178 |
+
.opinionstage-widget-data {
|
179 |
+
display: none;
|
180 |
+
}
|
181 |
+
.opinionstage-selected-widget .opinionstage-widget-img-url-wrapper {
|
182 |
+
position: relative;
|
183 |
+
}
|
184 |
+
.opinionstage-selected-widget .opinionstage-widget-img-url-wrapper img {
|
185 |
+
width: 100%;
|
186 |
+
}
|
187 |
+
|
188 |
+
.opinionstage-widget-overlay {
|
189 |
+
position: absolute;
|
190 |
+
top: 0;
|
191 |
+
bottom: 0;
|
192 |
+
left: 0;
|
193 |
+
right: 0;
|
194 |
+
height: 100%;
|
195 |
+
width: 100%;
|
196 |
+
opacity: 0;
|
197 |
+
transition: .5s ease;
|
198 |
+
background-color: #222120;
|
199 |
+
}
|
200 |
+
|
201 |
+
.opinionstage-widget-overlay .opinionstage-inner {
|
202 |
+
color: white;
|
203 |
+
font-size: 20px;
|
204 |
+
position: absolute;
|
205 |
+
top: 50%;
|
206 |
+
left: 50%;
|
207 |
+
transform: translate(-50%, -50%);
|
208 |
+
text-align: center;
|
209 |
+
}
|
210 |
+
|
211 |
+
.opinionstage-widget-overlay .opinionstage-inner a {
|
212 |
+
border-radius: 5px;
|
213 |
+
border: 1px solid #fff;
|
214 |
+
color: #fff;
|
215 |
+
background: transparent;
|
216 |
+
cursor: pointer;
|
217 |
+
display: block;
|
218 |
+
line-height: 1;
|
219 |
+
margin: 10px auto;
|
220 |
+
padding: 10px 8px;
|
221 |
+
text-align: center;
|
222 |
+
text-decoration: none;
|
223 |
+
text-transform: uppercase;
|
224 |
+
width: 140px;
|
225 |
+
}
|
226 |
+
|
227 |
+
.opinionstage-widget-overlay .opinionstage-inner a:hover {
|
228 |
+
color: #000 !important;
|
229 |
+
background: #fff !important;
|
230 |
+
}
|
231 |
+
|
232 |
+
|
233 |
+
.opinionstage-selected-widget .opinionstage-widget-img-url-wrapper:hover .opinionstage-widget-overlay {
|
234 |
+
opacity: 0.8;
|
235 |
+
}
|
236 |
+
|
237 |
+
.opinionstage-selected-widget .opinionstage-widget-title {
|
238 |
+
font-size: 15px;
|
239 |
+
padding-top: 10px;
|
240 |
+
}
|
admin/js/content-popup.js
CHANGED
@@ -10,7 +10,7 @@ var Ei=Object.freeze({}),Ci=Object.prototype.toString,Oi=v("slot,component",!0),
|
|
10 |
* See https://raw.githubusercontent.com/tildeio/rsvp.js/master/LICENSE
|
11 |
* @version 3.6.2
|
12 |
*/
|
13 |
-
function i(t,e){for(var n=0,o=t.length;n<o;n++)if(t[n]===e)return n;return-1}function a(t){var e=t._promiseCallbacks;return e||(e=t._promiseCallbacks={}),e}function s(t,e){if(2!==arguments.length)return xt[t];xt[t]=e}function c(t){var e=typeof t;return null!==t&&("object"===e||"function"===e)}function u(t){return"function"==typeof t}function l(t){return null!==t&&"object"==typeof t}function f(t){return null!==t&&"object"==typeof t}function p(){setTimeout(function(){for(var t=0;t<Ot.length;t++){var e=Ot[t],n=e.payload;n.guid=n.key+n.id,n.childGuid=n.key+n.childId,n.error&&(n.stack=n.error.stack),xt.trigger(e.name,e.payload)}Ot.length=0},50)}function d(t,e,n){1===Ot.push({name:t,payload:{key:e._guidKey,id:e._id,eventName:t,detail:e._result,childId:n&&n._id,label:e._label,timeStamp:Ct(),error:xt["instrument-with-stack"]?new Error(e._label):null}})&&p()}function h(t,e){var n=this;if(t&&"object"==typeof t&&t.constructor===n)return t;var o=new n(m,e);return x(o,t),o}function v(){return new TypeError("A promises callback cannot return that same promise.")}function m(){}function g(t){try{return t.then}catch(t){return At.error=t,At}}function y(t,e,n,o){try{t.call(e,n,o)}catch(t){return t}}function b(t,e,n){xt.async(function(t){var o=!1,r=y(n,e,function(n){o||(o=!0,e!==n?x(t,n,void 0):E(t,n))},function(e){o||(o=!0,C(t,e))},"Settle: "+(t._label||" unknown promise"));!o&&r&&(o=!0,C(t,r))},t)}function _(t,e){e._state===$t?E(t,e._result):e._state===St?(e._onError=null,C(t,e._result)):O(e,void 0,function(n){e!==n?x(t,n,void 0):E(t,n)},function(e){return C(t,e)})}function w(t,e,n){e.constructor===t.constructor&&n===I&&t.constructor.resolve===h?_(t,e):n===At?(C(t,At.error),At.error=null):u(n)?b(t,e,n):E(t,e)}function x(t,e){t===e?E(t,e):c(e)?w(t,e,g(e)):E(t,e)}function k(t){t._onError&&t._onError(t._result),T(t)}function E(t,e){t._state===Tt&&(t._result=e,t._state=$t,0===t._subscribers.length?xt.instrument&&d("fulfilled",t):xt.async(T,t))}function C(t,e){t._state===Tt&&(t._state=St,t._result=e,xt.async(k,t))}function O(t,e,n,o){var r=t._subscribers,i=r.length;t._onError=null,r[i]=e,r[i+$t]=n,r[i+St]=o,0===i&&t._state&&xt.async(T,t)}function T(t){var e=t._subscribers,n=t._state;if(xt.instrument&&d(n===$t?"fulfilled":"rejected",t),0!==e.length){for(var o=void 0,r=void 0,i=t._result,a=0;a<e.length;a+=3)o=e[a],r=e[a+n],o?A(n,o,r,i):r(i);t._subscribers.length=0}}function $(){this.error=null}function S(t,e){try{return t(e)}catch(t){return jt.error=t,jt}}function A(t,e,n,o){var r=u(n),i=void 0,a=void 0;if(r){if((i=S(n,o))===jt)a=i.error,i.error=null;else if(i===e)return void C(e,v())}else i=o;e._state!==Tt||(r&&void 0===a?x(e,i):void 0!==a?C(e,a):t===$t?E(e,i):t===St&&C(e,i))}function j(t,e){var n=!1;try{e(function(e){n||(n=!0,x(t,e))},function(e){n||(n=!0,C(t,e))})}catch(e){C(t,e)}}function I(t,e,n){var o=this,r=o._state;if(r===$t&&!t||r===St&&!e)return xt.instrument&&d("chained",o,o),o;o._onError=null;var i=new o.constructor(m,n),a=o._result;if(xt.instrument&&d("chained",o,i),r===Tt)O(o,i,t,e);else{var s=r===$t?t:e;xt.async(function(){return A(r,i,s,a)})}return i}function L(t,e,n){return t===$t?{state:"fulfilled",value:n}:{state:"rejected",reason:n}}function M(t,e){return Et(t)?new It(this,t,!0,e).promise:this.reject(new TypeError("Promise.all must be called with an array"),e)}function P(t,e){var n=this,o=new n(m,e);if(!Et(t))return C(o,new TypeError("Promise.race must be called with an array")),o;for(var r=0;o._state===Tt&&r<t.length;r++)O(n.resolve(t[r]),void 0,function(t){return x(o,t)},function(t){return C(o,t)});return o}function D(t,e){var n=this,o=new n(m,e);return C(o,t),o}function N(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function F(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function R(){this.value=void 0}function B(t){try{return t.then}catch(t){return Dt.value=t,Dt}}function W(t,e,n){try{t.apply(e,n)}catch(t){return Dt.value=t,Dt}}function U(t,e){for(var n={},o=t.length,r=new Array(o),i=0;i<o;i++)r[i]=t[i];for(var a=0;a<e.length;a++){n[e[a]]=r[a+1]}return n}function z(t){for(var e=t.length,n=new Array(e-1),o=1;o<e;o++)n[o-1]=t[o];return n}function H(t,e){return{then:function(n,o){return t.call(e,n,o)}}}function G(t,e){var n=function(){for(var n=this,o=arguments.length,r=new Array(o+1),i=!1,a=0;a<o;++a){var s=arguments[a];if(!i){if((i=q(s))===Nt){var c=new Pt(m);return C(c,Nt.value),c}i&&!0!==i&&(s=H(i,s))}r[a]=s}var u=new Pt(m);return r[o]=function(t,n){t?C(u,t):void 0===e?x(u,n):!0===e?x(u,z(arguments)):Et(e)?x(u,U(arguments,e)):x(u,n)},i?K(u,r,t,n):V(u,r,t,n)};return n.__proto__=t,n}function V(t,e,n,o){var r=W(n,o,e);return r===Dt&&C(t,r.value),t}function K(t,e,n,o){return Pt.all(e).then(function(e){var r=W(n,o,e);return r===Dt&&C(t,r.value),t})}function q(t){return!(!t||"object"!=typeof t)&&(t.constructor===Pt||B(t))}function J(t,e){return Pt.all(t,e)}function Z(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function Y(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function Q(t,e){return Et(t)?new Ft(Pt,t,e).promise:Pt.reject(new TypeError("Promise.allSettled must be called with an array"),e)}function X(t,e){return Pt.race(t,e)}function tt(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function et(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function nt(t,e){return l(t)?new Bt(Pt,t,e).promise:Pt.reject(new TypeError("Promise.hash must be called with an object"),e)}function ot(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function rt(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function it(t,e){return l(t)?new Wt(Pt,t,!1,e).promise:Pt.reject(new TypeError("RSVP.hashSettled must be called with an object"),e)}function at(t){throw setTimeout(function(){throw t}),t}function st(t){var e={resolve:void 0,reject:void 0};return e.promise=new Pt(function(t,n){e.resolve=t,e.reject=n},t),e}function ct(t,e,n){return Et(t)?u(e)?Pt.all(t,n).then(function(t){for(var o=t.length,r=new Array(o),i=0;i<o;i++)r[i]=e(t[i]);return Pt.all(r,n)}):Pt.reject(new TypeError("RSVP.map expects a function as a second argument"),n):Pt.reject(new TypeError("RSVP.map must be called with an array"),n)}function ut(t,e){return Pt.resolve(t,e)}function lt(t,e){return Pt.reject(t,e)}function ft(t,e){return Pt.all(t,e)}function pt(t,e){return Pt.resolve(t,e).then(function(t){return ft(t,e)})}function dt(t,e,n){return Et(t)||l(t)&&void 0!==t.then?u(e)?(Et(t)?ft(t,n):pt(t,n)).then(function(t){for(var o=t.length,r=new Array(o),i=0;i<o;i++)r[i]=e(t[i]);return ft(r,n).then(function(e){for(var n=new Array(o),r=0,i=0;i<o;i++)e[i]&&(n[r]=t[i],r++);return n.length=r,n})}):Pt.reject(new TypeError("RSVP.filter expects function as a second argument"),n):Pt.reject(new TypeError("RSVP.filter must be called with an array or promise"),n)}function ht(t,e){Jt[Ut]=t,Jt[Ut+1]=e,2===(Ut+=2)&&Zt()}function vt(){return void 0!==zt?function(){zt(gt)}:mt()}function mt(){return function(){return setTimeout(gt,1)}}function gt(){for(var t=0;t<Ut;t+=2){(0,Jt[t])(Jt[t+1]),Jt[t]=void 0,Jt[t+1]=void 0}Ut=0}function yt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function bt(){xt.on.apply(xt,arguments)}function _t(){xt.off.apply(xt,arguments)}n.d(e,"asap",function(){return ht}),n.d(e,"cast",function(){return Qt}),n.d(e,"Promise",function(){return Pt}),n.d(e,"EventTarget",function(){return wt}),n.d(e,"all",function(){return J}),n.d(e,"allSettled",function(){return Q}),n.d(e,"race",function(){return X}),n.d(e,"hash",function(){return nt}),n.d(e,"hashSettled",function(){return it}),n.d(e,"rethrow",function(){return at}),n.d(e,"defer",function(){return st}),n.d(e,"denodeify",function(){return G}),n.d(e,"configure",function(){return s}),n.d(e,"on",function(){return bt}),n.d(e,"off",function(){return _t}),n.d(e,"resolve",function(){return ut}),n.d(e,"reject",function(){return lt}),n.d(e,"map",function(){return ct}),n.d(e,"async",function(){return Xt}),n.d(e,"filter",function(){return dt});var wt={mixin:function(t){return t.on=this.on,t.off=this.off,t.trigger=this.trigger,t._promiseCallbacks=void 0,t},on:function(t,e){if("function"!=typeof e)throw new TypeError("Callback must be a function");var n=a(this),o=void 0;o=n[t],o||(o=n[t]=[]),-1===i(o,e)&&o.push(e)},off:function(t,e){var n=a(this),o=void 0,r=void 0;if(!e)return void(n[t]=[]);o=n[t],-1!==(r=i(o,e))&&o.splice(r,1)},trigger:function(t,e,n){var o=a(this),r=void 0;if(r=o[t])for(var i=0;i<r.length;i++)(0,r[i])(e,n)}},xt={instrument:!1};wt.mixin(xt);var kt=void 0;kt=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};var Et=kt,Ct=Date.now||function(){return(new Date).getTime()},Ot=[],Tt=void 0,$t=1,St=2,At=new $,jt=new $,It=function(){function t(t,e,n,o){this._instanceConstructor=t,this.promise=new t(m,o),this._abortOnReject=n,this._init.apply(this,arguments)}return t.prototype._init=function(t,e){var n=e.length||0;this.length=n,this._remaining=n,this._result=new Array(n),this._enumerate(e),0===this._remaining&&E(this.promise,this._result)},t.prototype._enumerate=function(t){for(var e=this.length,n=this.promise,o=0;n._state===Tt&&o<e;o++)this._eachEntry(t[o],o)},t.prototype._settleMaybeThenable=function(t,e){var n=this._instanceConstructor,o=n.resolve;if(o===h){var r=g(t);if(r===I&&t._state!==Tt)t._onError=null,this._settledAt(t._state,e,t._result);else if("function"!=typeof r)this._remaining--,this._result[e]=this._makeResult($t,e,t);else if(n===Pt){var i=new n(m);w(i,t,r),this._willSettleAt(i,e)}else this._willSettleAt(new n(function(e){return e(t)}),e)}else this._willSettleAt(o(t),e)},t.prototype._eachEntry=function(t,e){f(t)?this._settleMaybeThenable(t,e):(this._remaining--,this._result[e]=this._makeResult($t,e,t))},t.prototype._settledAt=function(t,e,n){var o=this.promise;o._state===Tt&&(this._abortOnReject&&t===St?C(o,n):(this._remaining--,this._result[e]=this._makeResult(t,e,n),0===this._remaining&&E(o,this._result)))},t.prototype._makeResult=function(t,e,n){return n},t.prototype._willSettleAt=function(t,e){var n=this;O(t,void 0,function(t){return n._settledAt($t,e,t)},function(t){return n._settledAt(St,e,t)})},t}(),Lt="rsvp_"+Ct()+"-",Mt=0,Pt=function(){function t(e,n){this._id=Mt++,this._label=n,this._state=void 0,this._result=void 0,this._subscribers=[],xt.instrument&&d("created",this),m!==e&&("function"!=typeof e&&N(),this instanceof t?j(this,e):F())}return t.prototype._onError=function(t){var e=this;xt.after(function(){e._onError&&xt.trigger("error",t,e._label)})},t.prototype.catch=function(t,e){return this.then(void 0,t,e)},t.prototype.finally=function(t,e){var n=this,o=n.constructor;return n.then(function(e){return o.resolve(t()).then(function(){return e})},function(e){return o.resolve(t()).then(function(){throw e})},e)},t}();Pt.cast=h,Pt.all=M,Pt.race=P,Pt.resolve=h,Pt.reject=D,Pt.prototype._guidKey=Lt,Pt.prototype.then=I;var Dt=new R,Nt=new R,Ft=function(t){function e(e,n,o){return Z(this,t.call(this,e,n,!1,o))}return Y(e,t),e}(It);Ft.prototype._makeResult=L;var Rt=Object.prototype.hasOwnProperty,Bt=function(t){function e(e,n){var o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=arguments[3];return tt(this,t.call(this,e,n,o,r))}return et(e,t),e.prototype._init=function(t,e){this._result={},this._enumerate(e),0===this._remaining&&E(this.promise,this._result)},e.prototype._enumerate=function(t){var e=this.promise,n=[];for(var o in t)Rt.call(t,o)&&n.push({position:o,entry:t[o]});var r=n.length;this._remaining=r;for(var i=void 0,a=0;e._state===Tt&&a<r;a++)i=n[a],this._eachEntry(i.entry,i.position)},e}(It),Wt=function(t){function e(e,n,o){return ot(this,t.call(this,e,n,!1,o))}return rt(e,t),e}(Bt);Wt.prototype._makeResult=L;var Ut=0,zt=void 0,Ht="undefined"!=typeof window?window:void 0,Gt=Ht||{},Vt=Gt.MutationObserver||Gt.WebKitMutationObserver,Kt="undefined"==typeof self&&void 0!==t&&"[object process]"==={}.toString.call(t),qt="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,Jt=new Array(1e3),Zt=void 0;Zt=Kt?function(){var e=t.nextTick,n=t.versions.node.match(/^(?:(\d+)\.)?(?:(\d+)\.)?(\*|\d+)$/);return Array.isArray(n)&&"0"===n[1]&&"10"===n[2]&&(e=o),function(){return e(gt)}}():Vt?function(){var t=0,e=new Vt(gt),n=document.createTextNode("");return e.observe(n,{characterData:!0}),function(){return n.data=t=++t%2}}():qt?function(){var t=new MessageChannel;return t.port1.onmessage=gt,function(){return t.port2.postMessage(0)}}():void 0===Ht?function(){try{var t=n(20);return zt=t.runOnLoop||t.runOnContext,vt()}catch(t){return mt()}}():mt();if("object"==typeof self)self;else{if("object"!=typeof r)throw new Error("no global: `self` or `global` found");r}var Yt;xt.async=ht,xt.after=function(t){return setTimeout(t,0)};var Qt=ut,Xt=function(t,e){return xt.async(t,e)};if("undefined"!=typeof window&&"object"==typeof window.__PROMISE_INSTRUMENTATION__){var te=window.__PROMISE_INSTRUMENTATION__;s("instrument",!0);for(var ee in te)te.hasOwnProperty(ee)&&bt(ee,te[ee])}var ne=(Yt={asap:ht,cast:Qt,Promise:Pt,EventTarget:wt,all:J,allSettled:Q,race:X,hash:nt,hashSettled:it,rethrow:at,defer:st,denodeify:G,configure:s,on:bt,off:_t,resolve:ut,reject:lt,map:ct},yt(Yt,"async",Xt),yt(Yt,"filter",dt),Yt);e.default=ne}.call(e,n(6),n(5).setImmediate,n(0))},function(t,e,n){(function(t,n){function o(t,e){return null==t?void 0:t[e]}function r(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}function i(t){return B.call(t)}function a(t){return!(!g(t)||c(t))&&(v(t)||r(t)?W:T).test(l(t))}function s(t,e){var n=o(t,e);return a(n)?n:void 0}function c(t){return!!N&&N in t}function u(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||P)}function l(t){if(null!=t){try{return F.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function f(t){return d(t)&&R.call(t,"callee")&&(!z.call(t,"callee")||B.call(t)==w)}function p(t){return null!=t&&m(t.length)&&!v(t)}function d(t){return y(t)&&p(t)}function h(t){if(p(t)&&(rt(t)||"string"==typeof t||"function"==typeof t.splice||it(t)||f(t)))return!t.length;var e=ot(t);if(e==E||e==C)return!t.size;if(Y||u(t))return!G(t).length;for(var n in t)if(R.call(t,n))return!1;return!0}function v(t){var e=g(t)?B.call(t):"";return e==x||e==k}function m(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=_}function g(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function y(t){return!!t&&"object"==typeof t}function b(){return!1}var _=9007199254740991,w="[object Arguments]",x="[object Function]",k="[object GeneratorFunction]",E="[object Map]",C="[object Set]",O=/[\\^$.*+?()[\]{}|]/g,T=/^\[object .+?Constructor\]$/,$="object"==typeof t&&t&&t.Object===Object&&t,S="object"==typeof self&&self&&self.Object===Object&&self,A=$||S||Function("return this")(),j="object"==typeof e&&e&&!e.nodeType&&e,I=j&&"object"==typeof n&&n&&!n.nodeType&&n,L=I&&I.exports===j,M=Function.prototype,P=Object.prototype,D=A["__core-js_shared__"],N=function(){var t=/[^.]+$/.exec(D&&D.keys&&D.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),F=M.toString,R=P.hasOwnProperty,B=P.toString,W=RegExp("^"+F.call(R).replace(O,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),U=L?A.Buffer:void 0,z=P.propertyIsEnumerable,H=U?U.isBuffer:void 0,G=function(t,e){return function(n){return t(e(n))}}(Object.keys,Object),V=s(A,"DataView"),K=s(A,"Map"),q=s(A,"Promise"),J=s(A,"Set"),Z=s(A,"WeakMap"),Y=!z.call({valueOf:1},"valueOf"),Q=l(V),X=l(K),tt=l(q),et=l(J),nt=l(Z),ot=i;(V&&"[object DataView]"!=ot(new V(new ArrayBuffer(1)))||K&&ot(new K)!=E||q&&"[object Promise]"!=ot(q.resolve())||J&&ot(new J)!=C||Z&&"[object WeakMap]"!=ot(new Z))&&(ot=function(t){var e=B.call(t),n="[object Object]"==e?t.constructor:void 0,o=n?l(n):void 0;if(o)switch(o){case Q:return"[object DataView]";case X:return E;case tt:return"[object Promise]";case et:return C;case nt:return"[object WeakMap]"}return e});var rt=Array.isArray,it=H||b;n.exports=h}).call(e,n(0),n(21)(t))},function(t,e){function n(t,e){return t?r.call(t,e):""}var o=Array.prototype,r=o.join;t.exports=n},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(7),r=jQuery;e.default={get:function(t,e,n){return new o.Promise(function(o,i){r.getJSON({url:t,beforeSend:function(t){t.setRequestHeader("Accept","application/vnd.api+json"),t.setRequestHeader("Content-Type","application/vnd.api+json"),t.setRequestHeader("OSWP-Plugin-Version",e),n&&t.setRequestHeader("OSWP-Client-Token",n)}}).done(o).fail(i)})}}},function(t,e,n){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}}(),a=n(12),s=o(a),c=n(17),u=o(c),l=n(2);window.OpinionStage&&void 0!==OpinionStage.contentPopup&&console.warn("[OpinionStage] content-popup APIs was already included"),function(t,e){function n(){var t=this;t.modal=new s.default({content:e("[data-opinionstage-content-popup-template]").html(),onCreate:function(e){t.app=new u.default(e)},onClose:function(e){t.app.isModalOpened=!1},onOpen:function(e){t.app.isModalOpened=!0}})}var o=function(){function t(){r(this,t),this.app=void 0,this.modal=void 0}return i(t,[{key:"open",value:function(t){var o=this,r=t.preselectWidgetType,i=t.onWidgetSelect;if("function"!=typeof i)throw new Error("onWidgetSelect must be a function");e(function(){o.app||n.call(o),o.app.widgetType=r||l.WIDGET_ALL,o.app.widgetSelectCb=i,o.modal.open()})}}]),t}();t.contentPopup=new o,t.contentPopup.WIDGET_ALL=l.WIDGET_ALL,t.contentPopup.WIDGET_POLL=l.WIDGET_POLL,t.contentPopup.WIDGET_SET=l.WIDGET_SET,t.contentPopup.WIDGET_SURVEY=l.WIDGET_SURVEY,t.contentPopup.WIDGET_SLIDESHOW=l.WIDGET_SLIDESHOW,t.contentPopup.WIDGET_TRIVIA_QUIZ=l.WIDGET_TRIVIA_QUIZ,t.contentPopup.WIDGET_PERSONALITY_QUIZ=l.WIDGET_PERSONALITY_QUIZ,t.contentPopup.WIDGET_LIST=l.WIDGET_LIST,t.contentPopup.WIDGET_FORM=l.WIDGET_FORM,t.contentPopup.WIDGET_STORY=l.WIDGET_STORY}(window.OpinionStage=window.OpinionStage||{},jQuery),jQuery(function(t){function e(t){wp.media.editor.insert(t.shortcode)}window.location.href.indexOf("modal_is_open")>-1&&(OpinionStage.contentPopup.open({onWidgetSelect:e}),modal.open()),t("body").on("click","[data-opinionstage-content-launch]",function(t){t.preventDefault(),OpinionStage.contentPopup.open({onWidgetSelect:e})})})},function(t,e,n){"use strict";function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}}(),i=n(13),a=function(t){return t&&t.__esModule?t:{default:t}}(i);n(14);var s=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,t),this.modal=new a.default.modal({closeMethods:["overlay","escape"],cssClass:["opinionstage-content-popup"],onClose:e.onClose,onOpen:e.onOpen}),this.modal.setContent(e.content),"function"==typeof e.onCreate&&e.onCreate(this)}return r(t,[{key:"open",value:function(){this.modal.open()}},{key:"close",value:function(){this.modal.close()}},{key:"checkOverflow",value:function(){this.modal.checkOverflow()}}]),t}();e.default=s},function(t,e,n){var o,r;!function(i,a){o=a,void 0!==(r="function"==typeof o?o.call(e,n,e,t):o)&&(t.exports=r)}(0,function(){function t(t){var e={onClose:null,onOpen:null,beforeClose:null,stickyFooter:!1,footer:!1,cssClass:[],closeLabel:"Close",closeMethods:["overlay","button","escape"]};this.opts=u({},e,t),this.init()}function e(){this.modalBoxFooter&&(this.modalBoxFooter.style.width=this.modalBox.clientWidth+"px",this.modalBoxFooter.style.left=this.modalBox.offsetLeft+"px")}function n(){this.modal=document.createElement("div"),this.modal.classList.add("tingle-modal"),0!==this.opts.closeMethods.length&&-1!==this.opts.closeMethods.indexOf("overlay")||this.modal.classList.add("tingle-modal--noOverlayClose"),this.modal.style.display="none",this.opts.cssClass.forEach(function(t){"string"==typeof t&&this.modal.classList.add(t)},this),-1!==this.opts.closeMethods.indexOf("button")&&(this.modalCloseBtn=document.createElement("button"),this.modalCloseBtn.classList.add("tingle-modal__close"),this.modalCloseBtnIcon=document.createElement("span"),this.modalCloseBtnIcon.classList.add("tingle-modal__closeIcon"),this.modalCloseBtnIcon.innerHTML="×",this.modalCloseBtnLabel=document.createElement("span"),this.modalCloseBtnLabel.classList.add("tingle-modal__closeLabel"),this.modalCloseBtnLabel.innerHTML=this.opts.closeLabel,this.modalCloseBtn.appendChild(this.modalCloseBtnIcon),this.modalCloseBtn.appendChild(this.modalCloseBtnLabel)),this.modalBox=document.createElement("div"),this.modalBox.classList.add("tingle-modal-box"),this.modalBoxContent=document.createElement("div"),this.modalBoxContent.classList.add("tingle-modal-box__content"),this.modalBox.appendChild(this.modalBoxContent),-1!==this.opts.closeMethods.indexOf("button")&&this.modal.appendChild(this.modalCloseBtn),this.modal.appendChild(this.modalBox)}function o(){this.modalBoxFooter=document.createElement("div"),this.modalBoxFooter.classList.add("tingle-modal-box__footer"),this.modalBox.appendChild(this.modalBoxFooter)}function r(){this._events={clickCloseBtn:this.close.bind(this),clickOverlay:a.bind(this),resize:this.checkOverflow.bind(this),keyboardNav:i.bind(this)},-1!==this.opts.closeMethods.indexOf("button")&&this.modalCloseBtn.addEventListener("click",this._events.clickCloseBtn),this.modal.addEventListener("mousedown",this._events.clickOverlay),window.addEventListener("resize",this._events.resize),document.addEventListener("keydown",this._events.keyboardNav)}function i(t){-1!==this.opts.closeMethods.indexOf("escape")&&27===t.which&&this.isOpen()&&this.close()}function a(t){-1!==this.opts.closeMethods.indexOf("overlay")&&!s(t.target,"tingle-modal")&&t.clientX<this.modal.clientWidth&&this.close()}function s(t,e){for(;(t=t.parentElement)&&!t.classList.contains(e););return t}function c(){-1!==this.opts.closeMethods.indexOf("button")&&this.modalCloseBtn.removeEventListener("click",this._events.clickCloseBtn),this.modal.removeEventListener("mousedown",this._events.clickOverlay),window.removeEventListener("resize",this._events.resize),document.removeEventListener("keydown",this._events.keyboardNav)}function u(){for(var t=1;t<arguments.length;t++)for(var e in arguments[t])arguments[t].hasOwnProperty(e)&&(arguments[0][e]=arguments[t][e]);return arguments[0]}var l=function(){var t,e=document.createElement("tingle-test-transition"),n={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(t in n)if(void 0!==e.style[t])return n[t]}();return t.prototype.init=function(){this.modal||(n.call(this),r.call(this),document.body.insertBefore(this.modal,document.body.firstChild),this.opts.footer&&this.addFooter())},t.prototype.destroy=function(){null!==this.modal&&(c.call(this),this.modal.parentNode.removeChild(this.modal),this.modal=null)},t.prototype.open=function(){this.modal.style.removeProperty?this.modal.style.removeProperty("display"):this.modal.style.removeAttribute("display"),document.body.classList.add("tingle-enabled"),this.setStickyFooter(this.opts.stickyFooter),this.modal.classList.add("tingle-modal--visible");var t=this;l?this.modal.addEventListener(l,function e(){"function"==typeof t.opts.onOpen&&t.opts.onOpen.call(t),t.modal.removeEventListener(l,e,!1)},!1):"function"==typeof t.opts.onOpen&&t.opts.onOpen.call(t),this.checkOverflow()},t.prototype.isOpen=function(){return!!this.modal.classList.contains("tingle-modal--visible")},t.prototype.close=function(){if("function"==typeof this.opts.beforeClose){if(!this.opts.beforeClose.call(this))return}document.body.classList.remove("tingle-enabled"),this.modal.classList.remove("tingle-modal--visible");var t=this;l?this.modal.addEventListener(l,function e(){t.modal.removeEventListener(l,e,!1),t.modal.style.display="none","function"==typeof t.opts.onClose&&t.opts.onClose.call(this)},!1):(t.modal.style.display="none","function"==typeof t.opts.onClose&&t.opts.onClose.call(this))},t.prototype.setContent=function(t){"string"==typeof t?this.modalBoxContent.innerHTML=t:(this.modalBoxContent.innerHTML="",this.modalBoxContent.appendChild(t))},t.prototype.getContent=function(){return this.modalBoxContent},t.prototype.addFooter=function(){o.call(this)},t.prototype.setFooterContent=function(t){this.modalBoxFooter.innerHTML=t},t.prototype.getFooterContent=function(){return this.modalBoxFooter},t.prototype.setStickyFooter=function(t){this.isOverflow()||(t=!1),t?this.modalBox.contains(this.modalBoxFooter)&&(this.modalBox.removeChild(this.modalBoxFooter),this.modal.appendChild(this.modalBoxFooter),this.modalBoxFooter.classList.add("tingle-modal-box__footer--sticky"),e.call(this),this.modalBoxContent.style["padding-bottom"]=this.modalBoxFooter.clientHeight+20+"px"):this.modalBoxFooter&&(this.modalBox.contains(this.modalBoxFooter)||(this.modal.removeChild(this.modalBoxFooter),this.modalBox.appendChild(this.modalBoxFooter),this.modalBoxFooter.style.width="auto",this.modalBoxFooter.style.left="",this.modalBoxContent.style["padding-bottom"]="",this.modalBoxFooter.classList.remove("tingle-modal-box__footer--sticky")))},t.prototype.addFooterBtn=function(t,e,n){var o=document.createElement("button");return o.innerHTML=t,o.addEventListener("click",n),"string"==typeof e&&e.length&&e.split(" ").forEach(function(t){o.classList.add(t)}),this.modalBoxFooter.appendChild(o),o},t.prototype.resize=function(){console.warn("Resize is deprecated and will be removed in version 1.0")},t.prototype.isOverflow=function(){var t=window.innerHeight;return this.modalBox.clientHeight>=t},t.prototype.checkOverflow=function(){this.modal.classList.contains("tingle-modal--visible")&&(this.isOverflow()?this.modal.classList.add("tingle-modal--overflow"):this.modal.classList.remove("tingle-modal--overflow"),!this.isOverflow()&&this.opts.stickyFooter?this.setStickyFooter(!1):this.isOverflow()&&this.opts.stickyFooter&&(e.call(this),this.setStickyFooter(!0)))},{modal:t}})},function(t,e,n){var o=n(15);"string"==typeof o&&(o=[[t.i,o,""]]);var r={};r.transform=void 0;n(4)(o,r);o.locals&&(t.exports=o.locals)},function(t,e,n){e=t.exports=n(3)(!1),e.push([t.i,".opinionstage-content-popup.tingle-modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:159900;display:flex;visibility:hidden;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-ms-flex-align:center;align-items:center;overflow:auto;background:rgba(0,0,0,.8);opacity:0;cursor:pointer;-webkit-transition:-webkit-transform .2s ease;transition:-webkit-transform .2s ease;transition:transform .2s ease;transition:transform .2s ease,-webkit-transform .2s ease}.opinionstage-content-popup.tingle-modal *{-webkit-box-sizing:border-box;box-sizing:border-box}.opinionstage-content-popup .tingle-modal-box{position:relative;-ms-flex-negative:0;flex-shrink:0;margin-top:auto;margin-bottom:auto;background:#fff;opacity:1;cursor:auto;-webkit-transition:-webkit-transform .3s cubic-bezier(.175,.885,.32,1.275);transition:-webkit-transform .3s cubic-bezier(.175,.885,.32,1.275);transition:transform .3s cubic-bezier(.175,.885,.32,1.275);transition:transform .3s cubic-bezier(.175,.885,.32,1.275),-webkit-transform .3s cubic-bezier(.175,.885,.32,1.275);-webkit-transform:scale(.8);transform:scale(.8)}@media only screen and (max-width:875px){.opinionstage-content-popup .tingle-modal-box{min-width:100%;overflow:hidden;width:100%}}.opinionstage-content-popup .tingle-modal-box__content{padding:0}.opinionstage-content-popup.tingle-modal--visible{visibility:visible;opacity:1}.opinionstage-content-popup.tingle-modal--visible .tingle-modal-box{-webkit-transform:scale(1);transform:scale(1)}@media (max-width:540px){.opinionstage-content-popup .tingle-modal-box{width:auto}.opinionstage-content-popup.tingle-modal{top:60px;display:block;width:100%}.opinionstage-content-popup.tingle-modal--overflow{padding:0}}.tingle-enabled{overflow:hidden;height:100%}.tingle-enabled .tingle-content-wrapper{-webkit-filter:blur(15px);filter:blur(15px)}",""])},function(t,e){t.exports=function(t){var e="undefined"!=typeof window&&window.location;if(!e)throw new Error("fixUrls requires window.location");if(!t||"string"!=typeof t)return t;var n=e.protocol+"//"+e.host,o=n+e.pathname.replace(/\/[^\/]*$/,"/");return t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(t,e){var r=e.trim().replace(/^"(.*)"$/,function(t,e){return e}).replace(/^'(.*)'$/,function(t,e){return e});if(/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/)/i.test(r))return t;var i;return i=0===r.indexOf("//")?r:0===r.indexOf("/")?n+r:o+r.replace(/^\.\//,""),"url("+JSON.stringify(i)+")"})}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return new r.default({el:"[data-opinionstage-content-popup]",data:{widgetType:i.WIDGET_ALL,widgetSelectCb:function(t){console.log("dumb widget insert callback, widget:",t)},showClientContent:!0,isClientLoggedIn:null,isModalOpened:!1},beforeMount:function(){this.isClientLoggedIn="1"===this.$el.dataset.opinionstageClientLoggedIn},methods:{closePopup:function(){t.close()},selectWidgetAndExit:function(t){this.widgetSelectCb(t),this.closePopup()}}})};var o=n(1),r=function(t){return t&&t.__esModule?t:{default:t}}(o);n(19),n(25),n(27),n(28);var i=n(2)},function(t,e,n){(function(t,e){!function(t,n){"use strict";function o(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n<e.length;n++)e[n]=arguments[n+1];var o={callback:t,args:e};return u[c]=o,s(c),c++}function r(t){delete u[t]}function i(t){var e=t.callback,o=t.args;switch(o.length){case 0:e();break;case 1:e(o[0]);break;case 2:e(o[0],o[1]);break;case 3:e(o[0],o[1],o[2]);break;default:e.apply(n,o)}}function a(t){if(l)setTimeout(a,0,t);else{var e=u[t];if(e){l=!0;try{i(e)}finally{r(t),l=!1}}}}if(!t.setImmediate){var s,c=1,u={},l=!1,f=t.document,p=Object.getPrototypeOf&&Object.getPrototypeOf(t);p=p&&p.setTimeout?p:t,"[object process]"==={}.toString.call(t.process)?function(){s=function(t){e.nextTick(function(){a(t)})}}():function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?function(){var e="setImmediate$"+Math.random()+"$",n=function(n){n.source===t&&"string"==typeof n.data&&0===n.data.indexOf(e)&&a(+n.data.slice(e.length))};t.addEventListener?t.addEventListener("message",n,!1):t.attachEvent("onmessage",n),s=function(n){t.postMessage(e+n,"*")}}():t.MessageChannel?function(){var t=new MessageChannel;t.port1.onmessage=function(t){a(t.data)},s=function(e){t.port2.postMessage(e)}}():f&&"onreadystatechange"in f.createElement("script")?function(){var t=f.documentElement;s=function(e){var n=f.createElement("script");n.onreadystatechange=function(){a(e),n.onreadystatechange=null,t.removeChild(n),n=null},t.appendChild(n)}}():function(){s=function(t){setTimeout(a,0,t)}}(),p.setImmediate=o,p.clearImmediate=r}}("undefined"==typeof self?void 0===t?this:t:self)}).call(e,n(0),n(6))},function(t,e,n){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}function r(){var t=this;return this.dataLoading=!0,(this.showClientContent?i:a).call(this,this.searchCriteria).then(function(){t.noMoreData=!u(t.$store.state.nextPageNumber),t.dataLoading=!1})}function i(t){return this.clientIsLoggedIn?this.$store.dispatch({type:"loadClientWidgets",widgetsUrl:this.clientWidgetsUrl,pluginVersion:this.pluginVersion,accessToken:this.accessKey,filtering:t}):g.default.resolve()}function a(t){return this.$store.dispatch({type:"loadTemplateWidgets",widgetsUrl:this.sharedWidgetsUrl,pluginVersion:this.pluginVersion,filtering:t})}function s(t,e,n){var o=[];return e&&o.push("type="+e),n&&o.push("updated_at="+n),(0,b.default)(o)?t:t+"?"+(0,w.default)(o,"&")}function c(t,e){var n=this,o=s(this.clientWidgetsHasNewUrl,t,e);return C.default.get(o,this.pluginVersion,this.accessKey).then(function(t){n.newWidgetsAvailable=t.data["has-new-widgets"]}).catch(function(t){console.error("[social-polls-by-opinionstage][content-popup] can't load widgets:",t.statusText)})}function u(t){return t>1}function l(){var t=this;c.call(this,this.searchCriteria.type,this.lastUpdateTime).then(function(){t.newWidgetsAvailable&&p.call(t)})}function f(){this.clientIsLoggedIn&&(this.isCheckingWidgetUpdates=!0,this.widgetUpdatesChecker=setInterval(l.bind(this),3e3))}function p(){this.isCheckingWidgetUpdates=!1,clearInterval(this.widgetUpdatesChecker)}function d(){void 0!==this.widgets[0]?this.lastUpdateTime=this.widgets[0].updatedAt:this.lastUpdateTime=null}Object.defineProperty(e,"__esModule",{value:!0});var h=n(1),v=o(h),m=n(7),g=o(m),y=n(8),b=o(y),_=n(9),w=o(_),x=n(22),k=o(x),E=n(10),C=o(E),O=n(2);e.default=v.default.component("popup-content",{template:"#opinionstage-popup-content",props:["showClientContent","clientIsLoggedIn","modalIsOpened","widgetType","clientWidgetsUrl","sharedWidgetsUrl","clientWidgetsHasNewUrl","accessKey","pluginVersion"],data:function(){return{dataLoading:!1,widgets:[],searchCriteria:{},noMoreData:!0,newWidgetsAvailable:!1,lastUpdateTime:null,isCheckingWidgetUpdates:!1,widgetUpdatesChecker:null}},store:k.default,methods:{reloadData:function(t){var e=this;t||(t={});var n=t.widgetType||this.widgetType||this.searchCriteria.type||O.WIDGET_ALL,o=t.widgetTitle||"";this.newWidgetsAvailable=!1,p.call(this),this.searchCriteria={page:1,perPage:9,type:n,title:o},this.$store.commit("clearWidgets"),r.call(this).then(function(){e.widgets=e.$store.state.widgets[0],e.searchCriteria.title||d.call(e),f.call(e)})},reloadAndRestartCheckingForUpdates:function(){this.reloadData({widgetType:this.searchCriteria.type,widgetTitle:""})},appendData:function(){var t=this;this.searchCriteria.page+=1,r.call(this).then(function(){var e=t.$store.state.widgets[t.searchCriteria.page-1];t.widgets=t.widgets.concat(e)})},widgetSelected:function(t){this.$emit("widget-selected",t)}},watch:{modalIsOpened:function(t){t&&this.showClientContent&&this.clientIsLoggedIn?this.reloadData():(this.newWidgetsAvailable=!1,p.call(this))},showClientContent:function(t){t&&this.modalIsOpened&&this.clientIsLoggedIn?f.call(this):p.call(this)}}})},function(t,e){},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}function r(t){return t.data.map(function(t){return{id:t.id,type:t.attributes.type,title:t.attributes.title,imageUrl:t.attributes["image-url"],updatedAt:t.attributes["updated-at"],landingPageUrl:t.attributes["landing-page-url"],editUrl:t.attributes["edit-url"],statsUrl:t.attributes["stats-url"],shortcode:t.attributes.shortcode}})}function i(t){return t.meta.nextPage}function a(t,e){var n=e.type,o=e.title,r=e.page,i=e.perPage,a=[];if(n&&a.push("type="+n),!(0,h.default)(o)){var s=(0,p.default)(o);(0,h.default)(s)||a.push("title_like="+s)}return r&&a.push("page="+r),i&&a.push("per_page="+i),(0,h.default)(a)?t:t+"?"+(0,m.default)(a,"&")}Object.defineProperty(e,"__esModule",{value:!0});var s=n(1),c=o(s),u=n(23),l=o(u),f=n(24),p=o(f),d=n(8),h=o(d),v=n(9),m=o(v),g=n(10),y=o(g);c.default.use(l.default),e.default=new l.default.Store({state:{widgets:[],nextPageNumber:null},mutations:{loadWidgets:function(t,e){var n=e.widgetsData;t.widgets.push(r(n)),t.nextPageNumber=i(n)},loadTemplateWidgets:function(t,e){var n=e.widgetsData;t.widgets.push(r(n).map(function(t){return t.template=!0,t})),t.nextPageNumber=i(n)},clearWidgets:function(t){t.widgets=[],t.nextPageNumber=null}},actions:{loadClientWidgets:function(t,e){return(0,t.dispatch)("load",{commitType:"loadWidgets",widgetsUrl:e.widgetsUrl,pluginVersion:e.pluginVersion,accessToken:e.accessToken,filtering:e.filtering})},loadTemplateWidgets:function(t,e){return(0,t.dispatch)("load",{commitType:"loadTemplateWidgets",widgetsUrl:e.widgetsUrl,pluginVersion:e.pluginVersion,filtering:e.filtering})},load:function(t,e){var n=t.commit,o=e.commitType,r=e.widgetsUrl,i=e.filtering,s=e.pluginVersion,c=e.accessToken,u=a(r,i);return y.default.get(u,s,c).then(function(t){n({type:o,widgetsData:t})}).catch(function(t){console.error("[social-polls-by-opinionstage][content-popup] can't load widgets:",t.statusText)})}}})},function(t,e,n){"use strict";function o(t){C&&(t._devtoolHook=C,C.emit("vuex:init",t),C.on("vuex:travel-to-state",function(e){t.replaceState(e)}),t.subscribe(function(t,e){C.emit("vuex:mutation",t,e)}))}function r(t,e){Object.keys(t).forEach(function(n){return e(t[n],n)})}function i(t){return null!==t&&"object"==typeof t}function a(t){return t&&"function"==typeof t.then}function s(t,e,n){if(e.update(n),n.modules)for(var o in n.modules){if(!e.getChild(o))return;s(t.concat(o),e.getChild(o),n.modules[o])}}function c(t,e){return e.indexOf(t)<0&&e.push(t),function(){var n=e.indexOf(t);n>-1&&e.splice(n,1)}}function u(t,e){t._actions=Object.create(null),t._mutations=Object.create(null),t._wrappedGetters=Object.create(null),t._modulesNamespaceMap=Object.create(null);var n=t.state;f(t,n,[],t._modules.root,!0),l(t,n,e)}function l(t,e,n){var o=t._vm;t.getters={};var i=t._wrappedGetters,a={};r(i,function(e,n){a[n]=function(){return e(t)},Object.defineProperty(t.getters,n,{get:function(){return t._vm[n]},enumerable:!0})});var s=S.config.silent;S.config.silent=!0,t._vm=new S({data:{$$state:e},computed:a}),S.config.silent=s,t.strict&&g(t),o&&(n&&t._withCommit(function(){o._data.$$state=null}),S.nextTick(function(){return o.$destroy()}))}function f(t,e,n,o,r){var i=!n.length,a=t._modules.getNamespace(n);if(o.namespaced&&(t._modulesNamespaceMap[a]=o),!i&&!r){var s=y(e,n.slice(0,-1)),c=n[n.length-1];t._withCommit(function(){S.set(s,c,o.state)})}var u=o.context=p(t,a,n);o.forEachMutation(function(e,n){h(t,a+n,e,u)}),o.forEachAction(function(e,n){var o=e.root?n:a+n,r=e.handler||e;v(t,o,r,u)}),o.forEachGetter(function(e,n){m(t,a+n,e,u)}),o.forEachChild(function(o,i){f(t,e,n.concat(i),o,r)})}function p(t,e,n){var o=""===e,r={dispatch:o?t.dispatch:function(n,o,r){var i=b(n,o,r),a=i.payload,s=i.options,c=i.type;return s&&s.root||(c=e+c),t.dispatch(c,a)},commit:o?t.commit:function(n,o,r){var i=b(n,o,r),a=i.payload,s=i.options,c=i.type;s&&s.root||(c=e+c),t.commit(c,a,s)}};return Object.defineProperties(r,{getters:{get:o?function(){return t.getters}:function(){return d(t,e)}},state:{get:function(){return y(t.state,n)}}}),r}function d(t,e){var n={},o=e.length;return Object.keys(t.getters).forEach(function(r){if(r.slice(0,o)===e){var i=r.slice(o);Object.defineProperty(n,i,{get:function(){return t.getters[r]},enumerable:!0})}}),n}function h(t,e,n,o){(t._mutations[e]||(t._mutations[e]=[])).push(function(e){n.call(t,o.state,e)})}function v(t,e,n,o){(t._actions[e]||(t._actions[e]=[])).push(function(e,r){var i=n.call(t,{dispatch:o.dispatch,commit:o.commit,getters:o.getters,state:o.state,rootGetters:t.getters,rootState:t.state},e,r);return a(i)||(i=Promise.resolve(i)),t._devtoolHook?i.catch(function(e){throw t._devtoolHook.emit("vuex:error",e),e}):i})}function m(t,e,n,o){t._wrappedGetters[e]||(t._wrappedGetters[e]=function(t){return n(o.state,o.getters,t.state,t.getters)})}function g(t){t._vm.$watch(function(){return this._data.$$state},function(){},{deep:!0,sync:!0})}function y(t,e){return e.length?e.reduce(function(t,e){return t[e]},t):t}function b(t,e,n){return i(t)&&t.type&&(n=e,e=t,t=t.type),{type:t,payload:e,options:n}}function _(t){S&&t===S||(S=t,E(S))}function w(t){return Array.isArray(t)?t.map(function(t){return{key:t,val:t}}):Object.keys(t).map(function(e){return{key:e,val:t[e]}})}function x(t){return function(e,n){return"string"!=typeof e?(n=e,e=""):"/"!==e.charAt(e.length-1)&&(e+="/"),t(e,n)}}function k(t,e,n){return t._modulesNamespaceMap[n]}Object.defineProperty(e,"__esModule",{value:!0}),n.d(e,"Store",function(){return A}),n.d(e,"install",function(){return _}),n.d(e,"mapState",function(){return I}),n.d(e,"mapMutations",function(){return L}),n.d(e,"mapGetters",function(){return M}),n.d(e,"mapActions",function(){return P}),n.d(e,"createNamespacedHelpers",function(){return D});/**
|
14 |
* vuex v2.5.0
|
15 |
* (c) 2017 Evan You
|
16 |
* @license MIT
|
10 |
* See https://raw.githubusercontent.com/tildeio/rsvp.js/master/LICENSE
|
11 |
* @version 3.6.2
|
12 |
*/
|
13 |
+
function i(t,e){for(var n=0,o=t.length;n<o;n++)if(t[n]===e)return n;return-1}function a(t){var e=t._promiseCallbacks;return e||(e=t._promiseCallbacks={}),e}function s(t,e){if(2!==arguments.length)return xt[t];xt[t]=e}function c(t){var e=typeof t;return null!==t&&("object"===e||"function"===e)}function u(t){return"function"==typeof t}function l(t){return null!==t&&"object"==typeof t}function f(t){return null!==t&&"object"==typeof t}function p(){setTimeout(function(){for(var t=0;t<Ot.length;t++){var e=Ot[t],n=e.payload;n.guid=n.key+n.id,n.childGuid=n.key+n.childId,n.error&&(n.stack=n.error.stack),xt.trigger(e.name,e.payload)}Ot.length=0},50)}function d(t,e,n){1===Ot.push({name:t,payload:{key:e._guidKey,id:e._id,eventName:t,detail:e._result,childId:n&&n._id,label:e._label,timeStamp:Ct(),error:xt["instrument-with-stack"]?new Error(e._label):null}})&&p()}function h(t,e){var n=this;if(t&&"object"==typeof t&&t.constructor===n)return t;var o=new n(m,e);return x(o,t),o}function v(){return new TypeError("A promises callback cannot return that same promise.")}function m(){}function g(t){try{return t.then}catch(t){return At.error=t,At}}function y(t,e,n,o){try{t.call(e,n,o)}catch(t){return t}}function b(t,e,n){xt.async(function(t){var o=!1,r=y(n,e,function(n){o||(o=!0,e!==n?x(t,n,void 0):E(t,n))},function(e){o||(o=!0,C(t,e))},"Settle: "+(t._label||" unknown promise"));!o&&r&&(o=!0,C(t,r))},t)}function _(t,e){e._state===$t?E(t,e._result):e._state===St?(e._onError=null,C(t,e._result)):O(e,void 0,function(n){e!==n?x(t,n,void 0):E(t,n)},function(e){return C(t,e)})}function w(t,e,n){e.constructor===t.constructor&&n===I&&t.constructor.resolve===h?_(t,e):n===At?(C(t,At.error),At.error=null):u(n)?b(t,e,n):E(t,e)}function x(t,e){t===e?E(t,e):c(e)?w(t,e,g(e)):E(t,e)}function k(t){t._onError&&t._onError(t._result),T(t)}function E(t,e){t._state===Tt&&(t._result=e,t._state=$t,0===t._subscribers.length?xt.instrument&&d("fulfilled",t):xt.async(T,t))}function C(t,e){t._state===Tt&&(t._state=St,t._result=e,xt.async(k,t))}function O(t,e,n,o){var r=t._subscribers,i=r.length;t._onError=null,r[i]=e,r[i+$t]=n,r[i+St]=o,0===i&&t._state&&xt.async(T,t)}function T(t){var e=t._subscribers,n=t._state;if(xt.instrument&&d(n===$t?"fulfilled":"rejected",t),0!==e.length){for(var o=void 0,r=void 0,i=t._result,a=0;a<e.length;a+=3)o=e[a],r=e[a+n],o?A(n,o,r,i):r(i);t._subscribers.length=0}}function $(){this.error=null}function S(t,e){try{return t(e)}catch(t){return jt.error=t,jt}}function A(t,e,n,o){var r=u(n),i=void 0,a=void 0;if(r){if((i=S(n,o))===jt)a=i.error,i.error=null;else if(i===e)return void C(e,v())}else i=o;e._state!==Tt||(r&&void 0===a?x(e,i):void 0!==a?C(e,a):t===$t?E(e,i):t===St&&C(e,i))}function j(t,e){var n=!1;try{e(function(e){n||(n=!0,x(t,e))},function(e){n||(n=!0,C(t,e))})}catch(e){C(t,e)}}function I(t,e,n){var o=this,r=o._state;if(r===$t&&!t||r===St&&!e)return xt.instrument&&d("chained",o,o),o;o._onError=null;var i=new o.constructor(m,n),a=o._result;if(xt.instrument&&d("chained",o,i),r===Tt)O(o,i,t,e);else{var s=r===$t?t:e;xt.async(function(){return A(r,i,s,a)})}return i}function L(t,e,n){return t===$t?{state:"fulfilled",value:n}:{state:"rejected",reason:n}}function M(t,e){return Et(t)?new It(this,t,!0,e).promise:this.reject(new TypeError("Promise.all must be called with an array"),e)}function P(t,e){var n=this,o=new n(m,e);if(!Et(t))return C(o,new TypeError("Promise.race must be called with an array")),o;for(var r=0;o._state===Tt&&r<t.length;r++)O(n.resolve(t[r]),void 0,function(t){return x(o,t)},function(t){return C(o,t)});return o}function D(t,e){var n=this,o=new n(m,e);return C(o,t),o}function N(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function F(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function R(){this.value=void 0}function B(t){try{return t.then}catch(t){return Dt.value=t,Dt}}function W(t,e,n){try{t.apply(e,n)}catch(t){return Dt.value=t,Dt}}function U(t,e){for(var n={},o=t.length,r=new Array(o),i=0;i<o;i++)r[i]=t[i];for(var a=0;a<e.length;a++){n[e[a]]=r[a+1]}return n}function z(t){for(var e=t.length,n=new Array(e-1),o=1;o<e;o++)n[o-1]=t[o];return n}function H(t,e){return{then:function(n,o){return t.call(e,n,o)}}}function G(t,e){var n=function(){for(var n=this,o=arguments.length,r=new Array(o+1),i=!1,a=0;a<o;++a){var s=arguments[a];if(!i){if((i=q(s))===Nt){var c=new Pt(m);return C(c,Nt.value),c}i&&!0!==i&&(s=H(i,s))}r[a]=s}var u=new Pt(m);return r[o]=function(t,n){t?C(u,t):void 0===e?x(u,n):!0===e?x(u,z(arguments)):Et(e)?x(u,U(arguments,e)):x(u,n)},i?K(u,r,t,n):V(u,r,t,n)};return n.__proto__=t,n}function V(t,e,n,o){var r=W(n,o,e);return r===Dt&&C(t,r.value),t}function K(t,e,n,o){return Pt.all(e).then(function(e){var r=W(n,o,e);return r===Dt&&C(t,r.value),t})}function q(t){return!(!t||"object"!=typeof t)&&(t.constructor===Pt||B(t))}function J(t,e){return Pt.all(t,e)}function Z(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function Y(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function Q(t,e){return Et(t)?new Ft(Pt,t,e).promise:Pt.reject(new TypeError("Promise.allSettled must be called with an array"),e)}function X(t,e){return Pt.race(t,e)}function tt(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function et(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function nt(t,e){return l(t)?new Bt(Pt,t,e).promise:Pt.reject(new TypeError("Promise.hash must be called with an object"),e)}function ot(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function rt(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function it(t,e){return l(t)?new Wt(Pt,t,!1,e).promise:Pt.reject(new TypeError("RSVP.hashSettled must be called with an object"),e)}function at(t){throw setTimeout(function(){throw t}),t}function st(t){var e={resolve:void 0,reject:void 0};return e.promise=new Pt(function(t,n){e.resolve=t,e.reject=n},t),e}function ct(t,e,n){return Et(t)?u(e)?Pt.all(t,n).then(function(t){for(var o=t.length,r=new Array(o),i=0;i<o;i++)r[i]=e(t[i]);return Pt.all(r,n)}):Pt.reject(new TypeError("RSVP.map expects a function as a second argument"),n):Pt.reject(new TypeError("RSVP.map must be called with an array"),n)}function ut(t,e){return Pt.resolve(t,e)}function lt(t,e){return Pt.reject(t,e)}function ft(t,e){return Pt.all(t,e)}function pt(t,e){return Pt.resolve(t,e).then(function(t){return ft(t,e)})}function dt(t,e,n){return Et(t)||l(t)&&void 0!==t.then?u(e)?(Et(t)?ft(t,n):pt(t,n)).then(function(t){for(var o=t.length,r=new Array(o),i=0;i<o;i++)r[i]=e(t[i]);return ft(r,n).then(function(e){for(var n=new Array(o),r=0,i=0;i<o;i++)e[i]&&(n[r]=t[i],r++);return n.length=r,n})}):Pt.reject(new TypeError("RSVP.filter expects function as a second argument"),n):Pt.reject(new TypeError("RSVP.filter must be called with an array or promise"),n)}function ht(t,e){Jt[Ut]=t,Jt[Ut+1]=e,2===(Ut+=2)&&Zt()}function vt(){return void 0!==zt?function(){zt(gt)}:mt()}function mt(){return function(){return setTimeout(gt,1)}}function gt(){for(var t=0;t<Ut;t+=2){(0,Jt[t])(Jt[t+1]),Jt[t]=void 0,Jt[t+1]=void 0}Ut=0}function yt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function bt(){xt.on.apply(xt,arguments)}function _t(){xt.off.apply(xt,arguments)}n.d(e,"asap",function(){return ht}),n.d(e,"cast",function(){return Qt}),n.d(e,"Promise",function(){return Pt}),n.d(e,"EventTarget",function(){return wt}),n.d(e,"all",function(){return J}),n.d(e,"allSettled",function(){return Q}),n.d(e,"race",function(){return X}),n.d(e,"hash",function(){return nt}),n.d(e,"hashSettled",function(){return it}),n.d(e,"rethrow",function(){return at}),n.d(e,"defer",function(){return st}),n.d(e,"denodeify",function(){return G}),n.d(e,"configure",function(){return s}),n.d(e,"on",function(){return bt}),n.d(e,"off",function(){return _t}),n.d(e,"resolve",function(){return ut}),n.d(e,"reject",function(){return lt}),n.d(e,"map",function(){return ct}),n.d(e,"async",function(){return Xt}),n.d(e,"filter",function(){return dt});var wt={mixin:function(t){return t.on=this.on,t.off=this.off,t.trigger=this.trigger,t._promiseCallbacks=void 0,t},on:function(t,e){if("function"!=typeof e)throw new TypeError("Callback must be a function");var n=a(this),o=void 0;o=n[t],o||(o=n[t]=[]),-1===i(o,e)&&o.push(e)},off:function(t,e){var n=a(this),o=void 0,r=void 0;if(!e)return void(n[t]=[]);o=n[t],-1!==(r=i(o,e))&&o.splice(r,1)},trigger:function(t,e,n){var o=a(this),r=void 0;if(r=o[t])for(var i=0;i<r.length;i++)(0,r[i])(e,n)}},xt={instrument:!1};wt.mixin(xt);var kt=void 0;kt=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};var Et=kt,Ct=Date.now||function(){return(new Date).getTime()},Ot=[],Tt=void 0,$t=1,St=2,At=new $,jt=new $,It=function(){function t(t,e,n,o){this._instanceConstructor=t,this.promise=new t(m,o),this._abortOnReject=n,this._init.apply(this,arguments)}return t.prototype._init=function(t,e){var n=e.length||0;this.length=n,this._remaining=n,this._result=new Array(n),this._enumerate(e),0===this._remaining&&E(this.promise,this._result)},t.prototype._enumerate=function(t){for(var e=this.length,n=this.promise,o=0;n._state===Tt&&o<e;o++)this._eachEntry(t[o],o)},t.prototype._settleMaybeThenable=function(t,e){var n=this._instanceConstructor,o=n.resolve;if(o===h){var r=g(t);if(r===I&&t._state!==Tt)t._onError=null,this._settledAt(t._state,e,t._result);else if("function"!=typeof r)this._remaining--,this._result[e]=this._makeResult($t,e,t);else if(n===Pt){var i=new n(m);w(i,t,r),this._willSettleAt(i,e)}else this._willSettleAt(new n(function(e){return e(t)}),e)}else this._willSettleAt(o(t),e)},t.prototype._eachEntry=function(t,e){f(t)?this._settleMaybeThenable(t,e):(this._remaining--,this._result[e]=this._makeResult($t,e,t))},t.prototype._settledAt=function(t,e,n){var o=this.promise;o._state===Tt&&(this._abortOnReject&&t===St?C(o,n):(this._remaining--,this._result[e]=this._makeResult(t,e,n),0===this._remaining&&E(o,this._result)))},t.prototype._makeResult=function(t,e,n){return n},t.prototype._willSettleAt=function(t,e){var n=this;O(t,void 0,function(t){return n._settledAt($t,e,t)},function(t){return n._settledAt(St,e,t)})},t}(),Lt="rsvp_"+Ct()+"-",Mt=0,Pt=function(){function t(e,n){this._id=Mt++,this._label=n,this._state=void 0,this._result=void 0,this._subscribers=[],xt.instrument&&d("created",this),m!==e&&("function"!=typeof e&&N(),this instanceof t?j(this,e):F())}return t.prototype._onError=function(t){var e=this;xt.after(function(){e._onError&&xt.trigger("error",t,e._label)})},t.prototype.catch=function(t,e){return this.then(void 0,t,e)},t.prototype.finally=function(t,e){var n=this,o=n.constructor;return n.then(function(e){return o.resolve(t()).then(function(){return e})},function(e){return o.resolve(t()).then(function(){throw e})},e)},t}();Pt.cast=h,Pt.all=M,Pt.race=P,Pt.resolve=h,Pt.reject=D,Pt.prototype._guidKey=Lt,Pt.prototype.then=I;var Dt=new R,Nt=new R,Ft=function(t){function e(e,n,o){return Z(this,t.call(this,e,n,!1,o))}return Y(e,t),e}(It);Ft.prototype._makeResult=L;var Rt=Object.prototype.hasOwnProperty,Bt=function(t){function e(e,n){var o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=arguments[3];return tt(this,t.call(this,e,n,o,r))}return et(e,t),e.prototype._init=function(t,e){this._result={},this._enumerate(e),0===this._remaining&&E(this.promise,this._result)},e.prototype._enumerate=function(t){var e=this.promise,n=[];for(var o in t)Rt.call(t,o)&&n.push({position:o,entry:t[o]});var r=n.length;this._remaining=r;for(var i=void 0,a=0;e._state===Tt&&a<r;a++)i=n[a],this._eachEntry(i.entry,i.position)},e}(It),Wt=function(t){function e(e,n,o){return ot(this,t.call(this,e,n,!1,o))}return rt(e,t),e}(Bt);Wt.prototype._makeResult=L;var Ut=0,zt=void 0,Ht="undefined"!=typeof window?window:void 0,Gt=Ht||{},Vt=Gt.MutationObserver||Gt.WebKitMutationObserver,Kt="undefined"==typeof self&&void 0!==t&&"[object process]"==={}.toString.call(t),qt="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,Jt=new Array(1e3),Zt=void 0;Zt=Kt?function(){var e=t.nextTick,n=t.versions.node.match(/^(?:(\d+)\.)?(?:(\d+)\.)?(\*|\d+)$/);return Array.isArray(n)&&"0"===n[1]&&"10"===n[2]&&(e=o),function(){return e(gt)}}():Vt?function(){var t=0,e=new Vt(gt),n=document.createTextNode("");return e.observe(n,{characterData:!0}),function(){return n.data=t=++t%2}}():qt?function(){var t=new MessageChannel;return t.port1.onmessage=gt,function(){return t.port2.postMessage(0)}}():void 0===Ht?function(){try{var t=n(20);return zt=t.runOnLoop||t.runOnContext,vt()}catch(t){return mt()}}():mt();if("object"==typeof self)self;else{if("object"!=typeof r)throw new Error("no global: `self` or `global` found");r}var Yt;xt.async=ht,xt.after=function(t){return setTimeout(t,0)};var Qt=ut,Xt=function(t,e){return xt.async(t,e)};if("undefined"!=typeof window&&"object"==typeof window.__PROMISE_INSTRUMENTATION__){var te=window.__PROMISE_INSTRUMENTATION__;s("instrument",!0);for(var ee in te)te.hasOwnProperty(ee)&&bt(ee,te[ee])}var ne=(Yt={asap:ht,cast:Qt,Promise:Pt,EventTarget:wt,all:J,allSettled:Q,race:X,hash:nt,hashSettled:it,rethrow:at,defer:st,denodeify:G,configure:s,on:bt,off:_t,resolve:ut,reject:lt,map:ct},yt(Yt,"async",Xt),yt(Yt,"filter",dt),Yt);e.default=ne}.call(e,n(6),n(5).setImmediate,n(0))},function(t,e,n){(function(t,n){function o(t,e){return null==t?void 0:t[e]}function r(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}function i(t){return B.call(t)}function a(t){return!(!g(t)||c(t))&&(v(t)||r(t)?W:T).test(l(t))}function s(t,e){var n=o(t,e);return a(n)?n:void 0}function c(t){return!!N&&N in t}function u(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||P)}function l(t){if(null!=t){try{return F.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function f(t){return d(t)&&R.call(t,"callee")&&(!z.call(t,"callee")||B.call(t)==w)}function p(t){return null!=t&&m(t.length)&&!v(t)}function d(t){return y(t)&&p(t)}function h(t){if(p(t)&&(rt(t)||"string"==typeof t||"function"==typeof t.splice||it(t)||f(t)))return!t.length;var e=ot(t);if(e==E||e==C)return!t.size;if(Y||u(t))return!G(t).length;for(var n in t)if(R.call(t,n))return!1;return!0}function v(t){var e=g(t)?B.call(t):"";return e==x||e==k}function m(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=_}function g(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function y(t){return!!t&&"object"==typeof t}function b(){return!1}var _=9007199254740991,w="[object Arguments]",x="[object Function]",k="[object GeneratorFunction]",E="[object Map]",C="[object Set]",O=/[\\^$.*+?()[\]{}|]/g,T=/^\[object .+?Constructor\]$/,$="object"==typeof t&&t&&t.Object===Object&&t,S="object"==typeof self&&self&&self.Object===Object&&self,A=$||S||Function("return this")(),j="object"==typeof e&&e&&!e.nodeType&&e,I=j&&"object"==typeof n&&n&&!n.nodeType&&n,L=I&&I.exports===j,M=Function.prototype,P=Object.prototype,D=A["__core-js_shared__"],N=function(){var t=/[^.]+$/.exec(D&&D.keys&&D.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),F=M.toString,R=P.hasOwnProperty,B=P.toString,W=RegExp("^"+F.call(R).replace(O,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),U=L?A.Buffer:void 0,z=P.propertyIsEnumerable,H=U?U.isBuffer:void 0,G=function(t,e){return function(n){return t(e(n))}}(Object.keys,Object),V=s(A,"DataView"),K=s(A,"Map"),q=s(A,"Promise"),J=s(A,"Set"),Z=s(A,"WeakMap"),Y=!z.call({valueOf:1},"valueOf"),Q=l(V),X=l(K),tt=l(q),et=l(J),nt=l(Z),ot=i;(V&&"[object DataView]"!=ot(new V(new ArrayBuffer(1)))||K&&ot(new K)!=E||q&&"[object Promise]"!=ot(q.resolve())||J&&ot(new J)!=C||Z&&"[object WeakMap]"!=ot(new Z))&&(ot=function(t){var e=B.call(t),n="[object Object]"==e?t.constructor:void 0,o=n?l(n):void 0;if(o)switch(o){case Q:return"[object DataView]";case X:return E;case tt:return"[object Promise]";case et:return C;case nt:return"[object WeakMap]"}return e});var rt=Array.isArray,it=H||b;n.exports=h}).call(e,n(0),n(21)(t))},function(t,e){function n(t,e){return t?r.call(t,e):""}var o=Array.prototype,r=o.join;t.exports=n},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(7),r=jQuery;e.default={get:function(t,e,n){return new o.Promise(function(o,i){r.getJSON({url:t,beforeSend:function(t){t.setRequestHeader("Accept","application/vnd.api+json"),t.setRequestHeader("Content-Type","application/vnd.api+json"),t.setRequestHeader("OSWP-Plugin-Version",e),n&&t.setRequestHeader("OSWP-Client-Token",n)}}).done(o).fail(i)})}}},function(t,e,n){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}}(),a=n(12),s=o(a),c=n(17),u=o(c),l=n(2);window.OpinionStage&&void 0!==OpinionStage.contentPopup&&console.warn("[OpinionStage] content-popup APIs was already included"),function(t,e){function n(){var t=this;t.modal=new s.default({content:e("[data-opinionstage-content-popup-template]").html(),onCreate:function(e){t.app=new u.default(e)},onClose:function(e){t.app.isModalOpened=!1},onOpen:function(e){t.app.isModalOpened=!0}})}var o=function(){function t(){r(this,t),this.app=void 0,this.modal=void 0}return i(t,[{key:"open",value:function(t){var o=this,r=t.preselectWidgetType,i=t.onWidgetSelect;if("function"!=typeof i)throw new Error("onWidgetSelect must be a function");e(function(){o.app||n.call(o),o.app.widgetType=r||l.WIDGET_ALL,o.app.widgetSelectCb=i,o.modal.open()})}}]),t}();t.contentPopup=new o,t.contentPopup.WIDGET_ALL=l.WIDGET_ALL,t.contentPopup.WIDGET_POLL=l.WIDGET_POLL,t.contentPopup.WIDGET_SET=l.WIDGET_SET,t.contentPopup.WIDGET_SURVEY=l.WIDGET_SURVEY,t.contentPopup.WIDGET_SLIDESHOW=l.WIDGET_SLIDESHOW,t.contentPopup.WIDGET_TRIVIA_QUIZ=l.WIDGET_TRIVIA_QUIZ,t.contentPopup.WIDGET_PERSONALITY_QUIZ=l.WIDGET_PERSONALITY_QUIZ,t.contentPopup.WIDGET_LIST=l.WIDGET_LIST,t.contentPopup.WIDGET_FORM=l.WIDGET_FORM,t.contentPopup.WIDGET_STORY=l.WIDGET_STORY}(window.OpinionStage=window.OpinionStage||{},jQuery),jQuery(function(t){window.location.href.indexOf("modal_is_open")>-1&&(OpinionStage.contentPopup.open({onWidgetSelect:onWidgetSelect}),modal.open()),t("body").on("click","[data-opinionstage-content-launch]",function(t){function e(t){wp.media.editor.insert(t.shortcode)}t.preventDefault(),OpinionStage.contentPopup.open({onWidgetSelect:e})})})},function(t,e,n){"use strict";function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}}(),i=n(13),a=function(t){return t&&t.__esModule?t:{default:t}}(i);n(14);var s=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,t),this.modal=new a.default.modal({closeMethods:["overlay","escape"],cssClass:["opinionstage-content-popup"],onClose:e.onClose,onOpen:e.onOpen}),this.modal.setContent(e.content),"function"==typeof e.onCreate&&e.onCreate(this)}return r(t,[{key:"open",value:function(){this.modal.open()}},{key:"close",value:function(){this.modal.close()}},{key:"checkOverflow",value:function(){this.modal.checkOverflow()}}]),t}();e.default=s},function(t,e,n){var o,r;!function(i,a){o=a,void 0!==(r="function"==typeof o?o.call(e,n,e,t):o)&&(t.exports=r)}(0,function(){function t(t){var e={onClose:null,onOpen:null,beforeClose:null,stickyFooter:!1,footer:!1,cssClass:[],closeLabel:"Close",closeMethods:["overlay","button","escape"]};this.opts=u({},e,t),this.init()}function e(){this.modalBoxFooter&&(this.modalBoxFooter.style.width=this.modalBox.clientWidth+"px",this.modalBoxFooter.style.left=this.modalBox.offsetLeft+"px")}function n(){this.modal=document.createElement("div"),this.modal.classList.add("tingle-modal"),0!==this.opts.closeMethods.length&&-1!==this.opts.closeMethods.indexOf("overlay")||this.modal.classList.add("tingle-modal--noOverlayClose"),this.modal.style.display="none",this.opts.cssClass.forEach(function(t){"string"==typeof t&&this.modal.classList.add(t)},this),-1!==this.opts.closeMethods.indexOf("button")&&(this.modalCloseBtn=document.createElement("button"),this.modalCloseBtn.classList.add("tingle-modal__close"),this.modalCloseBtnIcon=document.createElement("span"),this.modalCloseBtnIcon.classList.add("tingle-modal__closeIcon"),this.modalCloseBtnIcon.innerHTML="×",this.modalCloseBtnLabel=document.createElement("span"),this.modalCloseBtnLabel.classList.add("tingle-modal__closeLabel"),this.modalCloseBtnLabel.innerHTML=this.opts.closeLabel,this.modalCloseBtn.appendChild(this.modalCloseBtnIcon),this.modalCloseBtn.appendChild(this.modalCloseBtnLabel)),this.modalBox=document.createElement("div"),this.modalBox.classList.add("tingle-modal-box"),this.modalBoxContent=document.createElement("div"),this.modalBoxContent.classList.add("tingle-modal-box__content"),this.modalBox.appendChild(this.modalBoxContent),-1!==this.opts.closeMethods.indexOf("button")&&this.modal.appendChild(this.modalCloseBtn),this.modal.appendChild(this.modalBox)}function o(){this.modalBoxFooter=document.createElement("div"),this.modalBoxFooter.classList.add("tingle-modal-box__footer"),this.modalBox.appendChild(this.modalBoxFooter)}function r(){this._events={clickCloseBtn:this.close.bind(this),clickOverlay:a.bind(this),resize:this.checkOverflow.bind(this),keyboardNav:i.bind(this)},-1!==this.opts.closeMethods.indexOf("button")&&this.modalCloseBtn.addEventListener("click",this._events.clickCloseBtn),this.modal.addEventListener("mousedown",this._events.clickOverlay),window.addEventListener("resize",this._events.resize),document.addEventListener("keydown",this._events.keyboardNav)}function i(t){-1!==this.opts.closeMethods.indexOf("escape")&&27===t.which&&this.isOpen()&&this.close()}function a(t){-1!==this.opts.closeMethods.indexOf("overlay")&&!s(t.target,"tingle-modal")&&t.clientX<this.modal.clientWidth&&this.close()}function s(t,e){for(;(t=t.parentElement)&&!t.classList.contains(e););return t}function c(){-1!==this.opts.closeMethods.indexOf("button")&&this.modalCloseBtn.removeEventListener("click",this._events.clickCloseBtn),this.modal.removeEventListener("mousedown",this._events.clickOverlay),window.removeEventListener("resize",this._events.resize),document.removeEventListener("keydown",this._events.keyboardNav)}function u(){for(var t=1;t<arguments.length;t++)for(var e in arguments[t])arguments[t].hasOwnProperty(e)&&(arguments[0][e]=arguments[t][e]);return arguments[0]}var l=function(){var t,e=document.createElement("tingle-test-transition"),n={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(t in n)if(void 0!==e.style[t])return n[t]}();return t.prototype.init=function(){this.modal||(n.call(this),r.call(this),document.body.insertBefore(this.modal,document.body.firstChild),this.opts.footer&&this.addFooter())},t.prototype.destroy=function(){null!==this.modal&&(c.call(this),this.modal.parentNode.removeChild(this.modal),this.modal=null)},t.prototype.open=function(){this.modal.style.removeProperty?this.modal.style.removeProperty("display"):this.modal.style.removeAttribute("display"),document.body.classList.add("tingle-enabled"),this.setStickyFooter(this.opts.stickyFooter),this.modal.classList.add("tingle-modal--visible");var t=this;l?this.modal.addEventListener(l,function e(){"function"==typeof t.opts.onOpen&&t.opts.onOpen.call(t),t.modal.removeEventListener(l,e,!1)},!1):"function"==typeof t.opts.onOpen&&t.opts.onOpen.call(t),this.checkOverflow()},t.prototype.isOpen=function(){return!!this.modal.classList.contains("tingle-modal--visible")},t.prototype.close=function(){if("function"==typeof this.opts.beforeClose){if(!this.opts.beforeClose.call(this))return}document.body.classList.remove("tingle-enabled"),this.modal.classList.remove("tingle-modal--visible");var t=this;l?this.modal.addEventListener(l,function e(){t.modal.removeEventListener(l,e,!1),t.modal.style.display="none","function"==typeof t.opts.onClose&&t.opts.onClose.call(this)},!1):(t.modal.style.display="none","function"==typeof t.opts.onClose&&t.opts.onClose.call(this))},t.prototype.setContent=function(t){"string"==typeof t?this.modalBoxContent.innerHTML=t:(this.modalBoxContent.innerHTML="",this.modalBoxContent.appendChild(t))},t.prototype.getContent=function(){return this.modalBoxContent},t.prototype.addFooter=function(){o.call(this)},t.prototype.setFooterContent=function(t){this.modalBoxFooter.innerHTML=t},t.prototype.getFooterContent=function(){return this.modalBoxFooter},t.prototype.setStickyFooter=function(t){this.isOverflow()||(t=!1),t?this.modalBox.contains(this.modalBoxFooter)&&(this.modalBox.removeChild(this.modalBoxFooter),this.modal.appendChild(this.modalBoxFooter),this.modalBoxFooter.classList.add("tingle-modal-box__footer--sticky"),e.call(this),this.modalBoxContent.style["padding-bottom"]=this.modalBoxFooter.clientHeight+20+"px"):this.modalBoxFooter&&(this.modalBox.contains(this.modalBoxFooter)||(this.modal.removeChild(this.modalBoxFooter),this.modalBox.appendChild(this.modalBoxFooter),this.modalBoxFooter.style.width="auto",this.modalBoxFooter.style.left="",this.modalBoxContent.style["padding-bottom"]="",this.modalBoxFooter.classList.remove("tingle-modal-box__footer--sticky")))},t.prototype.addFooterBtn=function(t,e,n){var o=document.createElement("button");return o.innerHTML=t,o.addEventListener("click",n),"string"==typeof e&&e.length&&e.split(" ").forEach(function(t){o.classList.add(t)}),this.modalBoxFooter.appendChild(o),o},t.prototype.resize=function(){console.warn("Resize is deprecated and will be removed in version 1.0")},t.prototype.isOverflow=function(){var t=window.innerHeight;return this.modalBox.clientHeight>=t},t.prototype.checkOverflow=function(){this.modal.classList.contains("tingle-modal--visible")&&(this.isOverflow()?this.modal.classList.add("tingle-modal--overflow"):this.modal.classList.remove("tingle-modal--overflow"),!this.isOverflow()&&this.opts.stickyFooter?this.setStickyFooter(!1):this.isOverflow()&&this.opts.stickyFooter&&(e.call(this),this.setStickyFooter(!0)))},{modal:t}})},function(t,e,n){var o=n(15);"string"==typeof o&&(o=[[t.i,o,""]]);var r={};r.transform=void 0;n(4)(o,r);o.locals&&(t.exports=o.locals)},function(t,e,n){e=t.exports=n(3)(!1),e.push([t.i,".opinionstage-content-popup.tingle-modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:159900;display:flex;visibility:hidden;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-ms-flex-align:center;align-items:center;overflow:auto;background:rgba(0,0,0,.8);opacity:0;cursor:pointer;-webkit-transition:-webkit-transform .2s ease;transition:-webkit-transform .2s ease;transition:transform .2s ease;transition:transform .2s ease,-webkit-transform .2s ease}.opinionstage-content-popup.tingle-modal *{-webkit-box-sizing:border-box;box-sizing:border-box}.opinionstage-content-popup .tingle-modal-box{position:relative;-ms-flex-negative:0;flex-shrink:0;margin-top:auto;margin-bottom:auto;background:#fff;opacity:1;cursor:auto;-webkit-transition:-webkit-transform .3s cubic-bezier(.175,.885,.32,1.275);transition:-webkit-transform .3s cubic-bezier(.175,.885,.32,1.275);transition:transform .3s cubic-bezier(.175,.885,.32,1.275);transition:transform .3s cubic-bezier(.175,.885,.32,1.275),-webkit-transform .3s cubic-bezier(.175,.885,.32,1.275);-webkit-transform:scale(.8);transform:scale(.8)}@media only screen and (max-width:875px){.opinionstage-content-popup .tingle-modal-box{min-width:100%;overflow:hidden;width:100%}}.opinionstage-content-popup .tingle-modal-box__content{padding:0}.opinionstage-content-popup.tingle-modal--visible{visibility:visible;opacity:1}.opinionstage-content-popup.tingle-modal--visible .tingle-modal-box{-webkit-transform:scale(1);transform:scale(1)}@media (max-width:540px){.opinionstage-content-popup .tingle-modal-box{width:auto}.opinionstage-content-popup.tingle-modal{top:60px;display:block;width:100%}.opinionstage-content-popup.tingle-modal--overflow{padding:0}}.tingle-enabled{overflow:hidden;height:100%}.tingle-enabled .tingle-content-wrapper{-webkit-filter:blur(15px);filter:blur(15px)}",""])},function(t,e){t.exports=function(t){var e="undefined"!=typeof window&&window.location;if(!e)throw new Error("fixUrls requires window.location");if(!t||"string"!=typeof t)return t;var n=e.protocol+"//"+e.host,o=n+e.pathname.replace(/\/[^\/]*$/,"/");return t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(t,e){var r=e.trim().replace(/^"(.*)"$/,function(t,e){return e}).replace(/^'(.*)'$/,function(t,e){return e});if(/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/)/i.test(r))return t;var i;return i=0===r.indexOf("//")?r:0===r.indexOf("/")?n+r:o+r.replace(/^\.\//,""),"url("+JSON.stringify(i)+")"})}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return new r.default({el:"[data-opinionstage-content-popup]",data:{widgetType:i.WIDGET_ALL,widgetSelectCb:function(t){console.log("dumb widget insert callback, widget:",t)},showClientContent:!0,isClientLoggedIn:null,isModalOpened:!1},beforeMount:function(){this.isClientLoggedIn="1"===this.$el.dataset.opinionstageClientLoggedIn},methods:{closePopup:function(){t.close()},selectWidgetAndExit:function(t){this.widgetSelectCb(t),this.closePopup()}}})};var o=n(1),r=function(t){return t&&t.__esModule?t:{default:t}}(o);n(19),n(25),n(27),n(28);var i=n(2)},function(t,e,n){(function(t,e){!function(t,n){"use strict";function o(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n<e.length;n++)e[n]=arguments[n+1];var o={callback:t,args:e};return u[c]=o,s(c),c++}function r(t){delete u[t]}function i(t){var e=t.callback,o=t.args;switch(o.length){case 0:e();break;case 1:e(o[0]);break;case 2:e(o[0],o[1]);break;case 3:e(o[0],o[1],o[2]);break;default:e.apply(n,o)}}function a(t){if(l)setTimeout(a,0,t);else{var e=u[t];if(e){l=!0;try{i(e)}finally{r(t),l=!1}}}}if(!t.setImmediate){var s,c=1,u={},l=!1,f=t.document,p=Object.getPrototypeOf&&Object.getPrototypeOf(t);p=p&&p.setTimeout?p:t,"[object process]"==={}.toString.call(t.process)?function(){s=function(t){e.nextTick(function(){a(t)})}}():function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?function(){var e="setImmediate$"+Math.random()+"$",n=function(n){n.source===t&&"string"==typeof n.data&&0===n.data.indexOf(e)&&a(+n.data.slice(e.length))};t.addEventListener?t.addEventListener("message",n,!1):t.attachEvent("onmessage",n),s=function(n){t.postMessage(e+n,"*")}}():t.MessageChannel?function(){var t=new MessageChannel;t.port1.onmessage=function(t){a(t.data)},s=function(e){t.port2.postMessage(e)}}():f&&"onreadystatechange"in f.createElement("script")?function(){var t=f.documentElement;s=function(e){var n=f.createElement("script");n.onreadystatechange=function(){a(e),n.onreadystatechange=null,t.removeChild(n),n=null},t.appendChild(n)}}():function(){s=function(t){setTimeout(a,0,t)}}(),p.setImmediate=o,p.clearImmediate=r}}("undefined"==typeof self?void 0===t?this:t:self)}).call(e,n(0),n(6))},function(t,e,n){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}function r(){var t=this;return this.dataLoading=!0,(this.showClientContent?i:a).call(this,this.searchCriteria).then(function(){t.noMoreData=!u(t.$store.state.nextPageNumber),t.dataLoading=!1})}function i(t){return this.clientIsLoggedIn?this.$store.dispatch({type:"loadClientWidgets",widgetsUrl:this.clientWidgetsUrl,pluginVersion:this.pluginVersion,accessToken:this.accessKey,filtering:t}):g.default.resolve()}function a(t){return this.$store.dispatch({type:"loadTemplateWidgets",widgetsUrl:this.sharedWidgetsUrl,pluginVersion:this.pluginVersion,filtering:t})}function s(t,e,n){var o=[];return e&&o.push("type="+e),n&&o.push("updated_at="+n),(0,b.default)(o)?t:t+"?"+(0,w.default)(o,"&")}function c(t,e){var n=this,o=s(this.clientWidgetsHasNewUrl,t,e);return C.default.get(o,this.pluginVersion,this.accessKey).then(function(t){n.newWidgetsAvailable=t.data["has-new-widgets"]}).catch(function(t){console.error("[social-polls-by-opinionstage][content-popup] can't load widgets:",t.statusText)})}function u(t){return t>1}function l(){var t=this;c.call(this,this.searchCriteria.type,this.lastUpdateTime).then(function(){t.newWidgetsAvailable&&p.call(t)})}function f(){this.clientIsLoggedIn&&(this.isCheckingWidgetUpdates=!0,this.widgetUpdatesChecker=setInterval(l.bind(this),3e3))}function p(){this.isCheckingWidgetUpdates=!1,clearInterval(this.widgetUpdatesChecker)}function d(){void 0!==this.widgets[0]?this.lastUpdateTime=this.widgets[0].updatedAt:this.lastUpdateTime=null}Object.defineProperty(e,"__esModule",{value:!0});var h=n(1),v=o(h),m=n(7),g=o(m),y=n(8),b=o(y),_=n(9),w=o(_),x=n(22),k=o(x),E=n(10),C=o(E),O=n(2);e.default=v.default.component("popup-content",{template:"#opinionstage-popup-content",props:["showClientContent","clientIsLoggedIn","modalIsOpened","widgetType","clientWidgetsUrl","sharedWidgetsUrl","clientWidgetsHasNewUrl","accessKey","pluginVersion"],data:function(){return{dataLoading:!1,widgets:[],searchCriteria:{},noMoreData:!0,newWidgetsAvailable:!1,lastUpdateTime:null,isCheckingWidgetUpdates:!1,widgetUpdatesChecker:null}},store:k.default,methods:{reloadData:function(t){var e=this;t||(t={});var n=t.widgetType||this.widgetType||this.searchCriteria.type||O.WIDGET_ALL,o=t.widgetTitle||"";this.newWidgetsAvailable=!1,p.call(this),this.searchCriteria={page:1,perPage:9,type:n,title:o},this.$store.commit("clearWidgets"),r.call(this).then(function(){e.widgets=e.$store.state.widgets[0],e.searchCriteria.title||d.call(e),f.call(e)})},reloadAndRestartCheckingForUpdates:function(){this.reloadData({widgetType:this.searchCriteria.type,widgetTitle:""})},appendData:function(){var t=this;this.searchCriteria.page+=1,r.call(this).then(function(){var e=t.$store.state.widgets[t.searchCriteria.page-1];t.widgets=t.widgets.concat(e)})},widgetSelected:function(t){this.$emit("widget-selected",t)}},watch:{modalIsOpened:function(t){t&&this.showClientContent&&this.clientIsLoggedIn?this.reloadData():(this.newWidgetsAvailable=!1,p.call(this))},showClientContent:function(t){t&&this.modalIsOpened&&this.clientIsLoggedIn?f.call(this):p.call(this)}}})},function(t,e){},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}function r(t){return t.data.map(function(t){return{id:t.id,type:t.attributes.type,title:t.attributes.title,imageUrl:t.attributes["image-url"],updatedAt:t.attributes["updated-at"],landingPageUrl:t.attributes["landing-page-url"],editUrl:t.attributes["edit-url"],statsUrl:t.attributes["stats-url"],shortcode:t.attributes.shortcode}})}function i(t){return t.meta.nextPage}function a(t,e){var n=e.type,o=e.title,r=e.page,i=e.perPage,a=[];if(n&&a.push("type="+n),!(0,h.default)(o)){var s=(0,p.default)(o);(0,h.default)(s)||a.push("title_like="+s)}return r&&a.push("page="+r),i&&a.push("per_page="+i),(0,h.default)(a)?t:t+"?"+(0,m.default)(a,"&")}Object.defineProperty(e,"__esModule",{value:!0});var s=n(1),c=o(s),u=n(23),l=o(u),f=n(24),p=o(f),d=n(8),h=o(d),v=n(9),m=o(v),g=n(10),y=o(g);c.default.use(l.default),e.default=new l.default.Store({state:{widgets:[],nextPageNumber:null},mutations:{loadWidgets:function(t,e){var n=e.widgetsData;t.widgets.push(r(n)),t.nextPageNumber=i(n)},loadTemplateWidgets:function(t,e){var n=e.widgetsData;t.widgets.push(r(n).map(function(t){return t.template=!0,t})),t.nextPageNumber=i(n)},clearWidgets:function(t){t.widgets=[],t.nextPageNumber=null}},actions:{loadClientWidgets:function(t,e){return(0,t.dispatch)("load",{commitType:"loadWidgets",widgetsUrl:e.widgetsUrl,pluginVersion:e.pluginVersion,accessToken:e.accessToken,filtering:e.filtering})},loadTemplateWidgets:function(t,e){return(0,t.dispatch)("load",{commitType:"loadTemplateWidgets",widgetsUrl:e.widgetsUrl,pluginVersion:e.pluginVersion,filtering:e.filtering})},load:function(t,e){var n=t.commit,o=e.commitType,r=e.widgetsUrl,i=e.filtering,s=e.pluginVersion,c=e.accessToken,u=a(r,i);return y.default.get(u,s,c).then(function(t){n({type:o,widgetsData:t})}).catch(function(t){console.error("[social-polls-by-opinionstage][content-popup] can't load widgets:",t.statusText)})}}})},function(t,e,n){"use strict";function o(t){C&&(t._devtoolHook=C,C.emit("vuex:init",t),C.on("vuex:travel-to-state",function(e){t.replaceState(e)}),t.subscribe(function(t,e){C.emit("vuex:mutation",t,e)}))}function r(t,e){Object.keys(t).forEach(function(n){return e(t[n],n)})}function i(t){return null!==t&&"object"==typeof t}function a(t){return t&&"function"==typeof t.then}function s(t,e,n){if(e.update(n),n.modules)for(var o in n.modules){if(!e.getChild(o))return;s(t.concat(o),e.getChild(o),n.modules[o])}}function c(t,e){return e.indexOf(t)<0&&e.push(t),function(){var n=e.indexOf(t);n>-1&&e.splice(n,1)}}function u(t,e){t._actions=Object.create(null),t._mutations=Object.create(null),t._wrappedGetters=Object.create(null),t._modulesNamespaceMap=Object.create(null);var n=t.state;f(t,n,[],t._modules.root,!0),l(t,n,e)}function l(t,e,n){var o=t._vm;t.getters={};var i=t._wrappedGetters,a={};r(i,function(e,n){a[n]=function(){return e(t)},Object.defineProperty(t.getters,n,{get:function(){return t._vm[n]},enumerable:!0})});var s=S.config.silent;S.config.silent=!0,t._vm=new S({data:{$$state:e},computed:a}),S.config.silent=s,t.strict&&g(t),o&&(n&&t._withCommit(function(){o._data.$$state=null}),S.nextTick(function(){return o.$destroy()}))}function f(t,e,n,o,r){var i=!n.length,a=t._modules.getNamespace(n);if(o.namespaced&&(t._modulesNamespaceMap[a]=o),!i&&!r){var s=y(e,n.slice(0,-1)),c=n[n.length-1];t._withCommit(function(){S.set(s,c,o.state)})}var u=o.context=p(t,a,n);o.forEachMutation(function(e,n){h(t,a+n,e,u)}),o.forEachAction(function(e,n){var o=e.root?n:a+n,r=e.handler||e;v(t,o,r,u)}),o.forEachGetter(function(e,n){m(t,a+n,e,u)}),o.forEachChild(function(o,i){f(t,e,n.concat(i),o,r)})}function p(t,e,n){var o=""===e,r={dispatch:o?t.dispatch:function(n,o,r){var i=b(n,o,r),a=i.payload,s=i.options,c=i.type;return s&&s.root||(c=e+c),t.dispatch(c,a)},commit:o?t.commit:function(n,o,r){var i=b(n,o,r),a=i.payload,s=i.options,c=i.type;s&&s.root||(c=e+c),t.commit(c,a,s)}};return Object.defineProperties(r,{getters:{get:o?function(){return t.getters}:function(){return d(t,e)}},state:{get:function(){return y(t.state,n)}}}),r}function d(t,e){var n={},o=e.length;return Object.keys(t.getters).forEach(function(r){if(r.slice(0,o)===e){var i=r.slice(o);Object.defineProperty(n,i,{get:function(){return t.getters[r]},enumerable:!0})}}),n}function h(t,e,n,o){(t._mutations[e]||(t._mutations[e]=[])).push(function(e){n.call(t,o.state,e)})}function v(t,e,n,o){(t._actions[e]||(t._actions[e]=[])).push(function(e,r){var i=n.call(t,{dispatch:o.dispatch,commit:o.commit,getters:o.getters,state:o.state,rootGetters:t.getters,rootState:t.state},e,r);return a(i)||(i=Promise.resolve(i)),t._devtoolHook?i.catch(function(e){throw t._devtoolHook.emit("vuex:error",e),e}):i})}function m(t,e,n,o){t._wrappedGetters[e]||(t._wrappedGetters[e]=function(t){return n(o.state,o.getters,t.state,t.getters)})}function g(t){t._vm.$watch(function(){return this._data.$$state},function(){},{deep:!0,sync:!0})}function y(t,e){return e.length?e.reduce(function(t,e){return t[e]},t):t}function b(t,e,n){return i(t)&&t.type&&(n=e,e=t,t=t.type),{type:t,payload:e,options:n}}function _(t){S&&t===S||(S=t,E(S))}function w(t){return Array.isArray(t)?t.map(function(t){return{key:t,val:t}}):Object.keys(t).map(function(e){return{key:e,val:t[e]}})}function x(t){return function(e,n){return"string"!=typeof e?(n=e,e=""):"/"!==e.charAt(e.length-1)&&(e+="/"),t(e,n)}}function k(t,e,n){return t._modulesNamespaceMap[n]}Object.defineProperty(e,"__esModule",{value:!0}),n.d(e,"Store",function(){return A}),n.d(e,"install",function(){return _}),n.d(e,"mapState",function(){return I}),n.d(e,"mapMutations",function(){return L}),n.d(e,"mapGetters",function(){return M}),n.d(e,"mapActions",function(){return P}),n.d(e,"createNamespacedHelpers",function(){return D});/**
|
14 |
* vuex v2.5.0
|
15 |
* (c) 2017 Evan You
|
16 |
* @license MIT
|
admin/js/menu-page.js
CHANGED
@@ -1,22 +1,4 @@
|
|
1 |
jQuery(document).ready(function ($) {
|
2 |
-
var toggleSettingsAjax = function (currObject, action) {
|
3 |
-
$.post(ajaxurl, {action: action, activate: currObject.is(':checked'), security: OPINIONSTAGE.myPlacementsNonce}, function (response) {
|
4 |
-
})
|
5 |
-
}
|
6 |
-
|
7 |
-
$('#fly-out-switch').change(function () {
|
8 |
-
toggleSettingsAjax($(this), "opinionstage_ajax_toggle_flyout")
|
9 |
-
})
|
10 |
-
|
11 |
-
$('#article-placement-switch').change(function () {
|
12 |
-
toggleSettingsAjax($(this), "opinionstage_ajax_toggle_article_placement")
|
13 |
-
})
|
14 |
-
|
15 |
-
$('#sidebar-placement-switch').change(function () {
|
16 |
-
toggleSettingsAjax($(this), "opinionstage_ajax_toggle_sidebar_placement")
|
17 |
-
})
|
18 |
-
|
19 |
-
|
20 |
var OpinionstageMyItems = {
|
21 |
cacheElements: function() {
|
22 |
this.cache = {
|
@@ -29,19 +11,30 @@ jQuery(document).ready(function ($) {
|
|
29 |
$searchField: $('#opinionstage-my-items-search-field'),
|
30 |
$failedLoadItemsMessage: $('#opinionstage-failed-load-items-request'),
|
31 |
$searchTerm: '',
|
|
|
|
|
|
|
|
|
|
|
32 |
|
33 |
$widgetType: $('#itemList').val() ? $('#itemList').val() : 'all'
|
34 |
}
|
35 |
},
|
36 |
-
loadItems: function(override
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
var self = this
|
38 |
-
if(
|
39 |
self.cache.$table.html('')
|
40 |
self.cache.$messageLoading.show()
|
41 |
self.cache.$messageNoItemsFound.hide()
|
42 |
}
|
43 |
self.cache.$buttonLoadMore.hide()
|
44 |
-
self.cache.$failedLoadItemsMessage.hide()
|
45 |
|
46 |
$.ajax({
|
47 |
url: ajaxurl,
|
@@ -56,7 +49,6 @@ jQuery(document).ready(function ($) {
|
|
56 |
},
|
57 |
success: function( response ) {
|
58 |
self.cache.$messageLoading.hide()
|
59 |
-
console.log(response.success)
|
60 |
if( response.success ) {
|
61 |
if( response.html.length > 0 ) {
|
62 |
self.renderResults( response.html, override )
|
@@ -67,10 +59,14 @@ jQuery(document).ready(function ($) {
|
|
67 |
self.cache.$buttonLoadMore.hide()
|
68 |
}
|
69 |
} else {
|
|
|
|
|
|
|
|
|
70 |
self.cache.$messageNoItemsFound.show()
|
71 |
}
|
72 |
} else {
|
73 |
-
self.cache.$failedLoadItemsMessage.show()
|
74 |
}
|
75 |
}
|
76 |
})
|
@@ -99,7 +95,35 @@ jQuery(document).ready(function ($) {
|
|
99 |
self.loadItems()
|
100 |
}
|
101 |
})
|
102 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
103 |
|
104 |
renderResults: function( html_ajax, override ){
|
105 |
var self = this
|
@@ -110,11 +134,18 @@ jQuery(document).ready(function ($) {
|
|
110 |
|
111 |
init: function() {
|
112 |
this.cacheElements()
|
113 |
-
this.loadItems()
|
114 |
this.bindEvents()
|
115 |
}
|
116 |
}
|
117 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
118 |
|
119 |
if ($('.opinionstage-show-anchor-list').length > 0) {
|
120 |
|
1 |
jQuery(document).ready(function ($) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
var OpinionstageMyItems = {
|
3 |
cacheElements: function() {
|
4 |
this.cache = {
|
11 |
$searchField: $('#opinionstage-my-items-search-field'),
|
12 |
$failedLoadItemsMessage: $('#opinionstage-failed-load-items-request'),
|
13 |
$searchTerm: '',
|
14 |
+
$modal: $('#opinionistage-my-items-page-modal-wrapper'),
|
15 |
+
$modalShortcodeTextarea: $('#opinionstage-widget-shortcode'),
|
16 |
+
$openModalButton: '.opinionstage-open-modal',
|
17 |
+
$closeModalButton: $('#opinionstage-dialog-close'),
|
18 |
+
$copyButtonSelector: '[data-copy-text-from]',
|
19 |
|
20 |
$widgetType: $('#itemList').val() ? $('#itemList').val() : 'all'
|
21 |
}
|
22 |
},
|
23 |
+
loadItems: function(override, firstLoad ){
|
24 |
+
if (override === undefined) {
|
25 |
+
override = true
|
26 |
+
}
|
27 |
+
if (firstLoad === undefined) {
|
28 |
+
firstLoad = false
|
29 |
+
}
|
30 |
var self = this
|
31 |
+
if (override) {
|
32 |
self.cache.$table.html('')
|
33 |
self.cache.$messageLoading.show()
|
34 |
self.cache.$messageNoItemsFound.hide()
|
35 |
}
|
36 |
self.cache.$buttonLoadMore.hide()
|
37 |
+
self.cache.$failedLoadItemsMessage.hide()
|
38 |
|
39 |
$.ajax({
|
40 |
url: ajaxurl,
|
49 |
},
|
50 |
success: function( response ) {
|
51 |
self.cache.$messageLoading.hide()
|
|
|
52 |
if( response.success ) {
|
53 |
if( response.html.length > 0 ) {
|
54 |
self.renderResults( response.html, override )
|
59 |
self.cache.$buttonLoadMore.hide()
|
60 |
}
|
61 |
} else {
|
62 |
+
if( firstLoad ) {
|
63 |
+
$('.opinionstage-item-view-dashboard').hide()
|
64 |
+
$('.opinionstage-dashboard-left').show()
|
65 |
+
}
|
66 |
self.cache.$messageNoItemsFound.show()
|
67 |
}
|
68 |
} else {
|
69 |
+
self.cache.$failedLoadItemsMessage.show()
|
70 |
}
|
71 |
}
|
72 |
})
|
95 |
self.loadItems()
|
96 |
}
|
97 |
})
|
98 |
+
|
99 |
+
$('body').on('click', self.cache.$openModalButton, function (e) {
|
100 |
+
e.preventDefault()
|
101 |
+
var shortcode = $(this).data('shortcode')
|
102 |
+
|
103 |
+
$(self.cache.$modalShortcodeTextarea).val(shortcode)
|
104 |
+
self.cache.$modal.fadeIn()
|
105 |
+
})
|
106 |
+
|
107 |
+
self.cache.$modal.on('click', function (e) {
|
108 |
+
if ($(e.target).is(self.cache.$modal)) {
|
109 |
+
self.cache.$modal.fadeOut(function () {
|
110 |
+
$(self.cache.$modalShortcodeTextarea).val('')
|
111 |
+
})
|
112 |
+
}
|
113 |
+
})
|
114 |
+
self.cache.$closeModalButton.on('click', function (e) {
|
115 |
+
self.cache.$modal.fadeOut(function () {
|
116 |
+
$(self.cache.$modalShortcodeTextarea).val('')
|
117 |
+
})
|
118 |
+
})
|
119 |
+
|
120 |
+
$("body").on("click", self.cache.$copyButtonSelector, function (e) {
|
121 |
+
e.preventDefault()
|
122 |
+
var t = $(this).data().copyTextFrom
|
123 |
+
$("[" + t + "]")[0].select()
|
124 |
+
document.execCommand("copy")
|
125 |
+
})
|
126 |
+
},
|
127 |
|
128 |
renderResults: function( html_ajax, override ){
|
129 |
var self = this
|
134 |
|
135 |
init: function() {
|
136 |
this.cacheElements()
|
137 |
+
this.loadItems( true, true )
|
138 |
this.bindEvents()
|
139 |
}
|
140 |
}
|
141 |
+
|
142 |
+
if ($('.opinionstage-item-view-dashboard').length > 0) {
|
143 |
+
OpinionstageMyItems.init()
|
144 |
+
}
|
145 |
+
|
146 |
+
$('a.opinionstage-disabled-link').click(function(e){
|
147 |
+
e.preventDefault()
|
148 |
+
})
|
149 |
|
150 |
if ($('.opinionstage-show-anchor-list').length > 0) {
|
151 |
|
admin/js/widgets-page.js
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery(document).ready(function ($) {
|
2 |
+
$('body').on('click', '[data-open-popup-for-widget]', function (e) {
|
3 |
+
e.preventDefault()
|
4 |
+
var wpWidgetId = $(this).data('open-popup-for-widget')
|
5 |
+
OpinionStage.contentPopup.open({
|
6 |
+
onWidgetSelect : function (opinionstageWidget) {
|
7 |
+
var osWidgeteFieldsWrapper = $('[data-os-widget-id="' + wpWidgetId + '"]')
|
8 |
+
if (osWidgeteFieldsWrapper.length > 0) {
|
9 |
+
osWidgeteFieldsWrapper.find('.opinionstage-widget-data').val(JSON.stringify(opinionstageWidget)).trigger('change')
|
10 |
+
osWidgeteFieldsWrapper.find('.opinionstage-selected-widget').show()
|
11 |
+
osWidgeteFieldsWrapper.find('.opinionstage-widget-title').text(opinionstageWidget.title)
|
12 |
+
osWidgeteFieldsWrapper.find('.opininstage-view').attr('href', opinionstageWidget.landingPageUrl)
|
13 |
+
osWidgeteFieldsWrapper.find('.opininstage-stats').attr('href', opinionstageWidget.statsUrl)
|
14 |
+
osWidgeteFieldsWrapper.find('.opininstage-edit').attr('href', opinionstageWidget.editUrl)
|
15 |
+
|
16 |
+
if (opinionstageWidget.imageUrl) {
|
17 |
+
osWidgeteFieldsWrapper.find('.opinionstage-widget-img-url-wrapper .inner').html('<img src="' + opinionstageWidget.imageUrl + '">')
|
18 |
+
}
|
19 |
+
}
|
20 |
+
}
|
21 |
+
})
|
22 |
+
})
|
23 |
+
})
|
admin/menu-page.php
CHANGED
@@ -25,10 +25,8 @@ function opinionstage_register_menu_page() {
|
|
25 |
plugins_url( 'admin/images/os-icon.png', plugin_dir_path( __FILE__ ) ),
|
26 |
'25.234323221'
|
27 |
);
|
28 |
-
add_submenu_page( OPINIONSTAGE_MENU_SLUG, '
|
29 |
-
add_submenu_page( OPINIONSTAGE_MENU_SLUG, '
|
30 |
-
add_submenu_page( OPINIONSTAGE_MENU_SLUG, 'Placements', 'Placements', 'edit_posts', OPINIONSTAGE_PLACEMENT_SLUG, 'opinionstage_load_template' );
|
31 |
-
add_submenu_page( OPINIONSTAGE_MENU_SLUG, 'Help Resources', 'Help Resources', 'edit_posts', OPINIONSTAGE_HELP_RESOURCE_SLUG, 'opinionstage_load_template' );
|
32 |
} else {
|
33 |
add_menu_page(
|
34 |
__( 'Opinion Stage', 'social-polls-by-opinionstage' ),
|
@@ -41,7 +39,6 @@ function opinionstage_register_menu_page() {
|
|
41 |
);
|
42 |
add_submenu_page( OPINIONSTAGE_GETTING_STARTED_SLUG, 'Getting Started', 'Getting Started', 'edit_posts', OPINIONSTAGE_GETTING_STARTED_SLUG, 'opinionstage_load_template' );
|
43 |
add_submenu_page( OPINIONSTAGE_GETTING_STARTED_SLUG, 'Create...', 'Create...', 'edit_posts', OPINIONSTAGE_MENU_SLUG, 'opinionstage_load_template' );
|
44 |
-
add_submenu_page( OPINIONSTAGE_GETTING_STARTED_SLUG, 'Placements', 'Placements', 'edit_posts', OPINIONSTAGE_PLACEMENT_SLUG, 'opinionstage_load_template' );
|
45 |
}
|
46 |
}
|
47 |
}
|
25 |
plugins_url( 'admin/images/os-icon.png', plugin_dir_path( __FILE__ ) ),
|
26 |
'25.234323221'
|
27 |
);
|
28 |
+
add_submenu_page( OPINIONSTAGE_MENU_SLUG, 'View My Items', 'My Items', 'edit_posts', OPINIONSTAGE_MENU_SLUG );
|
29 |
+
add_submenu_page( OPINIONSTAGE_MENU_SLUG, 'Get Help', 'Get Help', 'edit_posts', OPINIONSTAGE_HELP_RESOURCE_SLUG, 'opinionstage_load_template' );
|
|
|
|
|
30 |
} else {
|
31 |
add_menu_page(
|
32 |
__( 'Opinion Stage', 'social-polls-by-opinionstage' ),
|
39 |
);
|
40 |
add_submenu_page( OPINIONSTAGE_GETTING_STARTED_SLUG, 'Getting Started', 'Getting Started', 'edit_posts', OPINIONSTAGE_GETTING_STARTED_SLUG, 'opinionstage_load_template' );
|
41 |
add_submenu_page( OPINIONSTAGE_GETTING_STARTED_SLUG, 'Create...', 'Create...', 'edit_posts', OPINIONSTAGE_MENU_SLUG, 'opinionstage_load_template' );
|
|
|
42 |
}
|
43 |
}
|
44 |
}
|
admin/resources/common.php
CHANGED
@@ -19,7 +19,6 @@ function opinionstage_common_load_resources() {
|
|
19 |
opinionstage_asset_name( 'menu-page' ),
|
20 |
'OPINIONSTAGE',
|
21 |
array(
|
22 |
-
'myPlacementsNonce' => wp_create_nonce( 'opinionstage-my-placements' ),
|
23 |
'myItemsNonce' => wp_create_nonce( 'opinionstage-load-my-items' ),
|
24 |
)
|
25 |
);
|
19 |
opinionstage_asset_name( 'menu-page' ),
|
20 |
'OPINIONSTAGE',
|
21 |
array(
|
|
|
22 |
'myItemsNonce' => wp_create_nonce( 'opinionstage-load-my-items' ),
|
23 |
)
|
24 |
);
|
admin/template-parts/my-items-tbody-element.php
CHANGED
@@ -25,7 +25,7 @@
|
|
25 |
<tbody>
|
26 |
<tr>
|
27 |
<td><span class="os-icon-plugin icon-os-common-date"></span>
|
28 |
-
<div class="label"><?php echo esc_html( $item['attributes']['updated-at'] ); ?></div>
|
29 |
</td>
|
30 |
</tr>
|
31 |
</tbody>
|
@@ -33,16 +33,17 @@
|
|
33 |
</div>
|
34 |
</td>
|
35 |
<td class="action">
|
36 |
-
<div class="opinionstage-item-action-container"
|
37 |
-
|
|
|
|
|
|
|
38 |
class="opinionstage-blue-bordered-btn opinionstage-edit-content "
|
39 |
-
target="_blank"> <?php esc_html_e( '
|
40 |
-
|
41 |
-
class="opinionstage-blue-bordered-btn opinionstage-edit-content "
|
42 |
-
target="_blank"> <?php esc_html_e( 'Edit', 'social-polls-by-opinionstage' ); ?> </a><a
|
43 |
-
href="<?php echo esc_url( $item['attributes']['stats-url'] ); ?>"
|
44 |
class="opinionstage-blue-bordered-btn opinionstage-edit-content "
|
45 |
-
target="_blank"> <?php esc_html_e( 'Results', 'social-polls-by-opinionstage' ); ?> </a
|
|
|
46 |
</td>
|
47 |
</tr>
|
48 |
</tbody>
|
25 |
<tbody>
|
26 |
<tr>
|
27 |
<td><span class="os-icon-plugin icon-os-common-date"></span>
|
28 |
+
<div class="label"><?php echo esc_html( gmdate( 'j F Y', strtotime( $item['attributes']['updated-at'] ) ) ); ?></div>
|
29 |
</td>
|
30 |
</tr>
|
31 |
</tbody>
|
33 |
</div>
|
34 |
</td>
|
35 |
<td class="action">
|
36 |
+
<div class="opinionstage-item-action-container">
|
37 |
+
<a href="#"
|
38 |
+
class="opinionstage-blue-bordered-btn opinionstage-edit-content opinionstage-open-modal"
|
39 |
+
data-shortcode='<?php echo esc_attr( htmlspecialchars( $item['attributes']['shortcode'], ENT_QUOTES ) ); ?>'> <?php esc_html_e( 'Add To Site', 'social-polls-by-opinionstage' ); ?> </a>
|
40 |
+
<a href="<?php echo esc_url( $item['attributes']['edit-url'] ); ?>"
|
41 |
class="opinionstage-blue-bordered-btn opinionstage-edit-content "
|
42 |
+
target="_blank"> <?php esc_html_e( 'Edit', 'social-polls-by-opinionstage' ); ?> </a>
|
43 |
+
<a href="<?php echo esc_url( $item['attributes']['stats-url'] ); ?>"
|
|
|
|
|
|
|
44 |
class="opinionstage-blue-bordered-btn opinionstage-edit-content "
|
45 |
+
target="_blank"> <?php esc_html_e( 'Results', 'social-polls-by-opinionstage' ); ?> </a>
|
46 |
+
</div>
|
47 |
</td>
|
48 |
</tr>
|
49 |
</tbody>
|
admin/template-parts/widget-form.php
ADDED
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div class="opinionstage-sidebar-widget">
|
2 |
+
<?php if ( $os_client_logged_in ) { ?>
|
3 |
+
|
4 |
+
<img src="<?php echo esc_url( $logo_url ); ?>">
|
5 |
+
<p>
|
6 |
+
<label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php esc_html_e( 'Title', 'social-polls-by-opinionstage' ); ?></label>
|
7 |
+
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text" placeholder="<?php esc_html_e( 'Enter the title here', 'social-polls-by-opinionstage' ); ?>" value="<?php echo esc_attr( $title ); ?>">
|
8 |
+
</p>
|
9 |
+
<?php
|
10 |
+
if ( $header_above_selected_widget ) {
|
11 |
+
?>
|
12 |
+
<label><?php echo esc_html( $header_above_selected_widget ); ?></label>
|
13 |
+
<?php
|
14 |
+
}
|
15 |
+
$style = 'display:none;';
|
16 |
+
if ( $os_widget_title || $os_widget_img_url ) {
|
17 |
+
$style = '';
|
18 |
+
}
|
19 |
+
?>
|
20 |
+
<div data-os-widget-id="<?php echo esc_attr( $this->id ); ?>">
|
21 |
+
<div class="opinionstage-selected-widget" style="<?php echo esc_attr($style); ?>">
|
22 |
+
<div class="opinionstage-widget-img-url-wrapper">
|
23 |
+
<div class="inner">
|
24 |
+
<?php if ($os_widget_img_url) { ?>
|
25 |
+
<img src="<?php echo esc_url($os_widget_img_url); ?>">
|
26 |
+
<?php } ?>
|
27 |
+
</div>
|
28 |
+
|
29 |
+
<div class="opinionstage-widget-overlay">
|
30 |
+
<div class="opinionstage-inner">
|
31 |
+
<a href="<?php echo esc_url($os_widget_view_url); ?>" class="opininstage-view"
|
32 |
+
target="_blank"><?php esc_html_e('View', 'social-polls-by-opinionstage'); ?></a>
|
33 |
+
<a href="<?php echo esc_url($os_widget_edit_url); ?>" class="opininstage-edit"
|
34 |
+
target="_blank"><?php esc_html_e('Edit', 'social-polls-by-opinionstage'); ?></a>
|
35 |
+
<a href="<?php echo esc_url($os_widget_stats_url); ?>" class="opininstage-stats"
|
36 |
+
target="_blank"><?php esc_html_e('Statistics', 'social-polls-by-opinionstage'); ?></a>
|
37 |
+
</div>
|
38 |
+
</div>
|
39 |
+
</div>
|
40 |
+
<span class="opinionstage-widget-title"><?php echo esc_html($os_widget_title); ?></span>
|
41 |
+
</div>
|
42 |
+
|
43 |
+
<div class="opinionstage-sidebar-actions">
|
44 |
+
<div class="opinionstage-sidebar-config">
|
45 |
+
<a data-open-popup-for-widget="<?php echo esc_attr( $this->id ); ?>" href="#"
|
46 |
+
target="_blank"
|
47 |
+
class='opinionstage-blue-bordered-btn opinionstage-edit-content'><?php echo esc_html($popup_button_title); ?></a>
|
48 |
+
</div>
|
49 |
+
<div class="opinionstage-clearfix"></div>
|
50 |
+
<textarea name="<?php echo esc_attr($this->get_field_name('opinionstage-widget-data')); ?>"
|
51 |
+
class="opinionstage-widget-data"><?php echo esc_attr($os_widget_json); ?></textarea>
|
52 |
+
|
53 |
+
<div class="opinionstage-sidebar-enabled">
|
54 |
+
<input type="checkbox" id="<?php echo esc_attr($this->get_field_id('enabled')); ?>"
|
55 |
+
name="<?php echo esc_attr($this->get_field_name('enabled')); ?>"
|
56 |
+
value="1" <?php checked($enabled, 1, true); ?> />
|
57 |
+
<label for="<?php echo esc_attr($this->get_field_id('enabled')); ?>"><?php esc_html_e('Enable widget', 'social-polls-by-opinionstage'); ?></label>
|
58 |
+
</div>
|
59 |
+
</div>
|
60 |
+
</div>
|
61 |
+
<?php } else { ?>
|
62 |
+
<img src="<?php echo esc_url( plugins_url( 'admin/images/os-logo.png', dirname( __FILE__ ) ) ); ?>">
|
63 |
+
<p class="connection_message"><?php esc_html_e('Connect WordPress with Opinion Stage to enable the widget') ?></p>
|
64 |
+
<a href="<?php echo esc_url( admin_url( 'admin.php?page=opinionstage-getting-started' ) ); ?>" class="os-button start-login opinionstage-blue-btn"><?php esc_html_e( 'Connect', 'social-polls-by-opinionstage' ); ?></a>
|
65 |
+
<?php } ?>
|
66 |
+
</div>
|
admin/views/my_placements.php
DELETED
@@ -1,153 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
// block direct access to plugin PHP files:
|
3 |
-
defined( 'ABSPATH' ) or die();
|
4 |
-
|
5 |
-
?>
|
6 |
-
<div id="opinionstage-content">
|
7 |
-
<div class="opinionstage-header-wrapper">
|
8 |
-
<?php if ( !$os_client_logged_in ) {?>
|
9 |
-
<div class="opinionstage-logo-wrapper">
|
10 |
-
<div class="opinionstage-logo"></div>
|
11 |
-
</div>
|
12 |
-
<div class="opinionstage-status-content">
|
13 |
-
<div class='opinionstage-status-title'><b class="opinionstage-title">Connect WordPress with Opinion Stage to get started</b></div>
|
14 |
-
<form action="<?php echo OPINIONSTAGE_LOGIN_PATH ?>" method="get" class="opinionstage-connect-form">
|
15 |
-
<input type="hidden" name="utm_source" value="<?php echo OPINIONSTAGE_UTM_SOURCE ?>">
|
16 |
-
<input type="hidden" name="utm_campaign" value="<?php echo OPINIONSTAGE_UTM_CAMPAIGN ?>">
|
17 |
-
<input type="hidden" name="utm_medium" value="<?php echo OPINIONSTAGE_UTM_CONNECT_MEDIUM ?>">
|
18 |
-
<input type="hidden" name="o" value="<?php echo OPINIONSTAGE_WIDGET_API_KEY ?>">
|
19 |
-
<input type="hidden" name="callback" value="<?php echo opinionstage_callback_url()?>">
|
20 |
-
<input id="os-email" type="email" name="email" placeholder="Your email" data-os-email-input required>
|
21 |
-
<button class="opinionstage-connect-btn opinionstage-blue-btn" type="submit" id="os-start-login" data-os-login>CONNECT</button>
|
22 |
-
</form>
|
23 |
-
</div>
|
24 |
-
<?php } else { ?>
|
25 |
-
<div class="opinionstage-logo-wrapper">
|
26 |
-
<div class="opinionstage-logo"></div>
|
27 |
-
<div class="opinionstage-connectivity-status"><?php echo($os_options["email"]); ?>
|
28 |
-
<form method="POST" action="<?php echo get_admin_url(null, 'admin.php?page='.OPINIONSTAGE_DISCONNECT_PAGE)?>" class="opinionstage-connect-form">
|
29 |
-
<button class="opinionstage-disconnect" type="submit">Disconnect</button>
|
30 |
-
</form>
|
31 |
-
</div>
|
32 |
-
</div>
|
33 |
-
<?php } ?>
|
34 |
-
</div>
|
35 |
-
<div class="opinionstage-dashboard">
|
36 |
-
<div class="opinionstage-placement-dashboard">
|
37 |
-
<div id="opinionstage-section-placements" class="opinionstage-dashboard-section <?php echo( $os_client_logged_in ? '' : 'opinionstage-disabled-section' ) ?>">
|
38 |
-
<div class="opinionstage-section-header">
|
39 |
-
<div class="opinionstage-section-title">Placements</div>
|
40 |
-
<a href="https://help.opinionstage.com/wordpress-plugin/how-to-add-items-to-your-site-using-placements" style="float: right;" target="_blank">Need help working with Placements?</a>
|
41 |
-
</div>
|
42 |
-
<div class="opinionstage-section-content-wrapper">
|
43 |
-
<div class="opinionstage-section-content">
|
44 |
-
<div class="opinionstage-section-raw">
|
45 |
-
<div class="opinionstage-section-cell opinionstage-toggle-cell">
|
46 |
-
<div class="opinionstage-onoffswitch <?php echo( $os_client_logged_in ? '' : 'disabled' ) ?>">
|
47 |
-
<input type="checkbox" name="fly-out-switch" class="opinionstage-onoffswitch-checkbox"
|
48 |
-
<?php echo( $os_client_logged_in ? '' : 'disabled' ) ?>
|
49 |
-
id="fly-out-switch"
|
50 |
-
<?php echo($os_client_logged_in && $os_options['fly_out_active'] == 'true' ? 'checked' : '') ?>
|
51 |
-
>
|
52 |
-
<label class="opinionstage-onoffswitch-label" for="fly-out-switch">
|
53 |
-
<div class="opinionstage-onoffswitch-inner"></div>
|
54 |
-
<div class="opinionstage-onoffswitch-switch"></div>
|
55 |
-
</label>
|
56 |
-
</div>
|
57 |
-
</div>
|
58 |
-
<div class="opinionstage-section-cell opinionstage-description-cell">
|
59 |
-
<div class="title">Popup</div>
|
60 |
-
<div class="example">Add a content popup to your site</div>
|
61 |
-
</div>
|
62 |
-
<div class="opinionstage-section-cell opinionstage-btns-cell">
|
63 |
-
<?php if ( $os_client_logged_in ) {?>
|
64 |
-
<a href="<?php echo opinionstage_flyout_edit_url('content'); ?>" class='opinionstage-blue-bordered-btn opinionstage-edit-content' target="_blank">SELECT ITEM</a>
|
65 |
-
<a href="<?php echo opinionstage_flyout_edit_url('settings'); ?>" class='opinionstage-blue-bordered-btn opinionstage-edit-settings' target="_blank">
|
66 |
-
<div class="os-icon-plugin icon-os-common-settings"></div>
|
67 |
-
</a>
|
68 |
-
<?php } else { ?>
|
69 |
-
<a class='opinionstage-blue-bordered-btn opinionstage-edit-content disabled'>SELECT ITEM</a>
|
70 |
-
<a class='opinionstage-blue-bordered-btn opinionstage-edit-settings disabled'>
|
71 |
-
<div class="os-icon-plugin icon-os-common-settings"></div>
|
72 |
-
</a>
|
73 |
-
<?php } ?>
|
74 |
-
</div>
|
75 |
-
</div>
|
76 |
-
<div class="opinionstage-section-raw">
|
77 |
-
<div class="opinionstage-section-cell opinionstage-toggle-cell">
|
78 |
-
<div class="opinionstage-onoffswitch <?php echo( $os_client_logged_in ? '' : 'disabled' ) ?>">
|
79 |
-
<input type="checkbox" name="article-placement-switch" class="opinionstage-onoffswitch-checkbox"
|
80 |
-
<?php echo( $os_client_logged_in ? '' : 'disabled' ) ?>
|
81 |
-
id="article-placement-switch"
|
82 |
-
<?php echo( $os_client_logged_in && $os_options['article_placement_active'] == 'true' ? 'checked' : '') ?>
|
83 |
-
>
|
84 |
-
<label class="opinionstage-onoffswitch-label" for="article-placement-switch">
|
85 |
-
<div class="opinionstage-onoffswitch-inner"></div>
|
86 |
-
<div class="opinionstage-onoffswitch-switch"></div>
|
87 |
-
</label>
|
88 |
-
</div>
|
89 |
-
</div>
|
90 |
-
<div class="opinionstage-section-cell opinionstage-description-cell">
|
91 |
-
<div class="title">Article</div>
|
92 |
-
<div class="example">Add a content section to all posts</div>
|
93 |
-
</div>
|
94 |
-
<div class="opinionstage-section-cell opinionstage-btns-cell">
|
95 |
-
<?php if ( $os_client_logged_in ) {?>
|
96 |
-
<a href="<?php echo opinionstage_article_placement_edit_url('content'); ?>" class='opinionstage-blue-bordered-btn opinionstage-edit-content' target="_blank">SELECT ITEM</a>
|
97 |
-
<a href="<?php echo opinionstage_article_placement_edit_url('settings'); ?>" class='opinionstage-blue-bordered-btn opinionstage-edit-settings' target="_blank">
|
98 |
-
<div class="os-icon-plugin icon-os-common-settings"></div>
|
99 |
-
</a>
|
100 |
-
<?php } else { ?>
|
101 |
-
<a class='opinionstage-blue-bordered-btn opinionstage-edit-content disabled'>SELECT ITEM</a>
|
102 |
-
<a class='opinionstage-blue-bordered-btn opinionstage-edit-settings disabled'>
|
103 |
-
<div class="os-icon-plugin icon-os-common-settings"></div>
|
104 |
-
</a>
|
105 |
-
<?php } ?>
|
106 |
-
</div>
|
107 |
-
</div>
|
108 |
-
<div class="opinionstage-section-raw">
|
109 |
-
<div class="opinionstage-section-cell opinionstage-toggle-cell">
|
110 |
-
<div class="opinionstage-onoffswitch <?php echo( $os_client_logged_in ? '' : 'disabled' ) ?>">
|
111 |
-
<input type="checkbox" name="sidebar-placement-switch" class="opinionstage-onoffswitch-checkbox"
|
112 |
-
<?php echo( $os_client_logged_in ? '' : 'disabled' ) ?>
|
113 |
-
id="sidebar-placement-switch"
|
114 |
-
<?php echo($os_client_logged_in && $os_options['sidebar_placement_active'] == 'true' ? 'checked' : '') ?>
|
115 |
-
>
|
116 |
-
<label class="opinionstage-onoffswitch-label" for="sidebar-placement-switch">
|
117 |
-
<div class="opinionstage-onoffswitch-inner"></div>
|
118 |
-
<div class="opinionstage-onoffswitch-switch"></div>
|
119 |
-
</label>
|
120 |
-
</div>
|
121 |
-
</div>
|
122 |
-
<div class="opinionstage-section-cell opinionstage-description-cell">
|
123 |
-
<div class="title">Sidebar Widget</div>
|
124 |
-
<div class="example">
|
125 |
-
<?php if ( !$os_client_logged_in ) {?>
|
126 |
-
Add content to your sidebar
|
127 |
-
<?php } else { ?>
|
128 |
-
<div class="os-long-text">
|
129 |
-
<a href="<?php echo $url = get_admin_url('', '', 'admin') . 'widgets.php' ?>">Add widget to your sidebar</a>
|
130 |
-
</div>
|
131 |
-
<?php } ?>
|
132 |
-
</div>
|
133 |
-
</div>
|
134 |
-
<div class="opinionstage-section-cell opinionstage-btns-cell">
|
135 |
-
<?php if ( $os_client_logged_in ) {?>
|
136 |
-
<a href="<?php echo opinionstage_sidebar_placement_edit_url('content'); ?>" class='opinionstage-blue-bordered-btn opinionstage-edit-content' target="_blank">SELECT ITEM</a>
|
137 |
-
<a href="<?php echo opinionstage_sidebar_placement_edit_url('settings'); ?>" class='opinionstage-blue-bordered-btn opinionstage-edit-settings' target="_blank">
|
138 |
-
<div class="os-icon-plugin icon-os-common-settings"></div>
|
139 |
-
</a>
|
140 |
-
<?php } else { ?>
|
141 |
-
<a class='opinionstage-blue-bordered-btn opinionstage-edit-content disabled'>SELECT ITEM</a>
|
142 |
-
<a class='opinionstage-blue-bordered-btn opinionstage-edit-settings disabled'>
|
143 |
-
<div class="os-icon-plugin icon-os-common-settings"></div>
|
144 |
-
</a>
|
145 |
-
<?php } ?>
|
146 |
-
</div>
|
147 |
-
</div>
|
148 |
-
</div>
|
149 |
-
</div>
|
150 |
-
</div>
|
151 |
-
</div>
|
152 |
-
</div>
|
153 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/views/settings.php
CHANGED
@@ -7,25 +7,31 @@
|
|
7 |
|
8 |
defined( 'ABSPATH' ) || die();
|
9 |
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
<div id="opinionstage-content">
|
11 |
<div class="opinionstage-header-wrapper">
|
12 |
-
|
13 |
<div class="opinionstage-logo-wrapper">
|
14 |
<div class="opinionstage-logo"></div>
|
15 |
</div>
|
16 |
<div class="opinionstage-status-content">
|
17 |
-
<div class='opinionstage-status-title'><b class="opinionstage-title"
|
18 |
<form action="<?php echo esc_url( OPINIONSTAGE_LOGIN_PATH ); ?>" method="get" class="opinionstage-connect-form">
|
19 |
<input type="hidden" name="utm_source" value="<?php echo esc_attr( OPINIONSTAGE_UTM_SOURCE ); ?>">
|
20 |
<input type="hidden" name="utm_campaign" value="<?php echo esc_attr( OPINIONSTAGE_UTM_CAMPAIGN ); ?>">
|
21 |
<input type="hidden" name="utm_medium" value="<?php echo esc_attr( OPINIONSTAGE_UTM_CONNECT_MEDIUM ); ?>">
|
22 |
<input type="hidden" name="o" value="<?php echo esc_attr( OPINIONSTAGE_WIDGET_API_KEY ); ?>">
|
23 |
-
<input type="hidden" name="callback" value="<?php echo
|
24 |
-
<input id="os-email" type="email" name="email" placeholder="<?php
|
25 |
<button class="opinionstage-connect-btn opinionstage-blue-btn" type="submit" id="os-start-login" data-os-login><?php esc_html_e( 'CONNECT', 'social-polls-by-opinionstage' ); ?></button>
|
26 |
</form>
|
27 |
</div>
|
28 |
-
|
29 |
<div class="opinionstage-logo-wrapper">
|
30 |
<div class="opinionstage-logo"></div>
|
31 |
<div class="opinionstage-connectivity-status"><?php echo esc_html( $os_options['email'] ); ?>
|
@@ -34,16 +40,86 @@ defined( 'ABSPATH' ) || die();
|
|
34 |
</form>
|
35 |
</div>
|
36 |
</div>
|
37 |
-
|
38 |
</div>
|
39 |
-
|
40 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
<div id="opinionstage-section-create" class="opinionstage-dashboard-section">
|
42 |
<div class="opinionstage-section-header">
|
43 |
<div class="opinionstage-section-title"><?php esc_html_e( 'Create', 'social-polls-by-opinionstage' ); ?></div>
|
44 |
-
<?php echo opinionstage_help_links( __( 'Need help adding items to your site?', 'social-polls-by-opinionstage' ), 'https://help.opinionstage.com/wordpress-plugin/how-to-add-items-to-your-wordpress-site', 'opinionstage-need-help-link' ); ?>
|
45 |
</div>
|
46 |
-
<div class="opinionstage-section-content"
|
47 |
<div class="opinionstage-section-raw">
|
48 |
<div class="opinionstage-section-cell opinionstage-icon-cell">
|
49 |
<div class="os-icon-plugin"><img src="<?php echo esc_url( plugins_url( 'images/poll.png', dirname( __FILE__ ) ) ); ?>" ></div>
|
7 |
|
8 |
defined( 'ABSPATH' ) || die();
|
9 |
?>
|
10 |
+
|
11 |
+
<style type="text/css">
|
12 |
+
.content-item-image.quiz{
|
13 |
+
background-image: url(<?php echo esc_url( plugins_url( '', dirname( __FILE__ ) ) . '/images/form-not-found.png' ); ?>);
|
14 |
+
}
|
15 |
+
</style>
|
16 |
<div id="opinionstage-content">
|
17 |
<div class="opinionstage-header-wrapper">
|
18 |
+
<?php if ( ! $os_client_logged_in ) { ?>
|
19 |
<div class="opinionstage-logo-wrapper">
|
20 |
<div class="opinionstage-logo"></div>
|
21 |
</div>
|
22 |
<div class="opinionstage-status-content">
|
23 |
+
<div class='opinionstage-status-title'><b class="opinionstage-title"><?php esc_html_e( 'Connect WordPress with Opinion Stage to get started', 'social-polls-by-opinionstage' ); ?></b></div>
|
24 |
<form action="<?php echo esc_url( OPINIONSTAGE_LOGIN_PATH ); ?>" method="get" class="opinionstage-connect-form">
|
25 |
<input type="hidden" name="utm_source" value="<?php echo esc_attr( OPINIONSTAGE_UTM_SOURCE ); ?>">
|
26 |
<input type="hidden" name="utm_campaign" value="<?php echo esc_attr( OPINIONSTAGE_UTM_CAMPAIGN ); ?>">
|
27 |
<input type="hidden" name="utm_medium" value="<?php echo esc_attr( OPINIONSTAGE_UTM_CONNECT_MEDIUM ); ?>">
|
28 |
<input type="hidden" name="o" value="<?php echo esc_attr( OPINIONSTAGE_WIDGET_API_KEY ); ?>">
|
29 |
+
<input type="hidden" name="callback" value="<?php echo esc_url( opinionstage_callback_url() ); ?>">
|
30 |
+
<input id="os-email" type="email" name="email" placeholder="<?php esc_attr_e( 'Your email', 'social-polls-by-opinionstage' ); ?>" data-os-email-input required>
|
31 |
<button class="opinionstage-connect-btn opinionstage-blue-btn" type="submit" id="os-start-login" data-os-login><?php esc_html_e( 'CONNECT', 'social-polls-by-opinionstage' ); ?></button>
|
32 |
</form>
|
33 |
</div>
|
34 |
+
<?php } else { ?>
|
35 |
<div class="opinionstage-logo-wrapper">
|
36 |
<div class="opinionstage-logo"></div>
|
37 |
<div class="opinionstage-connectivity-status"><?php echo esc_html( $os_options['email'] ); ?>
|
40 |
</form>
|
41 |
</div>
|
42 |
</div>
|
43 |
+
<?php } ?>
|
44 |
</div>
|
45 |
+
|
46 |
+
<div id="container" class="opinionstage-dashboard">
|
47 |
+
<?php if ( $os_client_logged_in ) { ?>
|
48 |
+
<div class="opinionstage-item-view-dashboard">
|
49 |
+
<div id="opinionstage-section-create" class="opinionstage-dashboard-section">
|
50 |
+
<div class="opinionstage-section-header opinionstage-overflow-visible">
|
51 |
+
<div class="opinionstage-section-title"><?php esc_html_e( 'My Items', 'social-polls-by-opinionstage' ); ?></div>
|
52 |
+
<div class="opinionstage-header-inner-container">
|
53 |
+
<div class="opinionstage-header-inner-section">
|
54 |
+
<div class="select-wrapper">
|
55 |
+
<select id="itemList">
|
56 |
+
<option value="all"><?php esc_html_e( 'ALL ITEMS', 'social-polls-by-opinionstage' ); ?></option>
|
57 |
+
<option value="poll"><?php esc_html_e( 'POLL', 'social-polls-by-opinionstage' ); ?></option>
|
58 |
+
<option value="survey"><?php esc_html_e( 'SURVEY', 'social-polls-by-opinionstage' ); ?></option>
|
59 |
+
<option value="trivia"><?php esc_html_e( 'TRIVIA QUIZ', 'social-polls-by-opinionstage' ); ?></option>
|
60 |
+
<option value="outcome"><?php esc_html_e( 'PERSONALITY QUIZ', 'social-polls-by-opinionstage' ); ?></option>
|
61 |
+
<option value="form"><?php esc_html_e( 'CLASSIC FORM', 'social-polls-by-opinionstage' ); ?></option>
|
62 |
+
</select>
|
63 |
+
</div>
|
64 |
+
<div class="search search-container">
|
65 |
+
<input id="opinionstage-my-items-search-field" class="std-input" name="search" placeholder="Search" type="text">
|
66 |
+
</div>
|
67 |
+
</div>
|
68 |
+
|
69 |
+
<div class="select-wrapper">
|
70 |
+
<button class="opinionstage-connect-btn opinionstage-blue-btn opinionstage-item-create opinionstage-show-anchor-list"><?php esc_html_e( 'Create', 'social-polls-by-opinionstage' ); ?></button>
|
71 |
+
<ul class="opinionstage-anchors-list">
|
72 |
+
<li><?php echo opinionstage_create_poll_link( '', __( 'POLL', 'social-polls-by-opinionstage' ) ); ?></li>
|
73 |
+
<li><?php echo opinionstage_create_survey_link( '', __( 'SURVEY', 'social-polls-by-opinionstage' ) ); ?></li>
|
74 |
+
<li><?php echo opinionstage_create_trivia_link( '', __( 'TRIVIA QUIZ', 'social-polls-by-opinionstage' ) ); ?></li>
|
75 |
+
<li><?php echo opinionstage_create_personality_link( '', __( 'PERSONALITY QUIZ', 'social-polls-by-opinionstage' ) ); ?></li>
|
76 |
+
<li><?php echo opinionstage_create_form_link( '', __( 'CLASSIC FORM', 'social-polls-by-opinionstage' ) ); ?></li>
|
77 |
+
</ul>
|
78 |
+
</div>
|
79 |
+
</div>
|
80 |
+
</div>
|
81 |
+
</div>
|
82 |
+
<p id="opinionstage-my-items-loading-message" class="opinionstage-my-items-message"><?php esc_html_e( 'Loading...', 'social-polls-by-opinionstage' ); ?></p>
|
83 |
+
<p id="opinionstage-my-items-no-items" class="opinionstage-my-items-message"><?php esc_html_e( 'No items found', 'social-polls-by-opinionstage' ); ?></p>
|
84 |
+
<table id="opinionstage-items-table"></table>
|
85 |
+
|
86 |
+
<div id="opinionistage-my-items-page-modal-wrapper">
|
87 |
+
<div class="opinionistage-my-items-page-modal">
|
88 |
+
<div class="inner">
|
89 |
+
<span id="opinionstage-dialog-close" class="opinionstage-close"></span>
|
90 |
+
<p><?php esc_html_e( 'You can add item in the following ways:', 'social-polls-by-opinionstage' ); ?></p>
|
91 |
+
<ol>
|
92 |
+
<li><a href="https://help.opinionstage.com/en/articles/5161692-how-to-add-items-to-a-post-page" target="_blank"><?php esc_html_e( 'Add to post/page', 'social-polls-by-opinionstage' ); ?></a></li>
|
93 |
+
<li><a href="https://help.opinionstage.com/en/articles/5161716-how-to-add-an-item-to-a-sidebar-widget" target="_blank"><?php esc_html_e( 'Add to a sidebar Widget', 'social-polls-by-opinionstage' ); ?></a></li>
|
94 |
+
<li><a href="https://help.opinionstage.com/en/articles/5161746-how-to-add-an-item-as-a-popup-on-wordpress" target="_blank"><?php esc_html_e( 'Add as a popup', 'social-polls-by-opinionstage' ); ?></a></li>
|
95 |
+
<li><a href="https://help.opinionstage.com/en/articles/5161782-how-to-add-an-item-using-the-wordpress-shortcode" target="_blank"><?php esc_html_e( 'Add with the WordPress shortcode', 'social-polls-by-opinionstage' ); ?></a></li>
|
96 |
+
</ol>
|
97 |
+
<div class="opinionstage-textarea-wrapper">
|
98 |
+
<textarea name="opinionstage-widget-shortcode" id="opinionstage-widget-shortcode" data-wp-embed-code rows="1" readonly="readonly"></textarea> <a data-copy-text-from="data-wp-embed-code" href="#" class="no-text-decoration">Copy</a>
|
99 |
+
</div>
|
100 |
+
<p>
|
101 |
+
<?php esc_html_e( 'Need Help?', 'social-polls-by-opinionstage' ); ?>
|
102 |
+
<?php if ( defined( 'OPINIONSTAGE_LIVE_CHAT_URL' ) ) { ?>
|
103 |
+
<a href="<?php echo esc_url( OPINIONSTAGE_LIVE_CHAT_URL ); ?>" target="_blank"><?php esc_html_e( 'Contact Us' ); ?></a></p>
|
104 |
+
<?php } ?>
|
105 |
+
</p>
|
106 |
+
</div>
|
107 |
+
</div>
|
108 |
+
</div>
|
109 |
+
<p id="opinionstage-failed-load-items-request"><?php esc_html_e( 'An error occurred while loading the items.', 'social-polls-by-opinionstage' ); ?>
|
110 |
+
<?php if ( defined( 'OPINIONSTAGE_LIVE_CHAT_URL' ) ) { ?>
|
111 |
+
<a href="<?php echo esc_url( OPINIONSTAGE_LIVE_CHAT_URL ); ?>" target="_blank"><?php esc_html_e( 'Please contact our chat support for help', 'social-polls-by-opinionstage' ); ?></a></p>
|
112 |
+
<?php } ?>
|
113 |
+
<div id="opinionstage-load-more" class="btn btn_aqua btn_full-width"><?php esc_html_e( 'Click for more', 'social-polls-by-opinionstage' ); ?></div>
|
114 |
+
</div>
|
115 |
+
<?php } ?>
|
116 |
+
|
117 |
+
<div class="opinionstage-dashboard-left" <?php if ( $os_client_logged_in ) { ?>style="display: none;" <?php } ?>>
|
118 |
<div id="opinionstage-section-create" class="opinionstage-dashboard-section">
|
119 |
<div class="opinionstage-section-header">
|
120 |
<div class="opinionstage-section-title"><?php esc_html_e( 'Create', 'social-polls-by-opinionstage' ); ?></div>
|
|
|
121 |
</div>
|
122 |
+
<div class="opinionstage-section-content">
|
123 |
<div class="opinionstage-section-raw">
|
124 |
<div class="opinionstage-section-cell opinionstage-icon-cell">
|
125 |
<div class="os-icon-plugin"><img src="<?php echo esc_url( plugins_url( 'images/poll.png', dirname( __FILE__ ) ) ); ?>" ></div>
|
admin/views/view_my_items.php
DELETED
@@ -1,75 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* My Items Settings page
|
4 |
-
*
|
5 |
-
* @package OpinionStageWordPressPlugin
|
6 |
-
*/
|
7 |
-
|
8 |
-
defined( 'ABSPATH' ) || die();
|
9 |
-
?>
|
10 |
-
<style type="text/css">
|
11 |
-
.content-item-image.quiz{
|
12 |
-
background-image: url(<?php echo esc_url( plugins_url( '', dirname( __FILE__ ) ) . '/images/form-not-found.png' ); ?>);
|
13 |
-
background-repeat: no-repeat;
|
14 |
-
background-size: cover;
|
15 |
-
}
|
16 |
-
</style>
|
17 |
-
<div id="opinionstage-content">
|
18 |
-
<div class="opinionstage-header-wrapper">
|
19 |
-
<?php if ( $os_client_logged_in ) { ?>
|
20 |
-
<div class="opinionstage-logo-wrapper">
|
21 |
-
<div class="opinionstage-logo"></div>
|
22 |
-
<div class="opinionstage-connectivity-status"><?php echo esc_html( $os_options['email'] ); ?>
|
23 |
-
<form method="POST" action="<?php echo esc_url( get_admin_url( null, 'admin.php?page=' . OPINIONSTAGE_DISCONNECT_PAGE ) ); ?>" class="opinionstage-connect-form">
|
24 |
-
<button class="opinionstage-disconnect" type="submit"><?php esc_html_e( 'Disconnect', 'social-polls-by-opinionstage' ); ?></button>
|
25 |
-
</form>
|
26 |
-
</div>
|
27 |
-
</div>
|
28 |
-
<?php } ?>
|
29 |
-
</div>
|
30 |
-
<div id="container" class="opinionstage-dashboard">
|
31 |
-
<div class="opinionstage-item-view-dashboard">
|
32 |
-
<div id="opinionstage-section-create" class="opinionstage-dashboard-section">
|
33 |
-
<div class="opinionstage-section-header" style="overflow: visible">
|
34 |
-
<div class="opinionstage-section-title"><?php esc_html_e( 'My Items', 'social-polls-by-opinionstage' ); ?></div>
|
35 |
-
<div class="opinionstage-header-inner-container">
|
36 |
-
<div class="opinionstage-header-inner-section">
|
37 |
-
<a href="https://help.opinionstage.com/wordpress-plugin/how-to-add-items-to-your-wordpress-site" target="_blank"><?php esc_html_e( 'Need help adding items to your site?', 'social-polls-by-opinionstage' ); ?></a>
|
38 |
-
<div style="padding: 0 9px; width: 150px; display: inline-block;">
|
39 |
-
<select id="itemList">
|
40 |
-
<option value="all"><?php esc_html_e( 'ALL ITEMS', 'social-polls-by-opinionstage' ); ?></option>
|
41 |
-
<option value="poll"><?php esc_html_e( 'POLL', 'social-polls-by-opinionstage' ); ?></option>
|
42 |
-
<option value="survey"><?php esc_html_e( 'SURVEY', 'social-polls-by-opinionstage' ); ?></option>
|
43 |
-
<option value="trivia"><?php esc_html_e( 'TRIVIA QUIZ', 'social-polls-by-opinionstage' ); ?></option>
|
44 |
-
<option value="outcome"><?php esc_html_e( 'PERSONALITY QUIZ', 'social-polls-by-opinionstage' ); ?></option>
|
45 |
-
<option value="form"><?php esc_html_e( 'CLASSIC FORM', 'social-polls-by-opinionstage' ); ?></option>
|
46 |
-
</select>
|
47 |
-
</div>
|
48 |
-
<div class="search search-container">
|
49 |
-
<input id="opinionstage-my-items-search-field" class="std-input" name="search" placeholder="Search" type="text">
|
50 |
-
</div>
|
51 |
-
</div>
|
52 |
-
|
53 |
-
<div style="padding: 0 9px; width: 150px; display: inline-block;position: relative;">
|
54 |
-
<button class="opinionstage-connect-btn opinionstage-blue-btn opinionstage-item-create opinionstage-show-anchor-list"><?php esc_html_e( 'Create', 'social-polls-by-opinionstage' ); ?></button>
|
55 |
-
<ul class="opinionstage-anchors-list">
|
56 |
-
<li><?php echo opinionstage_create_poll_link( '', __( 'POLL', 'social-polls-by-opinionstage' ) ); ?></li>
|
57 |
-
<li><?php echo opinionstage_create_survey_link( '', __( 'SURVEY', 'social-polls-by-opinionstage' ) ); ?></li>
|
58 |
-
<li><?php echo opinionstage_create_trivia_link( '', __( 'TRIVIA QUIZ', 'social-polls-by-opinionstage' ) ); ?></li>
|
59 |
-
<li><?php echo opinionstage_create_personality_link( '', __( 'PERSONALITY QUIZ', 'social-polls-by-opinionstage' ) ); ?></li>
|
60 |
-
<li><?php echo opinionstage_create_form_link( '', __( 'CLASSIC FORM', 'social-polls-by-opinionstage' ) ); ?></li>
|
61 |
-
</ul>
|
62 |
-
</div>
|
63 |
-
</div>
|
64 |
-
</div>
|
65 |
-
</div>
|
66 |
-
<p id="opinionstage-my-items-loading-message" class="opinionstage-my-items-message" style="display: block; font-size: 16px; text-align: center;"><?php esc_html_e( 'Loading...', 'social-polls-by-opinionstage' ); ?></p>
|
67 |
-
<p id="opinionstage-my-items-no-items" class="opinionstage-my-items-message" style="display: none; font-size: 16px; text-align: center;"><?php esc_html_e( 'No items found', 'social-polls-by-opinionstage' ); ?></p>
|
68 |
-
<table id="opinionstage-items-table"></table>
|
69 |
-
<p class="no_item" style="display: none; font-size: 15px; text-align: center;"><?php esc_html_e( 'No items found', 'social-polls-by-opinionstage' ); ?></p>
|
70 |
-
<p id="opinionstage-failed-load-items-request" style="display: none; font-size: 15px; text-align: center;"><?php esc_html_e( 'An error occurred while loading the items.', 'social-polls-by-opinionstage' ); ?>
|
71 |
-
<a href="https://www.opinionstage.com/live-chat/?utm_source=wordpress&utm_campaign=WPMainPI&utm_medium=link&o=wp35e8" target="_blank"><?php esc_html_e('Please contact our chat support for help', 'social-polls-by-opinionstage'); ?></a></p>
|
72 |
-
<div id="opinionstage-load-more" class="btn btn_aqua btn_full-width" style="display: none;"><?php esc_html_e( 'Click for more', 'social-polls-by-opinionstage' ); ?></div>
|
73 |
-
</div>
|
74 |
-
</div>
|
75 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/content-popup/app/components/popup-content.js
CHANGED
@@ -45,7 +45,7 @@ export default Vue.component('popup-content', {
|
|
45 |
lastUpdateTime: null,
|
46 |
isCheckingWidgetUpdates: false,
|
47 |
widgetUpdatesChecker: null,
|
48 |
-
|
49 |
},
|
50 |
|
51 |
store,
|
45 |
lastUpdateTime: null,
|
46 |
isCheckingWidgetUpdates: false,
|
47 |
widgetUpdatesChecker: null,
|
48 |
+
}
|
49 |
},
|
50 |
|
51 |
store,
|
assets/content-popup/index.js
CHANGED
@@ -95,15 +95,14 @@ jQuery(function($) {
|
|
95 |
modal.open()
|
96 |
}
|
97 |
|
98 |
-
$('body').on('click', '[data-opinionstage-content-launch]', function (
|
99 |
-
|
100 |
|
|
|
|
|
|
|
101 |
OpinionStage.contentPopup.open({
|
102 |
onWidgetSelect
|
103 |
})
|
104 |
})
|
105 |
-
|
106 |
-
function onWidgetSelect (widget) {
|
107 |
-
wp.media.editor.insert(widget.shortcode)
|
108 |
-
}
|
109 |
})
|
95 |
modal.open()
|
96 |
}
|
97 |
|
98 |
+
$('body').on('click', '[data-opinionstage-content-launch]', function (e) {
|
99 |
+
e.preventDefault()
|
100 |
|
101 |
+
function onWidgetSelect (widget) {
|
102 |
+
wp.media.editor.insert(widget.shortcode)
|
103 |
+
}
|
104 |
OpinionStage.contentPopup.open({
|
105 |
onWidgetSelect
|
106 |
})
|
107 |
})
|
|
|
|
|
|
|
|
|
108 |
})
|
includes/opinionstage-ajax-functions.php
CHANGED
@@ -7,66 +7,17 @@
|
|
7 |
|
8 |
defined( 'ABSPATH' ) || die();
|
9 |
|
10 |
-
add_action( 'wp_ajax_opinionstage_ajax_toggle_flyout', 'opinionstage_ajax_toggle_flyout' );
|
11 |
-
add_action( 'wp_ajax_opinionstage_ajax_toggle_article_placement', 'opinionstage_ajax_toggle_article_placement' );
|
12 |
-
add_action( 'wp_ajax_opinionstage_ajax_toggle_sidebar_placement', 'opinionstage_ajax_toggle_sidebar_placement' );
|
13 |
add_action( 'wp_ajax_osa_message_delete', 'opinionstage_message_delete' );
|
14 |
add_action( 'wp_ajax_opinionstage_ajax_load_my_items', 'opinionstage_load_my_items' );
|
15 |
|
16 |
|
17 |
-
/**
|
18 |
-
* Toggle the flyout placement activation flag.
|
19 |
-
*/
|
20 |
-
function opinionstage_ajax_toggle_flyout() {
|
21 |
-
check_ajax_referer( 'opinionstage-my-placements', 'security' );
|
22 |
-
|
23 |
-
if ( isset( $_POST['activate'] ) ) {
|
24 |
-
$os_options = (array) get_option( OPINIONSTAGE_OPTIONS_KEY );
|
25 |
-
$os_options['fly_out_active'] = sanitize_text_field( wp_unslash( $_POST['activate'] ) );
|
26 |
-
|
27 |
-
update_option( OPINIONSTAGE_OPTIONS_KEY, $os_options );
|
28 |
-
}
|
29 |
-
wp_die( '1' );
|
30 |
-
}
|
31 |
-
|
32 |
-
/**
|
33 |
-
* Toggle the article placement activation flag.
|
34 |
-
*/
|
35 |
-
function opinionstage_ajax_toggle_article_placement() {
|
36 |
-
check_ajax_referer( 'opinionstage-my-placements', 'security' );
|
37 |
-
|
38 |
-
if ( isset( $_POST['activate'] ) ) {
|
39 |
-
$os_options = (array) get_option( OPINIONSTAGE_OPTIONS_KEY );
|
40 |
-
$os_options['article_placement_active'] = sanitize_text_field( wp_unslash( $_POST['activate'] ) );
|
41 |
-
|
42 |
-
update_option( OPINIONSTAGE_OPTIONS_KEY, $os_options );
|
43 |
-
}
|
44 |
-
wp_die( '1' );
|
45 |
-
}
|
46 |
-
|
47 |
-
/**
|
48 |
-
* Toggle the sidebar placement activation flag.
|
49 |
-
*/
|
50 |
-
function opinionstage_ajax_toggle_sidebar_placement() {
|
51 |
-
check_ajax_referer( 'opinionstage-my-placements', 'security' );
|
52 |
-
|
53 |
-
if ( isset( $_POST['activate'] ) ) {
|
54 |
-
$os_options = (array) get_option( OPINIONSTAGE_OPTIONS_KEY );
|
55 |
-
$os_options['sidebar_placement_active'] = sanitize_text_field( wp_unslash( $_POST['activate'] ) );
|
56 |
-
|
57 |
-
update_option( OPINIONSTAGE_OPTIONS_KEY, $os_options );
|
58 |
-
}
|
59 |
-
wp_die( '1' );
|
60 |
-
}
|
61 |
-
|
62 |
/**
|
63 |
* Delete message
|
64 |
*/
|
65 |
function opinionstage_message_delete() {
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
$message_content = delete_option( 'oswp_message_content' );
|
70 |
update_option( 'oswp_message_activity_time', time() );
|
71 |
}
|
72 |
wp_die( '1' );
|
@@ -94,6 +45,8 @@ function opinionstage_load_my_items() {
|
|
94 |
$url,
|
95 |
array(
|
96 |
'headers' => array(
|
|
|
|
|
97 |
'OSWP-Plugin-Version' => OPINIONSTAGE_WIDGET_VERSION,
|
98 |
'OSWP-Client-Token' => $access_token,
|
99 |
),
|
@@ -121,5 +74,6 @@ function opinionstage_load_my_items() {
|
|
121 |
);
|
122 |
}
|
123 |
|
|
|
124 |
wp_send_json_error();
|
125 |
}
|
7 |
|
8 |
defined( 'ABSPATH' ) || die();
|
9 |
|
|
|
|
|
|
|
10 |
add_action( 'wp_ajax_osa_message_delete', 'opinionstage_message_delete' );
|
11 |
add_action( 'wp_ajax_opinionstage_ajax_load_my_items', 'opinionstage_load_my_items' );
|
12 |
|
13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
/**
|
15 |
* Delete message
|
16 |
*/
|
17 |
function opinionstage_message_delete() {
|
18 |
+
if ( isset( $_POST['delete_options_oswp'] ) && true === $_POST['delete_options_oswp'] ) {
|
19 |
+
delete_option( 'oswp_message_title' );
|
20 |
+
delete_option( 'oswp_message_content' );
|
|
|
21 |
update_option( 'oswp_message_activity_time', time() );
|
22 |
}
|
23 |
wp_die( '1' );
|
45 |
$url,
|
46 |
array(
|
47 |
'headers' => array(
|
48 |
+
'Accept' => 'application/vnd.api+json',
|
49 |
+
'Content-Type' => 'application/vnd.api+json',
|
50 |
'OSWP-Plugin-Version' => OPINIONSTAGE_WIDGET_VERSION,
|
51 |
'OSWP-Client-Token' => $access_token,
|
52 |
),
|
74 |
);
|
75 |
}
|
76 |
|
77 |
+
opinionstage_error_log( "API response error($url): " . wp_remote_retrieve_response_code( $response ) );
|
78 |
wp_send_json_error();
|
79 |
}
|
includes/opinionstage-sidebar-widget.php
CHANGED
@@ -1,143 +1,153 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
-
|
4 |
-
defined( 'ABSPATH' ) or die();
|
5 |
-
|
6 |
-
require_once( plugin_dir_path( __FILE__ ).'opinionstage-client-session.php' );
|
7 |
-
|
8 |
-
// Sidebar widget class for embeding the Opinion Stage sidebar placement
|
9 |
-
class OpinionStageWidget extends WP_Widget {
|
10 |
-
function __construct() {
|
11 |
-
// register new widget
|
12 |
-
$widget_ops = array(
|
13 |
-
'classname' => 'opinionstage_widget',
|
14 |
-
'description' => __('Adds a highly engaging polls to your widget section.', OPINIONSTAGE_TEXT_DOMAIN)
|
15 |
-
);
|
16 |
-
parent::__construct(
|
17 |
-
'opinionstage_widget',
|
18 |
-
__( 'Opinion Stage Sidebar Widget', OPINIONSTAGE_TEXT_DOMAIN ),
|
19 |
-
$widget_ops
|
20 |
-
);
|
21 |
-
}
|
22 |
|
23 |
-
|
24 |
-
* Returns the widget content - including the title and the sidebar placement content (once enabled)
|
25 |
-
*/
|
26 |
-
function widget($args, $instance) {
|
27 |
-
extract($args);
|
28 |
-
echo $before_widget;
|
29 |
-
$title = @$instance['title'];
|
30 |
-
$os_options = (array) get_option(OPINIONSTAGE_OPTIONS_KEY);
|
31 |
|
32 |
-
|
33 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
|
35 |
-
|
36 |
-
|
37 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
}
|
39 |
|
|
|
40 |
echo $after_widget;
|
|
|
|
|
41 |
}
|
42 |
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
$
|
50 |
-
$os_options = (array) get_option(OPINIONSTAGE_OPTIONS_KEY);
|
51 |
-
$os_options['sidebar_placement_active'] = ('1' == $instance['enabled']);
|
52 |
-
update_option(OPINIONSTAGE_OPTIONS_KEY, $os_options);
|
53 |
-
return $instance;
|
54 |
}
|
55 |
-
|
56 |
-
|
57 |
-
* Generates the admin form for the widget.
|
58 |
-
*/
|
59 |
-
function form($instance) {
|
60 |
-
opinionstage_register_css_asset( 'icon-font', 'icon-font.css' );
|
61 |
-
opinionstage_register_css_asset( 'sidebar-widget', 'sidebar-widget.css' );
|
62 |
-
|
63 |
-
opinionstage_enqueue_css_asset('icon-font');
|
64 |
-
opinionstage_enqueue_css_asset('sidebar-widget');
|
65 |
-
|
66 |
-
$os_options = (array) get_option(OPINIONSTAGE_OPTIONS_KEY);
|
67 |
-
$title = isset($instance['title']) ? esc_attr($instance['title']) : '';
|
68 |
-
$enabled = $os_options['sidebar_placement_active'] == 'true' ? '1' : '';
|
69 |
-
$os_client_logged_in = opinionstage_user_logged_in();
|
70 |
-
|
71 |
-
?>
|
72 |
-
<script type="text/javascript">
|
73 |
-
jQuery(document).ready(function($) {
|
74 |
-
var callbackURL = '<?php echo opinionstage_callback_url() ?>';
|
75 |
-
|
76 |
-
$('.opinionstage-sidebar-widget').on('click', '.start-login', function(){
|
77 |
-
var emailInput = $('#os-email');
|
78 |
-
var email = $(emailInput).val();
|
79 |
-
var new_location = "<?php echo OPINIONSTAGE_LOGIN_PATH.'?callback=' ?>" + encodeURIComponent(callbackURL) + "&email=" + email;
|
80 |
-
window.location = new_location;
|
81 |
-
});
|
82 |
-
|
83 |
-
$('.opinionstage-sidebar-widget').on('click', '.switch-email', function(){
|
84 |
-
var new_location = "<?php echo OPINIONSTAGE_LOGIN_PATH.'?callback=' ?>" + encodeURIComponent(callbackURL);
|
85 |
-
window.location = new_location;
|
86 |
-
});
|
87 |
-
|
88 |
-
$('#os-email').keypress(function(e){
|
89 |
-
if (e.keyCode == 13) {
|
90 |
-
$('#os-start-login').click();
|
91 |
-
}
|
92 |
-
});
|
93 |
-
});
|
94 |
-
</script>
|
95 |
-
|
96 |
-
<div class="opinionstage-sidebar-widget">
|
97 |
-
<?php if ( $os_client_logged_in ) {?>
|
98 |
-
<!-- <div class="opinionstage-sidebar-connected">
|
99 |
-
<div class="os-icon icon-os-form-success"></div>
|
100 |
-
<div class="opinionstage-connected-info">
|
101 |
-
<div class="opinionstage-connected-title"><b>You are connected</b> to Opinion Stage with:</div>
|
102 |
-
<input id="os-email" type="email" disabled="disabled" value="<?php echo($os_options["email"]) ?>">
|
103 |
-
<a href="javascript:void(0)" class="switch-email" id="os-switch-email" >Switch Account</a>
|
104 |
-
</div>
|
105 |
-
</div> -->
|
106 |
-
<img src="<?php echo plugins_url( 'admin/images/os-logo.png', dirname(__FILE__) ); ?>" >
|
107 |
-
<p>
|
108 |
-
<label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title', OPINIONSTAGE_TEXT_DOMAIN); ?></label>
|
109 |
-
<input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" placeholder="Enter the title here" value="<?php echo $title; ?>" >
|
110 |
-
</p>
|
111 |
-
<div class="opinionstage-sidebar-actions">
|
112 |
-
<div class="opinionstage-sidebar-config">
|
113 |
-
<a href="<?php echo opinionstage_sidebar_placement_edit_url('content'); ?>" target="_blank" class='opinionstage-blue-bordered-btn opinionstage-edit-content'>SELECT ITEM</a>
|
114 |
-
<a href="<?php echo opinionstage_sidebar_placement_edit_url('settings'); ?>" class='opinionstage-blue-bordered-btn opinionstage-edit-settings <?php echo( $os_client_logged_in ? '' : 'disabled' ) ?>' target="_blank">
|
115 |
-
<div class="os-icon icon-os-common-settings"></div>
|
116 |
-
</a>
|
117 |
-
</div>
|
118 |
-
<div style="clear: both;"></div>
|
119 |
-
<div class="opinionstage-sidebar-enabled">
|
120 |
-
<input type="checkbox" id="<?php echo $this->get_field_id('enabled'); ?>" name="<?php echo $this->get_field_name('enabled'); ?>" value="1" <?php echo($enabled == '1' ? "checked" : "") ?> />
|
121 |
-
<label for="<?php echo $this->get_field_id('enabled'); ?>">Enable sidebar widget</label>
|
122 |
-
</div>
|
123 |
-
</div>
|
124 |
-
<?php } else { ?>
|
125 |
-
<img src="<?php echo plugins_url( 'admin/images/os-logo.png', dirname(__FILE__) ); ?>" >
|
126 |
-
<p class="connection_message">Connect WordPress with Opinion Stage to enable the widget</p>
|
127 |
-
<!-- <div class="os-icon icon-os-poll-client"></div>
|
128 |
-
<input id="os-email" type="email" class="os-email" placeholder="Enter Your Email">
|
129 |
-
<a href="javascript:void(0)" class="os-button start-login" id="os-start-login">Connect</a>-->
|
130 |
-
<a href="<?php echo admin_url( 'admin.php?page=opinionstage-getting-started' ); ?>" class="os-button start-login opinionstage-blue-btn" id="os-start-login">Connect</a>
|
131 |
-
<?php } ?>
|
132 |
-
</div>
|
133 |
-
<?php
|
134 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
135 |
}
|
136 |
|
137 |
-
|
138 |
-
*
|
|
|
|
|
139 |
*/
|
140 |
-
function
|
141 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
142 |
}
|
143 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* Sidebar widget functional.
|
4 |
+
*
|
5 |
+
* @package OpinionStageWordPressPlugin
|
6 |
+
*/
|
7 |
|
8 |
+
defined( 'ABSPATH' ) || die();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
+
require_once plugin_dir_path( __FILE__ ) . 'opinionstage-client-session.php';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
|
12 |
+
/**
|
13 |
+
* Class OpinionStageWidget
|
14 |
+
*/
|
15 |
+
class OpinionStageWidget extends WP_Widget {
|
16 |
+
|
17 |
+
/**
|
18 |
+
* OpinionStageWidget constructor.
|
19 |
+
*/
|
20 |
+
public function __construct() {
|
21 |
+
|
22 |
+
$widget_ops = array(
|
23 |
+
'classname' => 'opinionstage_widget',
|
24 |
+
'description' => __( 'Add a quiz, poll, survey or form', 'social-polls-by-opinionstage' ),
|
25 |
+
);
|
26 |
+
parent::__construct(
|
27 |
+
'opinionstage_widget',
|
28 |
+
__( 'Opinion Stage Widget', 'social-polls-by-opinionstage' ),
|
29 |
+
$widget_ops
|
30 |
+
);
|
31 |
+
}
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Returns the widget content
|
35 |
+
*
|
36 |
+
* @param array $args args.
|
37 |
+
* @param array $instance instance.
|
38 |
+
*/
|
39 |
+
public function widget( $args, $instance ) {
|
40 |
|
41 |
+
if ( isset( $instance['opinionstage-widget-data'] ) && json_decode( $instance['opinionstage-widget-data'] ) ) {
|
42 |
+
|
43 |
+
$os_widget_obj = json_decode( $instance['opinionstage-widget-data'] );
|
44 |
+
|
45 |
+
if ( ! isset( $instance['enabled'] ) || intval( $instance['enabled'] ) !== 1 ) {
|
46 |
+
return;
|
47 |
+
}
|
48 |
+
|
49 |
+
$before_widget = isset( $args['before_widget'] ) ? $args['before_widget'] : '';
|
50 |
+
$after_widget = isset( $args['after_widget'] ) ? $args['after_widget'] : '';
|
51 |
+
|
52 |
+
$title = isset( $instance['title'] ) ? $instance['title'] : '';
|
53 |
+
//phpcs:disable
|
54 |
+
echo $before_widget;
|
55 |
+
if ( '' !== $title ) {
|
56 |
+
echo $args['before_title'];
|
57 |
+
echo $instance['title'];
|
58 |
+
echo $args['after_title'];
|
59 |
}
|
60 |
|
61 |
+
echo do_shortcode( $os_widget_obj->shortcode );
|
62 |
echo $after_widget;
|
63 |
+
//phpcs:enable
|
64 |
+
return;
|
65 |
}
|
66 |
|
67 |
+
// deprecated code - loads placement --start
|
68 |
+
extract( $args );
|
69 |
+
echo $before_widget;
|
70 |
+
$title = @$instance['title'];
|
71 |
+
$os_options = (array) get_option( OPINIONSTAGE_OPTIONS_KEY );
|
72 |
+
if ( ! empty( $title ) && $os_options['sidebar_placement_active'] == 'true' ) {
|
73 |
+
echo $before_title . apply_filters( 'widget_title', $title ) . $after_title;
|
|
|
|
|
|
|
|
|
74 |
}
|
75 |
+
if ( ! empty( $os_options['sidebar_placement_id'] ) && $os_options['sidebar_placement_active'] == 'true' ) {
|
76 |
+
echo opinionstage_widget_placement( opinionstage_placement_embed_code_url( $os_options['sidebar_placement_id'] ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
}
|
78 |
+
echo $after_widget;
|
79 |
+
// deprecated code - loads placement --end
|
80 |
+
}
|
81 |
+
|
82 |
+
/**
|
83 |
+
* Updates the widget settings (title and enabled flag)
|
84 |
+
*
|
85 |
+
* @param array $new_instance new_instance.
|
86 |
+
* @param array $old_instance old_instance.
|
87 |
+
* @return mixed
|
88 |
+
*/
|
89 |
+
public function update( $new_instance, $old_instance ) {
|
90 |
+
$instance = $old_instance;
|
91 |
+
$instance['title'] = wp_strip_all_tags( $new_instance['title'] );
|
92 |
+
$instance['enabled'] = wp_strip_all_tags( $new_instance['enabled'] );
|
93 |
+
|
94 |
+
$instance['opinionstage-widget-data'] = $new_instance['opinionstage-widget-data'];
|
95 |
+
|
96 |
+
return $instance;
|
97 |
}
|
98 |
|
99 |
+
/**
|
100 |
+
* Generates the admin form for the widget.
|
101 |
+
*
|
102 |
+
* @param array $instance instance.
|
103 |
*/
|
104 |
+
public function form( $instance ) {
|
105 |
+
opinionstage_register_css_asset( 'icon-font', 'icon-font.css' );
|
106 |
+
opinionstage_register_css_asset( 'sidebar-widget', 'sidebar-widget.css' );
|
107 |
+
|
108 |
+
opinionstage_enqueue_css_asset( 'icon-font' );
|
109 |
+
opinionstage_enqueue_css_asset( 'sidebar-widget' );
|
110 |
+
|
111 |
+
$title = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : '';
|
112 |
+
$enabled = isset( $instance['enabled'] ) ? intval( $instance['enabled'] ) : '';
|
113 |
+
|
114 |
+
$os_widget_json = isset( $instance['opinionstage-widget-data'] ) ? $instance['opinionstage-widget-data'] : '';
|
115 |
+
$os_widget_obj = json_decode( $os_widget_json );
|
116 |
+
|
117 |
+
$os_widget_id = '';
|
118 |
+
$os_widget_title = '';
|
119 |
+
$os_widget_img_url = '';
|
120 |
+
$os_widget_edit_url = '';
|
121 |
+
$os_widget_view_url = '';
|
122 |
+
$os_widget_stats_url = '';
|
123 |
+
//phpcs:disable
|
124 |
+
if ( is_object( $os_widget_obj ) ) {
|
125 |
+
$os_widget_id = $os_widget_obj->id;
|
126 |
+
$os_widget_title = $os_widget_obj->title;
|
127 |
+
$os_widget_img_url = $os_widget_obj->imageUrl;
|
128 |
+
$os_widget_edit_url = $os_widget_obj->editUrl;
|
129 |
+
$os_widget_view_url = $os_widget_obj->landingPageUrl;
|
130 |
+
$os_widget_stats_url = $os_widget_obj->statsUrl;
|
131 |
+
}
|
132 |
+
//phpcs:enable
|
133 |
+
|
134 |
+
$popup_button_title = __( 'Select Item', 'social-polls-by-opinionstage' );
|
135 |
+
$header_above_selected_widget = '';
|
136 |
+
if ( '' !== $os_widget_id ) {
|
137 |
+
$popup_button_title = __( 'Change Item', 'social-polls-by-opinionstage' );
|
138 |
+
$header_above_selected_widget = __( 'Selected Item:', 'social-polls-by-opinionstage' );
|
139 |
+
}
|
140 |
+
|
141 |
+
$os_client_logged_in = opinionstage_user_logged_in();
|
142 |
+
$logo_url = plugins_url( 'admin/images/os-logo.png', dirname( __FILE__ ) );
|
143 |
+
include plugin_dir_path( dirname( __FILE__ ) ) . 'admin/template-parts/widget-form.php';
|
144 |
}
|
145 |
+
}
|
146 |
+
|
147 |
+
/**
|
148 |
+
* Register Sidebar Placement Widget.
|
149 |
+
*/
|
150 |
+
function opinionstage_init_widget() {
|
151 |
+
register_widget( 'OpinionStageWidget' );
|
152 |
+
}
|
153 |
+
|
includes/opinionstage-utility-functions.php
CHANGED
@@ -154,17 +154,6 @@ function opinionstage_flyout_edit_url( $tab ) {
|
|
154 |
return OPINIONSTAGE_SERVER_BASE . '/containers/' . $os_options['fly_id'] . '/edit?selected_tab=' . $tab;
|
155 |
}
|
156 |
|
157 |
-
/**
|
158 |
-
* Generates a link for editing the article placement on Opinion Stage site
|
159 |
-
*
|
160 |
-
* @param string $tab tab.
|
161 |
-
* @return string
|
162 |
-
*/
|
163 |
-
function opinionstage_article_placement_edit_url( $tab ) {
|
164 |
-
$os_options = (array) get_option( OPINIONSTAGE_OPTIONS_KEY );
|
165 |
-
return OPINIONSTAGE_SERVER_BASE . '/containers/' . $os_options['article_placement_id'] . '/edit?selected_tab=' . $tab;
|
166 |
-
}
|
167 |
-
|
168 |
/**
|
169 |
* Generates a link for editing the sidebar placement on Opinion Stage site
|
170 |
*
|
154 |
return OPINIONSTAGE_SERVER_BASE . '/containers/' . $os_options['fly_id'] . '/edit?selected_tab=' . $tab;
|
155 |
}
|
156 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
157 |
/**
|
158 |
* Generates a link for editing the sidebar placement on Opinion Stage site
|
159 |
*
|
opinionstage-polls.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Poll, Survey, Form & Quiz Maker by OpinionStage (Deprecated)
|
4 |
Plugin URI: https://www.opinionstage.com
|
5 |
Description: Add a highly engaging poll, survey, quiz or contact form builder to your site. You can add the poll, survey, quiz or form to any post/page or to the sidebar.
|
6 |
-
Version: 19.7.
|
7 |
Author: OpinionStage.com
|
8 |
Author URI: https://www.opinionstage.com
|
9 |
Text Domain: social-polls-by-opinionstage
|
3 |
Plugin Name: Poll, Survey, Form & Quiz Maker by OpinionStage (Deprecated)
|
4 |
Plugin URI: https://www.opinionstage.com
|
5 |
Description: Add a highly engaging poll, survey, quiz or contact form builder to your site. You can add the poll, survey, quiz or form to any post/page or to the sidebar.
|
6 |
+
Version: 19.7.8
|
7 |
Author: OpinionStage.com
|
8 |
Author URI: https://www.opinionstage.com
|
9 |
Text Domain: social-polls-by-opinionstage
|
plugin.php
CHANGED
@@ -8,7 +8,7 @@
|
|
8 |
* Plugin Name: Poll, Survey & Quiz by OpinionStage
|
9 |
* Plugin URI: https://www.opinionstage.com
|
10 |
* Description: Add a highly engaging poll, survey, quiz or contact form builder to your site. You can add the poll, survey, quiz or form to any post/page or to the sidebar.
|
11 |
-
* Version: 19.7.
|
12 |
* Author: OpinionStage.com
|
13 |
* Author URI: https://www.opinionstage.com
|
14 |
* Text Domain: social-polls-by-opinionstage
|
@@ -34,7 +34,7 @@ if ( defined( 'WP_DEBUG' ) && true === WP_DEBUG ) {
|
|
34 |
}
|
35 |
}
|
36 |
|
37 |
-
define( 'OPINIONSTAGE_WIDGET_VERSION', '19.7.
|
38 |
|
39 |
define( 'OPINIONSTAGE_TEXT_DOMAIN', 'social-polls-by-opinionstage' );
|
40 |
|
@@ -60,14 +60,24 @@ define( 'OPINIONSTAGE_WIDGET_SHORTCODE', 'os-widget' );
|
|
60 |
define( 'OPINIONSTAGE_PLACEMENT_SHORTCODE', 'osplacement' );
|
61 |
|
62 |
define( 'OPINIONSTAGE_MENU_SLUG', 'opinionstage-settings' );
|
63 |
-
define( 'OPINIONSTAGE_PLACEMENT_SLUG', 'opinionstage-my-placements' );
|
64 |
define( 'OPINIONSTAGE_GETTING_STARTED_SLUG', 'opinionstage-getting-started' );
|
65 |
-
define( 'OPINIONSTAGE_VIEW_ITEM_SLUG', 'opinionstage-view-my-items' );
|
66 |
define( 'OPINIONSTAGE_HELP_RESOURCE_SLUG', 'opinionstage-help-resource' );
|
67 |
|
68 |
define( 'OPINIONSTAGE_LOGIN_CALLBACK_SLUG', 'opinionstage-login-callback' );
|
69 |
define( 'OPINIONSTAGE_DISCONNECT_PAGE', 'opinionstage-disconnect-page' );
|
70 |
define( 'OPINIONSTAGE_CONTENT_LOGIN_CALLBACK_SLUG', 'opinionstage-content-login-callback-page' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
|
72 |
if ( ! version_compare( PHP_VERSION, '5.2', '>=' ) ) {
|
73 |
add_action( 'admin_notices', 'opinionstage_fail_php_version' );
|
@@ -78,7 +88,7 @@ if ( ! version_compare( PHP_VERSION, '5.2', '>=' ) ) {
|
|
78 |
function opinionstage_plugin_activated( $plugin ) {
|
79 |
// Check if active plugin file is plugin.php on plugin activate hook.
|
80 |
if ( plugin_basename( __FILE__ ) === $plugin ) {
|
81 |
-
$redirect_to = opinionstage_user_logged_in() ?
|
82 |
wp_safe_redirect( 'admin.php?page=' . $redirect_to );
|
83 |
exit();
|
84 |
}
|
@@ -132,7 +142,7 @@ if ( ! version_compare( PHP_VERSION, '5.2', '>=' ) ) {
|
|
132 |
*/
|
133 |
function opinionstage_fail_php_version() {
|
134 |
/* translators: %s: PHP version */
|
135 |
-
$message = sprintf( esc_html__( 'Poll, Survey & Quiz by OpinionStage requires PHP version %s+, plugin is currently NOT RUNNING.', 'opinionstage' ), '5.2' );
|
136 |
$html_message = sprintf( '<div class="error">%s</div>', wpautop( $message ) );
|
137 |
echo wp_kses_post( $html_message );
|
138 |
}
|
@@ -148,7 +158,7 @@ function opinionstage_fail_php_version() {
|
|
148 |
*/
|
149 |
function opinionstage_fail_wp_version() {
|
150 |
/* translators: %s: WordPress version */
|
151 |
-
$message = sprintf( esc_html__( 'Poll, Survey & Quiz by OpinionStage requires WordPress version %s+. Because you are using an earlier version, the plugin is currently NOT RUNNING.', 'opinionstage' ), '4.7' );
|
152 |
$html_message = sprintf( '<div class="error">%s</div>', wpautop( $message ) );
|
153 |
echo wp_kses_post( $html_message );
|
154 |
}
|
8 |
* Plugin Name: Poll, Survey & Quiz by OpinionStage
|
9 |
* Plugin URI: https://www.opinionstage.com
|
10 |
* Description: Add a highly engaging poll, survey, quiz or contact form builder to your site. You can add the poll, survey, quiz or form to any post/page or to the sidebar.
|
11 |
+
* Version: 19.7.8
|
12 |
* Author: OpinionStage.com
|
13 |
* Author URI: https://www.opinionstage.com
|
14 |
* Text Domain: social-polls-by-opinionstage
|
34 |
}
|
35 |
}
|
36 |
|
37 |
+
define( 'OPINIONSTAGE_WIDGET_VERSION', '19.7.8' );
|
38 |
|
39 |
define( 'OPINIONSTAGE_TEXT_DOMAIN', 'social-polls-by-opinionstage' );
|
40 |
|
60 |
define( 'OPINIONSTAGE_PLACEMENT_SHORTCODE', 'osplacement' );
|
61 |
|
62 |
define( 'OPINIONSTAGE_MENU_SLUG', 'opinionstage-settings' );
|
|
|
63 |
define( 'OPINIONSTAGE_GETTING_STARTED_SLUG', 'opinionstage-getting-started' );
|
|
|
64 |
define( 'OPINIONSTAGE_HELP_RESOURCE_SLUG', 'opinionstage-help-resource' );
|
65 |
|
66 |
define( 'OPINIONSTAGE_LOGIN_CALLBACK_SLUG', 'opinionstage-login-callback' );
|
67 |
define( 'OPINIONSTAGE_DISCONNECT_PAGE', 'opinionstage-disconnect-page' );
|
68 |
define( 'OPINIONSTAGE_CONTENT_LOGIN_CALLBACK_SLUG', 'opinionstage-content-login-callback-page' );
|
69 |
+
define(
|
70 |
+
'OPINIONSTAGE_LIVE_CHAT_URL',
|
71 |
+
add_query_arg(
|
72 |
+
array(
|
73 |
+
'utm_source' => OPINIONSTAGE_UTM_SOURCE,
|
74 |
+
'utm_campaign' => OPINIONSTAGE_UTM_CAMPAIGN,
|
75 |
+
'utm_medium' => OPINIONSTAGE_UTM_MEDIUM,
|
76 |
+
'o' => OPINIONSTAGE_WIDGET_API_KEY,
|
77 |
+
),
|
78 |
+
OPINIONSTAGE_SERVER_BASE . '/live-chat/'
|
79 |
+
)
|
80 |
+
);
|
81 |
|
82 |
if ( ! version_compare( PHP_VERSION, '5.2', '>=' ) ) {
|
83 |
add_action( 'admin_notices', 'opinionstage_fail_php_version' );
|
88 |
function opinionstage_plugin_activated( $plugin ) {
|
89 |
// Check if active plugin file is plugin.php on plugin activate hook.
|
90 |
if ( plugin_basename( __FILE__ ) === $plugin ) {
|
91 |
+
$redirect_to = opinionstage_user_logged_in() ? OPINIONSTAGE_MENU_SLUG : OPINIONSTAGE_GETTING_STARTED_SLUG;
|
92 |
wp_safe_redirect( 'admin.php?page=' . $redirect_to );
|
93 |
exit();
|
94 |
}
|
142 |
*/
|
143 |
function opinionstage_fail_php_version() {
|
144 |
/* translators: %s: PHP version */
|
145 |
+
$message = sprintf( esc_html__( 'Poll, Survey & Quiz by OpinionStage requires PHP version %s+, plugin is currently NOT RUNNING.', 'social-polls-by-opinionstage' ), '5.2' );
|
146 |
$html_message = sprintf( '<div class="error">%s</div>', wpautop( $message ) );
|
147 |
echo wp_kses_post( $html_message );
|
148 |
}
|
158 |
*/
|
159 |
function opinionstage_fail_wp_version() {
|
160 |
/* translators: %s: WordPress version */
|
161 |
+
$message = sprintf( esc_html__( 'Poll, Survey & Quiz by OpinionStage requires WordPress version %s+. Because you are using an earlier version, the plugin is currently NOT RUNNING.', 'social-polls-by-opinionstage' ), '4.7' );
|
162 |
$html_message = sprintf( '<div class="error">%s</div>', wpautop( $message ) );
|
163 |
echo wp_kses_post( $html_message );
|
164 |
}
|
public/shortcodes.php
CHANGED
@@ -1,100 +1,109 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
4 |
|
5 |
function opinionstage_enqueue_shortcodes_assets() {
|
6 |
-
opinionstage_register_javascript_asset('shortcodes', 'shortcodes.js', array('jquery'));
|
7 |
|
8 |
-
opinionstage_enqueue_js_asset('shortcodes');
|
9 |
}
|
10 |
|
11 |
-
function opinionstage_poll_or_set_shortcode($atts) {
|
12 |
if ( is_feed() ) {
|
13 |
-
return __("Note: There is a poll embedded within this post, please visit the site to participate in this post's poll.",
|
14 |
} else {
|
15 |
$shortcode_params = shortcode_atts(
|
16 |
-
array(
|
|
|
|
|
|
|
|
|
17 |
$atts,
|
18 |
OPINIONSTAGE_POLL_SHORTCODE
|
19 |
);
|
20 |
|
21 |
-
$id
|
22 |
-
$type
|
23 |
$width = $shortcode_params['width'];
|
24 |
|
25 |
-
return opinionstage_widget_placement( opinionstage_poll_or_set_embed_code_url($id, $type, $width) );
|
26 |
}
|
27 |
}
|
28 |
|
29 |
-
function opinionstage_widget_shortcode($atts) {
|
30 |
if ( is_feed() ) {
|
31 |
-
return __("Note: There is a widget embedded within this post, please visit the site to participate in this post's widget.",
|
32 |
} else {
|
33 |
$shortcode_params = shortcode_atts(
|
34 |
-
array(
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
$atts,
|
36 |
OPINIONSTAGE_WIDGET_SHORTCODE
|
37 |
);
|
38 |
|
39 |
-
$path
|
40 |
-
$comments
|
41 |
-
$sharing
|
42 |
$recommendations = $shortcode_params['recommendations'];
|
43 |
-
$width
|
44 |
|
45 |
-
return opinionstage_widget_placement( opinionstage_widget_embed_code_url($path, $comments, $sharing, $recommendations, $width) );
|
46 |
}
|
47 |
}
|
48 |
|
49 |
-
function opinionstage_placement_shortcode($atts) {
|
50 |
-
if ( !is_feed() ) {
|
51 |
$shortcode_params = shortcode_atts(
|
52 |
-
array('id' => 0),
|
53 |
$atts,
|
54 |
OPINIONSTAGE_PLACEMENT_SHORTCODE
|
55 |
);
|
56 |
|
57 |
-
$id = intval($shortcode_params['id']);
|
58 |
|
59 |
-
return opinionstage_widget_placement( opinionstage_placement_embed_code_url($id) );
|
60 |
}
|
61 |
}
|
62 |
|
63 |
-
function opinionstage_poll_or_set_embed_code_url($id, $type, $width) {
|
64 |
-
if ( isset($id) && !empty($id) ) {
|
65 |
-
if ($type == 'set') {
|
66 |
-
$embed_code_url = OPINIONSTAGE_API_PATH.
|
67 |
} else {
|
68 |
-
$embed_code_url = OPINIONSTAGE_API_PATH.
|
69 |
}
|
70 |
|
71 |
if ( is_home() ) {
|
72 |
-
$embed_code_url .=
|
73 |
}
|
74 |
|
75 |
return $embed_code_url;
|
76 |
}
|
77 |
}
|
78 |
|
79 |
-
function opinionstage_widget_embed_code_url($path, $comments, $sharing, $recommendations, $width) {
|
80 |
-
if ( isset($path) && !empty($path) ) {
|
81 |
-
$embed_code_url = OPINIONSTAGE_API_PATH.
|
82 |
return $embed_code_url;
|
83 |
}
|
84 |
}
|
85 |
|
86 |
function opinionstage_placement_embed_code_url( $id ) {
|
87 |
-
if ( isset($id) && !empty($id) ) {
|
88 |
-
|
89 |
-
return $embed_code_url;
|
90 |
}
|
91 |
}
|
92 |
|
93 |
function opinionstage_widget_placement( $url ) {
|
94 |
-
|
95 |
-
?>
|
96 |
-
<div data-opinionstage-embed-url="<?php echo $url ?>" style="display: none; visibility: hidden;"></div>
|
97 |
-
<?php
|
98 |
-
return ob_get_clean();
|
99 |
}
|
100 |
-
?>
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* Shortcode related functions
|
4 |
+
*
|
5 |
+
* @package OpinionStageWordPressPlugin
|
6 |
+
*/
|
7 |
+
|
8 |
+
defined( 'ABSPATH' ) || die();
|
9 |
|
10 |
function opinionstage_enqueue_shortcodes_assets() {
|
11 |
+
opinionstage_register_javascript_asset( 'shortcodes', 'shortcodes.js', array( 'jquery' ) );
|
12 |
|
13 |
+
opinionstage_enqueue_js_asset( 'shortcodes' );
|
14 |
}
|
15 |
|
16 |
+
function opinionstage_poll_or_set_shortcode( $atts ) {
|
17 |
if ( is_feed() ) {
|
18 |
+
return __( "Note: There is a poll embedded within this post, please visit the site to participate in this post's poll.", 'social-polls-by-opinionstage' );
|
19 |
} else {
|
20 |
$shortcode_params = shortcode_atts(
|
21 |
+
array(
|
22 |
+
'id' => 0,
|
23 |
+
'type' => 'poll',
|
24 |
+
'width' => '',
|
25 |
+
),
|
26 |
$atts,
|
27 |
OPINIONSTAGE_POLL_SHORTCODE
|
28 |
);
|
29 |
|
30 |
+
$id = intval( $shortcode_params['id'] );
|
31 |
+
$type = $shortcode_params['type'];
|
32 |
$width = $shortcode_params['width'];
|
33 |
|
34 |
+
return opinionstage_widget_placement( opinionstage_poll_or_set_embed_code_url( $id, $type, $width ) );
|
35 |
}
|
36 |
}
|
37 |
|
38 |
+
function opinionstage_widget_shortcode( $atts ) {
|
39 |
if ( is_feed() ) {
|
40 |
+
return __( "Note: There is a widget embedded within this post, please visit the site to participate in this post's widget.", 'social-polls-by-opinionstage' );
|
41 |
} else {
|
42 |
$shortcode_params = shortcode_atts(
|
43 |
+
array(
|
44 |
+
'path' => 0,
|
45 |
+
'comments' => 'true',
|
46 |
+
'sharing' => 'true',
|
47 |
+
'recommendations' => 'false',
|
48 |
+
'width' => '',
|
49 |
+
),
|
50 |
$atts,
|
51 |
OPINIONSTAGE_WIDGET_SHORTCODE
|
52 |
);
|
53 |
|
54 |
+
$path = $shortcode_params['path'];
|
55 |
+
$comments = $shortcode_params['comments'];
|
56 |
+
$sharing = $shortcode_params['sharing'];
|
57 |
$recommendations = $shortcode_params['recommendations'];
|
58 |
+
$width = $shortcode_params['width'];
|
59 |
|
60 |
+
return opinionstage_widget_placement( opinionstage_widget_embed_code_url( $path, $comments, $sharing, $recommendations, $width ) );
|
61 |
}
|
62 |
}
|
63 |
|
64 |
+
function opinionstage_placement_shortcode( $atts ) {
|
65 |
+
if ( ! is_feed() ) {
|
66 |
$shortcode_params = shortcode_atts(
|
67 |
+
array( 'id' => 0 ),
|
68 |
$atts,
|
69 |
OPINIONSTAGE_PLACEMENT_SHORTCODE
|
70 |
);
|
71 |
|
72 |
+
$id = intval( $shortcode_params['id'] );
|
73 |
|
74 |
+
return opinionstage_widget_placement( opinionstage_placement_embed_code_url( $id ) );
|
75 |
}
|
76 |
}
|
77 |
|
78 |
+
function opinionstage_poll_or_set_embed_code_url( $id, $type, $width ) {
|
79 |
+
if ( isset( $id ) && ! empty( $id ) ) {
|
80 |
+
if ( $type == 'set' ) {
|
81 |
+
$embed_code_url = OPINIONSTAGE_API_PATH . '/sets/' . $id . '/code.json';
|
82 |
} else {
|
83 |
+
$embed_code_url = OPINIONSTAGE_API_PATH . '/polls/' . $id . '/code.json?width=' . $width;
|
84 |
}
|
85 |
|
86 |
if ( is_home() ) {
|
87 |
+
$embed_code_url .= '?h=1';
|
88 |
}
|
89 |
|
90 |
return $embed_code_url;
|
91 |
}
|
92 |
}
|
93 |
|
94 |
+
function opinionstage_widget_embed_code_url( $path, $comments, $sharing, $recommendations, $width ) {
|
95 |
+
if ( isset( $path ) && ! empty( $path ) ) {
|
96 |
+
$embed_code_url = OPINIONSTAGE_API_PATH . '/widgets' . $path . '/code.json?comments=' . $comments . '&sharing=' . $sharing . '&recommendations=' . $recommendations . '&width=' . $width;
|
97 |
return $embed_code_url;
|
98 |
}
|
99 |
}
|
100 |
|
101 |
function opinionstage_placement_embed_code_url( $id ) {
|
102 |
+
if ( isset( $id ) && ! empty( $id ) ) {
|
103 |
+
return OPINIONSTAGE_API_PATH . '/placements/' . $id . '/code.json';
|
|
|
104 |
}
|
105 |
}
|
106 |
|
107 |
function opinionstage_widget_placement( $url ) {
|
108 |
+
return sprintf( '<div data-opinionstage-embed-url="%s" style="display: none; visibility: hidden;"></div>', esc_url( $url ) );
|
|
|
|
|
|
|
|
|
109 |
}
|
|
readme.txt
CHANGED
@@ -3,19 +3,16 @@ Contributors: opinionstage, yoffegil, kucaahbe
|
|
3 |
Donate link: https://www.opinionstage.com
|
4 |
Tags: poll, quiz, survey, poll plugin, quiz plugin, survey plugin
|
5 |
Requires at least: 2.8
|
6 |
-
Tested up to: 5.
|
7 |
-
Stable tag: 19.7.
|
8 |
Requires PHP: 5.2
|
9 |
|
10 |
Add a Poll, Survey, or Quiz to your Wordpress site. Create a poll, quiz, or survey from scratch or based on templates.
|
11 |
|
12 |
== Description ==
|
13 |
|
14 |
-
|
15 |
|
16 |
-
* <a href="https://www.opinionstage.com/templates/c/quizzes?o=wp35e8" target="_blank">Quiz Templates & Examples</a>
|
17 |
-
|
18 |
-
* <a href="https://www.opinionstage.com/templates/c/polls?o=wp35e8" target="_blank">Poll Templates & Examples</a>
|
19 |
|
20 |
Opinion Stage is a poll, survey and quiz maker plugin for WordPress. It's the easiest way to create anything from opinion polls, feedback surveys, buzzfeed-syle quizzes to contact forms.
|
21 |
You can create the items from scratch or using hundreds of optimized templates.
|
@@ -142,6 +139,11 @@ Opinion Stage makes it easy for you to comply with the GDPR regulation. For more
|
|
142 |
N/A
|
143 |
|
144 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
145 |
= 19.7.7 =
|
146 |
* internal code improvements
|
147 |
* tested up to 5.7 Wordpress
|
3 |
Donate link: https://www.opinionstage.com
|
4 |
Tags: poll, quiz, survey, poll plugin, quiz plugin, survey plugin
|
5 |
Requires at least: 2.8
|
6 |
+
Tested up to: 5.7
|
7 |
+
Stable tag: 19.7.8
|
8 |
Requires PHP: 5.2
|
9 |
|
10 |
Add a Poll, Survey, or Quiz to your Wordpress site. Create a poll, quiz, or survey from scratch or based on templates.
|
11 |
|
12 |
== Description ==
|
13 |
|
14 |
+
[Quiz Templates](https://www.opinionstage.com/templates/c/quizzes?o=wp35e8) | [Poll Templates](https://www.opinionstage.com/templates/c/polls?o=wp35e8) | [Survey Templates](https://www.opinionstage.com/templates/c/surveys?o=wp35e8)
|
15 |
|
|
|
|
|
|
|
16 |
|
17 |
Opinion Stage is a poll, survey and quiz maker plugin for WordPress. It's the easiest way to create anything from opinion polls, feedback surveys, buzzfeed-syle quizzes to contact forms.
|
18 |
You can create the items from scratch or using hundreds of optimized templates.
|
139 |
N/A
|
140 |
|
141 |
== Changelog ==
|
142 |
+
= 19.7.8 =
|
143 |
+
* internal code improvements
|
144 |
+
* My Items page UI update
|
145 |
+
* Removed Placements page
|
146 |
+
* Modified sidebar widget management UI
|
147 |
= 19.7.7 =
|
148 |
* internal code improvements
|
149 |
* tested up to 5.7 Wordpress
|